aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-08-14 16:06:48 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-08-14 16:06:48 +0200
commitb9c7203a641ca40a742555babc059cce912e6ca5 (patch)
tree48783e4e11c936e9b4fefe8db03a9799570a9536
parentChange some variables to scss vars. (diff)
downloadcalp-b9c7203a641ca40a742555babc059cce912e6ca5.tar.gz
calp-b9c7203a641ca40a742555babc059cce912e6ca5.tar.xz
Improve makefile.
-rw-r--r--Makefile9
-rw-r--r--module/entry-points/benchmark.scm24
2 files changed, 14 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index afa6ffd0..f1be069c 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ GUILE_SITE_DIR=$(shell guile -c "(display (%site-dir))")
GUILE_CCACHE_DIR=$(shell guile -c "(display (%site-ccache-dir))")
SCM_FILES = $(shell find module/ -type f -name \*.scm)
-GO_FILES = $(SCM_FILES:%=obj/%.go)
+GO_FILES = $(SCM_FILES:module/%.scm=obj/%.go)
GUILE_C_FLAGS = -Lmodule \
-Wunused-toplevel \
@@ -18,15 +18,16 @@ all: $(GO_FILES) README static
static:
$(MAKE) -C static
-obj/%.scm.go: %.scm
+obj/%.go: module/%.scm
@mkdir -p obj
- guild compile $(GUILE_C_FLAGS) -o $@ $<
+ @echo guild compile $<
+ @guild compile $(GUILE_C_FLAGS) -o $@ $<
clean:
$(MAKE) -C static clean
-rm -r obj
-install:
+install: all
install -d $(DESTDIR)$(GUILE_SITE_DIR) $(DESTDIR)$(GUILE_CCACHE_DIR)
rsync -a module/ $(DESTDIR)$(GUILE_SITE_DIR)
rsync -a obj/ $(DESTDIR)$(GUILE_CCACHE_DIR)
diff --git a/module/entry-points/benchmark.scm b/module/entry-points/benchmark.scm
index a8507fb9..fecc62f7 100644
--- a/module/entry-points/benchmark.scm
+++ b/module/entry-points/benchmark.scm
@@ -1,19 +1,19 @@
(define-module (entry-points benchmark)
- :export (main)
+ :use-module (util)
:use-module (ice-9 getopt-long)
:use-module (util options)
- :use-module (util)
- :use-module (srfi srfi-41)
+ :use-module ((srfi srfi-41) :select (stream->list))
+
+ :use-module ((vcomponent instance methods) :select (get-event-set))
+ :autoload (vcomponent instance) (global-event-object)
+
+ :export (main)
)
(define opt-spec
- `((field (value #t)
- (description
- "Which field from the current app to force. Most heavy fields are defined in "
- (i "(vcomponent)") ". Required."))
- (enable-output (single-char #\o)
+ `((enable-output (single-char #\o)
(description
"Output is be default supressed, since many fields contain way to much data "
"to read. This turns it on again."))
@@ -23,17 +23,11 @@
(define (main args)
(define opts (getopt-long args (getopt-opt opt-spec)))
- (define field (and=> (option-ref opts 'field #f) string->symbol))
-
(when (option-ref opts 'help #f)
(print-arg-help opt-spec)
(throw 'return))
- (unless field
- (throw 'argument-error "Field `field' required."))
-
- (let ((strm ((@ (vcomponent instance) get-event-set)
- (@ (vcomponent instance) global-event-object))))
+ (let ((strm (get-event-set global-event-object)))
(if (option-ref opts 'enable-output #f)
(write (stream->list 1000 strm))
(stream->list 1000 strm))))