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
# no trailing "/"
9
NAME		= wolf3d.com
-
 
10
OBJECTS		=
-
 
11
SOURCES		= main.asm
-
 
12
SPRITES		= wolfspr.bmp wolftex.bmp
-
 
13
RESOURCES	=
-
 
14
DOCS		=
-
 
15
LOCALDIR	= wolf3d
-
 
16
INSTALLDIR	?= ../../../release/nedogame
-
 
17
BIN_INSTALLDIR	= ${INSTALLDIR}
-
 
18
RES_INSTALLDIR	= ${INSTALLDIR}/wolf3d
8
INSTALLDIR	:= $(INSTALLDIR)nedogame
19
DOC_INSTALLDIR	= ${INSTALLDIR}/doc
9
 
20
 
10
.PHONY: install clean
21
# All targets
-
 
22
TARGETS=executables resources
-
 
23
.PHONY: empty ${foreach t,${TARGETS},${t} install-${t} clean-${t}} all install install-doc clean
11
 
24
 
12
wolf3d.com: main.asm \
-
 
13
 ../../_sdk/sys_h.asm \
25
.DEFAULT_GOAL=all
14
 ../../_sdk/sysdefs.asm \
-
 
15
 DOOM-MUS \
26
 
16
 WATM2.asm \
27
empty:
17
 WCTRL.asm \
28
	@echo 'Usage: make [ TARGET | ACTION-TARGET | all | install | install-doc | clean ]'
18
 WREND.asm \
29
	@echo 'where ACTION is one of: install clean'
19
 WSCAN10.asm \
30
	@echo '      TARGET is one of: ${TARGETS}'
-
 
31
 
20
 corlogd_ \
32
# Clear lists
21
 cos \
33
DEPS=
22
 da \
34
 
23
 demorec9 \
35
# Create directories
24
 genscale.asm \
-
 
25
 logd \
36
${sort \
26
 logd2sc3 \
37
${BIN_INSTALLDIR} \
27
 map48.E \
38
${RES_INSTALLDIR} \
28
 mapatm.E \
39
${DOC_INSTALLDIR} \
29
 plusctg \
40
}:
30
 pluslcos \
41
	mkdir -p $@
31
 scalesw3 \
-
 
32
 sin \
42
 
33
 sqr2int \
43
##########################
34
 tscale3
44
## Target "executables" ##
35
	$(AS) $(AFLAGS) $<
45
##########################
36
 
46
 
37
wolf3d:
47
EXEC_DEPS=
38
	$(MKDIR) $@
48
EXEC_BINS=
39
 
49
 
40
mapatm.E: WOLF484.TRD
50
${eval ${call sjasmplus_odd_rule,${NAME},${SOURCES},,EXEC_DEPS,EXEC_BINS}}
-
 
51
 
41
	$(NEDOTRD) $< -e $@
52
executables: ${EXEC_BINS}
42
 
53
 
43
wolf3d/sfx.bin: sfx.asm \
54
install-executables: executables | ${BIN_INSTALLDIR}
44
 ayfxplay.asm \
55
	cp ${EXEC_BINS} $|
45
 sfx.afb \
56
 
46
 | wolf3d
57
clean-executables:
47
	$(AS) $(AFLAGS) $<
58
	${RM} ${EXEC_DEPS} ${EXEC_BINS}
48
 
59
 
49
wolf3d/music.bin: music.asm \
60
DEPS+=${EXEC_DEPS}
-
 
61
 
50
 ptsplay.asm \
62
########################
51
 testmusi.pt3 \
63
## Target "resources" ##
52
 | wolf3d
-
 
53
	$(AS) $(AFLAGS) $<
64
########################
54
 
65
 
55
install: \
66
RES_BINS=
-
 
67
 
56
 $(INSTALLDIR) \
68
${foreach f,${SPRITES},\
57
 $(INSTALLDIR)/wolf3d.com \
69
${eval ${call copy_to_dir_rule,${LOCALDIR},${f},RES_BINS}}}
-
 
70
 
58
 $(INSTALLDIR)/wolf3d \
71
resources: ${RES_BINS} | ${LOCALDIR}
-
 
72
 
59
 $(INSTALLDIR)/wolf3d/music.bin \
73
install-resources: resources | ${RES_INSTALLDIR}
60
 $(INSTALLDIR)/wolf3d/sfx.bin \
74
	cp ${RES_BINS} $|
-
 
75
 
61
 $(INSTALLDIR)/wolf3d/wolftex.bmp \
76
clean-resources:
62
 $(INSTALLDIR)/wolf3d/wolfspr.bmp
77
	${RM} ${RES_BINS}
63
 
78
 
64
$(INSTALLDIR) \
79
####################
65
 $(INSTALLDIR)/wolf3d:
80
## Common targets ##
66
	$(MKDIR) $@
81
####################
67
 
82
 
68
$(INSTALLDIR)/wolf3d.com: wolf3d.com
83
all: executables resources
69
	$(CP) $< $@
-
 
70
 
84
 
71
$(INSTALLDIR)/wolf3d/music.bin: wolf3d/music.bin
85
install: install-executables install-resources
72
	$(CP) $< $@
-
 
73
 
86
 
-
 
87
ifeq "${sort ${DOCS}}" ""
-
 
88
install-doc:
-
 
89
else
74
$(INSTALLDIR)/wolf3d/sfx.bin: wolf3d/sfx.bin
90
install-doc: ${DOCS} | ${DOC_INSTALLDIR}
75
	$(CP) $< $@
91
	cp $^ $|
-
 
92
endif
76
 
93
 
77
$(INSTALLDIR)/wolf3d/wolftex.bmp: wolftex.bmp
94
clean: clean-executables clean-resources
78
	$(CP) $< $@
-
 
79
 
95
 
-
 
96
##################
80
$(INSTALLDIR)/wolf3d/wolfspr.bmp: wolfspr.bmp
97
## Dependencies ##
81
	$(CP) $< $@
98
##################
82
 
99
 
83
clean:
100
ifneq "${sort \
-
 
101
${filter empty,${MAKECMDGOALS}} \
-
 
102
${filter clean,${MAKECMDGOALS}} \
-
 
103
${filter clean-%,${MAKECMDGOALS}} \
84
	$(RM) \
104
}" ""
85
 mapatm.E \
105
else
86
 wolf3d.com \
106
# FIXME: Triggered when multiple targets specified.
87
 wolf3d/music.bin \
107
include ${DEPS}
88
 wolf3d/sfx.bin
108
endif