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