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 | ||
| - | 9 | NAME = scratch.com |
|
| - | 10 | OBJECTS = |
|
| 7 | .PHONY: install clean |
11 | SOURCES = scratch.asm |
| - | 12 | RESOURCES = |
|
| - | 13 | DOCS = scratch.txt scratch.new |
|
| - | 14 | INSTALLDIR ?= ../../release |
|
| - | 15 | BIN_INSTALLDIR = ${INSTALLDIR}/bin |
|
| - | 16 | RES_INSTALLDIR = ${INSTALLDIR}/bin |
|
| - | 17 | DOC_INSTALLDIR = ${INSTALLDIR}/doc |
|
| 8 | 18 | ||
| 9 | scratch.com: scratch.asm \ |
19 | # All targets |
| 10 | ../_sdk/sys_h.asm \ |
20 | TARGETS=executables resources |
| - | 21 | .PHONY: empty ${foreach t,${TARGETS},${t} install-${t} clean-${t}} all install install-doc clean |
|
| - | 22 | ||
| 11 | ../_sdk/sysdefs.asm \ |
23 | .DEFAULT_GOAL=all |
| - | 24 | ||
| 12 | 64qua.fnt \ |
25 | empty: |
| - | 26 | @echo 'Usage: make [ TARGET | ACTION-TARGET | all | install | install-doc | clean ]' |
|
| 13 | bitmap.asm \ |
27 | @echo 'where ACTION is one of: install clean' |
| 14 | control.asm \ |
28 | @echo ' TARGET is one of: ${TARGETS}' |
| - | 29 | ||
| 15 | files.asm \ |
30 | # Clear lists |
| 16 | math.asm \ |
31 | DEPS= |
| - | 32 | ||
| 17 | navigator.asm \ |
33 | # Create directories |
| 18 | pal.asm \ |
34 | ${sort \ |
| 19 | prarrow.asm \ |
35 | ${BIN_INSTALLDIR} \ |
| 20 | prbitmap.asm \ |
36 | ${RES_INSTALLDIR} \ |
| 21 | prshapes.asm \ |
37 | ${DOC_INSTALLDIR} \ |
| - | 38 | }: |
|
| 22 | prtext.asm \ |
39 | mkdir -p $@ |
| - | 40 | ||
| - | 41 | ########################## |
|
| 23 | sqrtmax2 \ |
42 | ## Target "executables" ## |
| - | 43 | ########################## |
|
| - | 44 | ||
| 24 | tarcsin \ |
45 | EXEC_DEPS= |
| 25 | tsin200 \ |
46 | EXEC_BINS= |
| - | 47 | ||
| - | 48 | ${eval ${call sjasmplus_odd_rule,${NAME},${SOURCES},,EXEC_DEPS,EXEC_BINS}} |
|
| - | 49 | ||
| 26 | window.asm \ |
50 | executables: ${EXEC_BINS} |
| - | 51 | ||
| - | 52 | install-executables: executables | ${BIN_INSTALLDIR} |
|
| 27 | windows.asm \ |
53 | cp ${EXEC_BINS} $| |
| - | 54 | ||
| 28 | windowsh.asm |
55 | clean-executables: |
| 29 | $(AS) $(AFLAGS) $< |
56 | ${RM} ${EXEC_DEPS} ${EXEC_BINS} |
| 30 | 57 | ||
| 31 | install: \ |
58 | DEPS+=${EXEC_DEPS} |
| - | 59 | ||
| - | 60 | ######################## |
|
| 32 | $(BIN_INSTALLDIR)scratch.com \ |
61 | ## Target "resources" ## |
| 33 | $(DOC_INSTALLDIR)scratch.new \ |
62 | ######################## |
| - | 63 | ||
| 34 | $(DOC_INSTALLDIR)scratch.txt |
64 | resources: ${RESOURCES} |
| 35 | 65 | ||
| 36 | $(BIN_INSTALLDIR)scratch.com: scratch.com |
66 | install-resources: resources | ${RES_INSTALLDIR} |
| - | 67 | ifneq "${sort ${RESOURCES}}" "" |
|
| 37 | $(CP) $< $@ |
68 | cp ${RESOURCES} $| |
| - | 69 | endif |
|
| - | 70 | ||
| - | 71 | clean-resources: |
|
| - | 72 | ||
| - | 73 | #################### |
|
| - | 74 | ## Common targets ## |
|
| - | 75 | #################### |
|
| - | 76 | ||
| - | 77 | all: executables resources |
|
| 38 | 78 | ||
| 39 | $(DOC_INSTALLDIR)scratch.new: scratch.new |
79 | install: install-executables install-resources |
| - | 80 | ||
| - | 81 | ifeq "${sort ${DOCS}}" "" |
|
| - | 82 | install-doc: |
|
| - | 83 | else |
|
| - | 84 | install-doc: ${DOCS} | ${DOC_INSTALLDIR} |
|
| 40 | $(CP) $< $@ |
85 | cp $^ $| |
| - | 86 | endif |
|
| 41 | 87 | ||
| 42 | $(DOC_INSTALLDIR)scratch.txt: scratch.txt |
88 | clean: clean-executables clean-resources |
| - | 89 | ||
| - | 90 | ################## |
|
| 43 | $(CP) $< $@ |
91 | ## Dependencies ## |
| - | 92 | ################## |
|
| 44 | 93 | ||
| - | 94 | ifneq "${sort \ |
|
| - | 95 | ${filter empty,${MAKECMDGOALS}} \ |
|
| - | 96 | ${filter clean,${MAKECMDGOALS}} \ |
|
| - | 97 | ${filter clean-%,${MAKECMDGOALS}} \ |
|
| - | 98 | }" "" |
|
| 45 | clean: |
99 | else |
| - | 100 | # FIXME: Triggered when multiple targets specified. |
|
| 46 | $(RM) scratch.com |
101 | include ${DEPS} |
| - | 102 | endif |
|