build: Add target list.

* GNUmakefile (%): Handle all targets.
* make.scm (main): Show and implement target list.
This commit is contained in:
Jan Nieuwenhuizen 2017-07-19 19:53:21 +02:00
parent 89a9decfff
commit a7b7297ee2
2 changed files with 6 additions and 1 deletions

View file

@ -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

View file

@ -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)))