projects
/
h316.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[h316.git]
/
programs
/
punchomat
/
Makefile
diff --git
a/programs/punchomat/Makefile
b/programs/punchomat/Makefile
index 0301d131986121589ea7bebaae1d5044e288e363..686e7d15c7e529108ae027737a9d48779d11c6e7 100644
(file)
--- 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