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