From a7b7297ee2de9daf7ba8362501ccba348d33ca88 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 19 Jul 2017 19:53:21 +0200 Subject: [PATCH] build: Add target list. * GNUmakefile (%): Handle all targets. * make.scm (main): Show and implement target list. --- GNUmakefile | 5 ++++- make.scm | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 2a8601c9..db67ec0c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -3,10 +3,13 @@ GUILE_FLAGS:=--no-auto-compile -L . -L guile -C . -C guile include .config.make -PHONY_TARGETS:= all all-go check clean clean-go default help +PHONY_TARGETS:= all all-go check clean clean-go default help list .PHONY: $(PHONY_TARGETS) $(PHONY_TARGETS): $(GUILE) $(GUILE_FLAGS) -s make.scm $@ +%: + $(GUILE) $(GUILE_FLAGS) -s make.scm $@ + .config.make: ./configure diff --git a/make.scm b/make.scm index 6f17abe4..2e546feb 100755 --- a/make.scm +++ b/make.scm @@ -349,6 +349,7 @@ exec ${GUILE-guile} --no-auto-compile -L . -L guile -C . -C guile -s "$0" ${1+"$ (cond ((member "all-go" args) #t) ((member "clean-go" args) (map delete-file (filter file-exists? %go-files))) ((member "clean" args) (clean)) + ((member "list" args) (display (string-join (map target-file-name %targets) "\n" 'suffix))) ((member "help" args) (format #t "Usage: ./make.scm [TARGET]... Targets: @@ -358,6 +359,7 @@ Targets: clean clean-go help~a + list " ;;(string-join (map target-file-name %targets) "\n " 'prefix) (string-join (filter (negate (cut string-index <> #\/)) (map target-file-name %targets)) "\n " 'prefix)))