Subversion Repositories NedoOS

Rev

Rev 930 | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
930 alone 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
 
1548 salex 9
NAME1		= nv.com
10
NAME2		= nvfast.com
930 alone 11
OBJECTS		=
12
SOURCES		= nv.asm
13
RESOURCES	= nv.ext
14
DOCS		=
15
INSTALLDIR	?= ../../release
16
BIN_INSTALLDIR	= ${INSTALLDIR}/bin
17
RES_INSTALLDIR	= ${INSTALLDIR}/bin
18
DOC_INSTALLDIR	= ${INSTALLDIR}/doc
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
 
1548 salex 49
${eval ${call sjasmplus_odd_rule,${NAME1},${SOURCES},"-DPRSTDIO=1",EXEC_DEPS,EXEC_BINS}}
930 alone 50
 
1548 salex 51
${eval ${call sjasmplus_odd_rule,${NAME2},${SOURCES},"-DPRSTDIO=0",EXEC_DEPS,EXEC_BINS}}
52
 
930 alone 53
executables: ${EXEC_BINS}
54
 
55
install-executables: executables | ${BIN_INSTALLDIR}
56
	cp ${EXEC_BINS} $|
57
 
58
clean-executables:
59
	${RM} ${EXEC_DEPS} ${EXEC_BINS}
60
 
61
DEPS+=${EXEC_DEPS}
62
 
63
########################
64
## Target "resources" ##
65
########################
66
 
67
resources: ${RESOURCES}
68
 
69
install-resources: resources | ${RES_INSTALLDIR}
70
ifneq "${sort ${RESOURCES}}" ""
71
	cp ${RESOURCES} $|
72
endif
73
 
74
clean-resources:
75
 
76
####################
77
## Common targets ##
78
####################
79
 
80
all: executables resources
81
 
82
install: install-executables install-resources
83
 
84
ifeq "${sort ${DOCS}}" ""
85
install-doc:
86
else
87
install-doc: ${DOCS} | ${DOC_INSTALLDIR}
88
	cp $^ $|
89
endif
90
 
91
clean: clean-executables clean-resources
92
 
93
##################
94
## Dependencies ##
95
##################
96
 
97
ifneq "${sort \
98
${filter empty,${MAKECMDGOALS}} \
99
${filter clean,${MAKECMDGOALS}} \
100
${filter clean-%,${MAKECMDGOALS}} \
101
}" ""
102
else
103
# FIXME: Triggered when multiple targets specified.
104
include ${DEPS}
105
endif