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 = tar.com |
|
- | 10 | OBJECTS = |
|
- | 11 | SOURCES = tar.asm |
|
- | 12 | RESOURCES = |
|
- | 13 | DOCS = |
|
- | 14 | INSTALLDIR ?= ../../release |
|
- | 15 | BIN_INSTALLDIR = ${INSTALLDIR}/bin |
|
- | 16 | RES_INSTALLDIR = ${INSTALLDIR}/bin |
|
- | 17 | DOC_INSTALLDIR = ${INSTALLDIR}/doc |
|
- | 18 | DEPAFLAGS = -E -MM -I . |
|
- | 19 | DEPEXT = d |
|
- | 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 |
|
- | 26 | ||
- | 27 | empty: |
|
- | 28 | @echo 'Usage: make [ TARGET | ACTION-TARGET | all | install | install-doc | clean ]' |
|
7 | .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= |
|
8 | 34 | ||
- | 35 | # Create directories |
|
- | 36 | ${sort \ |
|
9 | tar.com: tar.asm \ |
37 | ${BIN_INSTALLDIR} \ |
10 | ../_sdk/file.asm \ |
38 | ${RES_INSTALLDIR} \ |
11 | ../_sdk/sys_h.asm \ |
39 | ${DOC_INSTALLDIR} \ |
- | 40 | }: |
|
- | 41 | mkdir -p $@ |
|
- | 42 | ||
- | 43 | ########################## |
|
12 | ../_sdk/sysdefs.asm |
44 | ## Target "executables" ## |
- | 45 | ########################## |
|
- | 46 | ||
- | 47 | EXEC_DEPS= |
|
- | 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} |
|
13 | $(AS) $(AFLAGS) $< |
55 | cp ${EXEC_BINS} $| |
- | 56 | ||
- | 57 | clean-executables: |
|
- | 58 | ${RM} ${EXEC_DEPS} ${EXEC_BINS} |
|
- | 59 | ||
- | 60 | DEPS+=${EXEC_DEPS} |
|
- | 61 | ||
- | 62 | ######################## |
|
- | 63 | ## Target "resources" ## |
|
- | 64 | ######################## |
|
- | 65 | ||
- | 66 | resources: ${RESOURCES} |
|
14 | 67 | ||
15 | install: $(BIN_INSTALLDIR)tar.com |
68 | install-resources: resources | ${RES_INSTALLDIR} |
- | 69 | ifneq "${sort ${RESOURCES}}" "" |
|
- | 70 | cp ${RESOURCES} $| |
|
- | 71 | endif |
|
- | 72 | ||
- | 73 | clean-resources: |
|
- | 74 | ||
- | 75 | #################### |
|
- | 76 | ## Common targets ## |
|
- | 77 | #################### |
|
16 | 78 | ||
17 | $(BIN_INSTALLDIR)tar.com: tar.com |
79 | all: executables resources |
- | 80 | ||
- | 81 | install: install-executables install-resources |
|
- | 82 | ||
- | 83 | ifeq "${sort ${DOCS}}" "" |
|
- | 84 | install-doc: |
|
- | 85 | else |
|
- | 86 | install-doc: ${DOCS} | ${DOC_INSTALLDIR} |
|
18 | $(CP) $< $@ |
87 | cp $^ $| |
- | 88 | endif |
|
19 | 89 | ||
- | 90 | clean: clean-executables clean-resources |
|
- | 91 | ||
- | 92 | ################## |
|
- | 93 | ## Dependencies ## |
|
- | 94 | ################## |
|
- | 95 | ||
- | 96 | ifneq "${sort \ |
|
- | 97 | ${filter empty,${MAKECMDGOALS}} \ |
|
- | 98 | ${filter clean,${MAKECMDGOALS}} \ |
|
- | 99 | ${filter clean-%,${MAKECMDGOALS}} \ |
|
- | 100 | }" "" |
|
20 | clean: |
101 | else |
- | 102 | # FIXME: Triggered when multiple targets specified. |
|
21 | $(RM) tar.com |
103 | include ${DEPS} |
- | 104 | endif |