X-Git-Url: http://gitweb.hachti.de/?a=blobdiff_plain;f=programs%2Fpunchomat%2FMakefile;h=686e7d15c7e529108ae027737a9d48779d11c6e7;hb=920d9d917816047e4c0faa2eb66b72b2406bd601;hp=0301d131986121589ea7bebaae1d5044e288e363;hpb=38627116533d05d5e40e1ef762982f897f8affd2;p=h316.git diff --git a/programs/punchomat/Makefile b/programs/punchomat/Makefile index 0301d13..686e7d1 100644 --- a/programs/punchomat/Makefile +++ b/programs/punchomat/Makefile @@ -1,20 +1,27 @@ -# Makefile für Apfelmännchenprogramm +# Universal Makefile for X16 code -ASM=$(H316)/bin/asm -FRTN=$(H316)/bin/frtn +ASM_CMD=$(H316)/bin/asm +FRTN_CMD=$(H316)/bin/frtn +SRC_DIR=src +BUILD_DIR=build -build/punchomat.obj : src/punchomat.f - @if [ ! -d build ]; then mkdir build; fi - $(FRTN) src/punchomat.f && mv punchomat.obj build +PROGRAMS=$(foreach n, $(wildcard $(SRC_DIR)/*.f $(SRC_DIR)/*.asm),$(notdir $(basename $(n)))) -clean : - @rm -rf *.obj build/ *.lst *.go *.par +default: all + +all: $(foreach prog, $(PROGRAMS),$(BUILD_DIR)/$(prog).obj) -.PHONY: default clean +$(BUILD_DIR)/%.obj:$(SRC_DIR)/%.f + @if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi + @$(FRTN_CMD) "$(subst $$,\$$,$^)" &&\ + mv "$(notdir $(basename $(subst $$,\$$,$^))).obj" $(BUILD_DIR) +$(BUILD_DIR)/%.obj:$(SRC_DIR)/%.asm + @if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi + @$(ASM_CMD) "$(subst $$,\$$,$^)" &&\ + mv "$(notdir $(basename "\"$(subst $$,\$$,$^)\"")).obj" $(BUILD_DIR) -%.obj:%.f - $(FRTN) $^ +clean : + @rm -rf *.obj $(BUILD_DIR)/ *.lst *.go *.par -%.obj:%.asm - $(ASM) $^ \ No newline at end of file +.PHONY: default clean all