Subversion Repositories NedoOS

Rev

Rev 930 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 930 Rev 1548
Line -... Line 1...
-
 
1
# Supported environments:
-
 
2
#   GNU/Linux.
-
 
3
#
-
 
4
# Tools used:
-
 
5
#   GNU core utilities, tools/aspp, tools/sjasmplus.
-
 
6
 
-
 
7
include ../_sdk/common.mk
-
 
8
 
1
NAME		= player.com
9
NAME		= player.com
2
OBJECTS		=
10
OBJECTS		=
3
SOURCES		= player.asm
11
SOURCES		= player.asm
4
RESOURCES	=
12
RESOURCES	=
5
DOCS		=
13
DOCS		=
-
 
14
INSTALLDIR	?= ../../release
6
BIN_INSTALLDIR	:= ${INSTALLDIR}/bin
15
BIN_INSTALLDIR	= ${INSTALLDIR}/bin
7
RES_INSTALLDIR	:= ${INSTALLDIR}/bin
16
RES_INSTALLDIR	= ${INSTALLDIR}/bin
8
DOC_INSTALLDIR	:= ${INSTALLDIR}/doc
17
DOC_INSTALLDIR	= ${INSTALLDIR}/doc
-
 
18
DEPEXT		= d
9
 
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 ]'
-
 
28
	@echo 'where ACTION is one of: install clean'
-
 
29
	@echo '      TARGET is one of: ${TARGETS}'
-
 
30
 
-
 
31
# Clear lists
-
 
32
DEPS=
-
 
33
 
-
 
34
# Create directories
-
 
35
${sort \
-
 
36
${BIN_INSTALLDIR} \
-
 
37
${RES_INSTALLDIR} \
-
 
38
${DOC_INSTALLDIR} \
-
 
39
}:
-
 
40
	mkdir -p $@
-
 
41
 
-
 
42
##########################
-
 
43
## Target "executables" ##
-
 
44
##########################
-
 
45
 
-
 
46
EXEC_DEPS=
-
 
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
 
-
 
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}}" ""
-
 
69
	cp ${RESOURCES} $|
-
 
70
endif
-
 
71
 
-
 
72
clean-resources:
-
 
73
 
-
 
74
####################
-
 
75
## Common targets ##
-
 
76
####################
-
 
77
 
-
 
78
all: executables resources
-
 
79
 
-
 
80
install: install-executables install-resources
-
 
81
 
-
 
82
ifeq "${sort ${DOCS}}" ""
-
 
83
install-doc:
-
 
84
else
-
 
85
install-doc: ${DOCS} | ${DOC_INSTALLDIR}
-
 
86
	cp $^ $|
-
 
87
endif
-
 
88
 
-
 
89
clean: clean-executables clean-resources
-
 
90
 
-
 
91
##################
-
 
92
## Dependencies ##
-
 
93
##################
-
 
94
 
-
 
95
ifneq "${sort \
-
 
96
${filter empty,${MAKECMDGOALS}} \
-
 
97
${filter clean,${MAKECMDGOALS}} \
-
 
98
${filter clean-%,${MAKECMDGOALS}} \
-
 
99
}" ""
-
 
100
else
-
 
101
# FIXME: Triggered when multiple targets specified.
10
include ../_sdk/common.mk
102
include ${DEPS}
-
 
103
endif