Subversion Repositories NedoOS

Rev

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		= zxrar.com
-
 
10
OBJECTS		=
-
 
11
SOURCES		= zxrar.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
 
9
zxrar.com: zxrar.asm \
35
# Create directories
-
 
36
${sort \
10
 ../_sdk/file.asm \
37
${BIN_INSTALLDIR} \
11
 ../_sdk/stdio.asm \
38
${RES_INSTALLDIR} \
12
 ../_sdk/sys_h.asm \
39
${DOC_INSTALLDIR} \
-
 
40
}:
-
 
41
	mkdir -p $@
-
 
42
 
-
 
43
##########################
13
 ../_sdk/sysdefs.asm \
44
## Target "executables" ##
-
 
45
##########################
-
 
46
 
14
 rarhuff.asm \
47
EXEC_DEPS=
15
 rarlz.asm \
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
 rarpack.asm \
55
	cp ${EXEC_BINS} $|
-
 
56
 
17
 zxrfile.asm
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}}" ""
18
	$(AS) $(AFLAGS) $<
70
	cp ${RESOURCES} $|
-
 
71
endif
-
 
72
 
-
 
73
clean-resources:
-
 
74
 
-
 
75
####################
-
 
76
## Common targets ##
-
 
77
####################
-
 
78
 
-
 
79
all: executables resources
19
 
80
 
20
install: $(BIN_INSTALLDIR)zxrar.com
81
install: install-executables install-resources
21
 
82
 
-
 
83
ifeq "${sort ${DOCS}}" ""
-
 
84
install-doc:
-
 
85
else
22
$(BIN_INSTALLDIR)zxrar.com: zxrar.com
86
install-doc: ${DOCS} | ${DOC_INSTALLDIR}
23
	$(CP) $< $@
87
	cp $^ $|
-
 
88
endif
-
 
89
 
-
 
90
clean: clean-executables clean-resources
-
 
91
 
-
 
92
##################
-
 
93
## Dependencies ##
-
 
94
##################
24
 
95
 
-
 
96
ifneq "${sort \
-
 
97
${filter empty,${MAKECMDGOALS}} \
-
 
98
${filter clean,${MAKECMDGOALS}} \
-
 
99
${filter clean-%,${MAKECMDGOALS}} \
-
 
100
}" ""
25
clean:
101
else
-
 
102
# FIXME: Triggered when multiple targets specified.
26
	$(RM) zxrar.com
103
include ${DEPS}
-
 
104
endif