Rev 922 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log
| Rev 922 | Rev 930 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | # Supported environments: |
1 | # Supported environments: |
| 2 | # GNU/Linux |
2 | # GNU/Linux. |
| - | 3 | # |
|
| 3 | # Windows NT |
4 | # Tools used: |
| - | 5 | # GNU core utilities, tools/aspp, tools/sjasmplus. |
|
| 4 | 6 | ||
| 5 | include ../../_sdk/common.mk |
7 | include ../../_sdk/common.mk |
| 6 | 8 | ||
| 7 | # no trailing "/" |
9 | NAME = tetris.com |
| - | 10 | OBJECTS = |
|
| - | 11 | SOURCES = main.asm |
|
| - | 12 | RESOURCES = |
|
| - | 13 | DOCS = |
|
| - | 14 | INSTALLDIR ?= ../../../release/nedogame |
|
| - | 15 | BIN_INSTALLDIR = ${INSTALLDIR} |
|
| - | 16 | RES_INSTALLDIR = ${INSTALLDIR} |
|
| 8 | INSTALLDIR := $(INSTALLDIR)nedogame |
17 | DOC_INSTALLDIR = ${INSTALLDIR}/doc |
| - | 18 | DEPS = ${patsubst %.asm,%.${DEPEXT},${filter %.asm,${SOURCES}}} |
|
| - | 19 | TMPS = |
|
| - | 20 | ||
| - | 21 | # All targets |
|
| - | 22 | TARGETS=executables resources |
|
| - | 23 | .PHONY: empty ${foreach t,${TARGETS},${t} install-${t} clean-${t}} all install install-doc clean |
|
| - | 24 | ||
| - | 25 | .DEFAULT_GOAL=all |
|
| 9 | 26 | ||
| - | 27 | empty: |
|
| - | 28 | @echo 'Usage: make [ TARGET | ACTION-TARGET | all | install | install-doc | clean ]' |
|
| 10 | .PHONY: install clean |
29 | @echo 'where ACTION is one of: install clean' |
| - | 30 | @echo ' TARGET is one of: ${TARGETS}' |
|
| - | 31 | ||
| - | 32 | # Clear lists |
|
| - | 33 | DEPS= |
|
| 11 | 34 | ||
| - | 35 | # Create directories |
|
| - | 36 | ${sort \ |
|
| - | 37 | ${BIN_INSTALLDIR} \ |
|
| 12 | tetris.com: main.asm \ |
38 | ${RES_INSTALLDIR} \ |
| 13 | ../../_sdk/sys_h.asm \ |
39 | ${DOC_INSTALLDIR} \ |
| - | 40 | }: |
|
| - | 41 | mkdir -p $@ |
|
| - | 42 | ||
| - | 43 | ########################## |
|
| 14 | ../../_sdk/sysdefs.asm \ |
44 | ## Target "executables" ## |
| - | 45 | ########################## |
|
| - | 46 | ||
| - | 47 | EXEC_DEPS= |
|
| 15 | zx.fnt |
48 | EXEC_BINS= |
| - | 49 | ||
| - | 50 | ${eval ${call sjasmplus_odd_rule,${NAME},${SOURCES},,EXEC_DEPS,EXEC_BINS}} |
|
| - | 51 | ||
| - | 52 | executables: ${EXEC_BINS} |
|
| - | 53 | ||
| - | 54 | install-executables: executables | ${BIN_INSTALLDIR} |
|
| 16 | $(AS) $(AFLAGS) $< |
55 | cp ${EXEC_BINS} $| |
| 17 | 56 | ||
| 18 | install: \ |
57 | clean-executables: |
| - | 58 | ${RM} ${EXEC_DEPS} ${EXEC_BINS} |
|
| - | 59 | ||
| - | 60 | DEPS+=${EXEC_DEPS} |
|
| - | 61 | ||
| - | 62 | ######################## |
|
| - | 63 | ## Target "resources" ## |
|
| - | 64 | ######################## |
|
| - | 65 | ||
| - | 66 | resources: ${RESOURCES} |
|
| - | 67 | ||
| - | 68 | install-resources: resources | ${RES_INSTALLDIR} |
|
| - | 69 | ifneq "${sort ${RESOURCES}}" "" |
|
| 19 | $(INSTALLDIR) \ |
70 | cp ${RESOURCES} $| |
| - | 71 | endif |
|
| - | 72 | ||
| - | 73 | clean-resources: |
|
| - | 74 | ||
| - | 75 | #################### |
|
| - | 76 | ## Common targets ## |
|
| - | 77 | #################### |
|
| - | 78 | ||
| 20 | $(INSTALLDIR)/tetris.com |
79 | all: executables resources |
| 21 | 80 | ||
| - | 81 | install: install-executables install-resources |
|
| - | 82 | ||
| - | 83 | ifeq "${sort ${DOCS}}" "" |
|
| 22 | $(INSTALLDIR): |
84 | install-doc: |
| - | 85 | else |
|
| - | 86 | install-doc: ${DOCS} | ${DOC_INSTALLDIR} |
|
| 23 | $(MKDIR) $@ |
87 | cp $^ $| |
| - | 88 | endif |
|
| 24 | 89 | ||
| 25 | $(INSTALLDIR)/tetris.com: tetris.com |
90 | clean: clean-executables clean-resources |
| - | 91 | ||
| - | 92 | ################## |
|
| 26 | $(CP) $< $@ |
93 | ## Dependencies ## |
| - | 94 | ################## |
|
| 27 | 95 | ||
| - | 96 | ifneq "${sort \ |
|
| - | 97 | ${filter empty,${MAKECMDGOALS}} \ |
|
| - | 98 | ${filter clean,${MAKECMDGOALS}} \ |
|
| - | 99 | ${filter clean-%,${MAKECMDGOALS}} \ |
|
| - | 100 | }" "" |
|
| 28 | clean: |
101 | else |
| - | 102 | # FIXME: Triggered when multiple targets specified. |
|
| 29 | $(RM) tetris.com |
103 | include ${DEPS} |
| - | 104 | endif |
|