* clean didnt work for me, TARGET with "ALL" did not list files for `rm` - fixes #1 for me
* added error reporting in case interpreter or script is missing
* enabled adding new scripts for other interpreters later, e.g. python implementation of generator; so users do not need to install ruby
This commit is contained in:
Wolf 2016-10-26 16:01:28 +02:00 committed by GitHub
parent 169e8795f8
commit 12836aa730
1 changed files with 8 additions and 5 deletions

View File

@ -1,15 +1,18 @@
TARGETS=$(patsubst dates/%.yaml, dates/%/ALL, $(wildcard dates/*.yaml))
ALL: ${TARGETS}
GENERATOR='./generate.rb'
MAKE_TARGETS=$(patsubst dates/%.yaml, dates/%/ALL, $(wildcard dates/*.yaml))
CLEAN_TARGETS=$(patsubst dates/%.yaml, dates/%/*, $(wildcard dates/*.yaml))
ALL: ${MAKE_TARGETS}
clean:
rm -rf ${TARGETS}
rm -rf ${CLEAN_TARGETS}
# Keep Makefiles
.SECONDARY: $(patsubst dates/%/ALL, dates/%/Makefile, $(TARGETS))
.SECONDARY: $(patsubst dates/%/ALL, dates/%/Makefile, $(MAKE_TARGETS))
dates/%/Makefile: dates/%.yaml $(wildcard decks/*.yaml)
mkdir -p $(shell dirname $@)
./generate.rb $< $(shell dirname $@)
$(GENERATOR) $< $(shell dirname $@) || printf "\033[1;31minterpreter or script missing\033[0m\n"
dates/%/ALL: dates/%/Makefile
$(MAKE) -C $(shell dirname $@)