1
0

Fix Makefile. Use Python 3 for scripts.

This commit is contained in:
2017-11-16 00:19:08 +00:00
parent 8c64fb6b3b
commit 32e50d8334
3 changed files with 34 additions and 27 deletions
+17 -10
View File
@@ -1,22 +1,29 @@
ALL_FOLDERS := ${shell find ./src/ -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0}
#ALL_FOLDERS := $(dir $(wildcard ./src/*/.))
#ALL_TARGETS = $(ALL_FOLDERS:./src/%=build/%.mkp)
SRC_DIR := src/
ALL_FOLDERS := $(shell find $(SRC_DIR) -mindepth 1 -maxdepth 1 -type d -print0 | xargs -0)
ALL_MODULES := $(sort $(subst $(SRC_DIR),,$(ALL_FOLDERS)))
ALL_TARGETS := ${shell bin/findtargets.py build/ $(ALL_FOLDERS)}
all: $(ALL_TARGETS)
$(ALL_TARGETS): $(ALL_FOLDERS)
@echo "Building $@ from $<"
bin/makemkp.py $< ./build/
# cleanup
.PHONY: clean show_targets
clean:
-rm ./build/*.mkp
# debug
show_targets:
@echo $(ALL_FOLDERS)
@echo $(ALL_TARGETS)
@echo $(ALL_MODULES)
# setup
define make-goal
${shell bin/findtargets.py build/ $(SRC_DIR)$1}: $(SRC_DIR)$1
echo "Building $$@"
bin/makemkp.py $$< ./build/
endef
$(foreach mod,$(ALL_MODULES),$(eval $(call make-goal,$(mod))))