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
# Used tools:
-
 
5
#   GNU core utilities, tools/aspp, tools/sjasmplus, tools/mhmt.
4
 
6
 
5
include ../_sdk/common.mk
7
include ../_sdk/common.mk
6
 
8
 
-
 
9
NAME		= code.c
-
 
10
OBJECTS		=
-
 
11
SOURCES		= main.asm
7
.PHONY: install clean
12
MHMT		= ../../tools/mhmt
-
 
13
DEPS		= ${patsubst %.asm,%.${DEPEXT},${filter %.asm,${SOURCES}}}
8
 
14
 
9
nedoos.$$C: hobeta.asm \
15
# All targets
-
 
16
.PHONY: empty hobeta clean-hobeta all install install-doc clean
10
 code.c
17
 
11
	$(AS) $(AFLAGS) $<
18
.DEFAULT_GOAL=all
12
 
19
 
13
ffsfunc.ast: ../fatfs4os/fatfs.exp
20
empty:
14
	$(SED) -Ee 's/^(.+)[[:space:]]+(.+)/.\1 EQU 0x\2/' $< > $@
21
	@echo 'Usage: make [ hobeta | clean-hobeta | all | install | install-doc | clean ]'
15
 
22
 
16
initcode.c \
23
# Clear lists
17
syscode.c: main.asm \
24
DEPS=
18
 ../_sdk/codepage/866toatm \
-
 
19
 ../_sdk/sys_h.asm \
25
BINS=
20
 ../_sdk/sysdefs.asm \
-
 
-
 
26
 
21
 ../_sdk/syssets.asm \
27
# External dependencies
22
 ../fatfs4os/fatfs.raw \
28
../fatfs4os/fatfs.raw ffsfunc.asm:
23
 bdospg2.asm \
29
	${MAKE} -w -C ../fatfs4os
-
 
30
 
24
 fatfs_h.asm \
31
############
25
 fatfsdrv.asm \
32
## hobeta ##
26
 ffsfunc.asm \
33
############
-
 
34
 
27
 ffsfunc.ast \
35
HOBETA_BINS=
-
 
36
 
28
 idle.asm \
37
# Dependency generation rule for .asm file:
29
 ngssddrv.asm \
38
hobeta.${DEPEXT}: hobeta.asm
-
 
39
	${RM} $@ && ${DEPAS} ${DEPAFLAGS} -MT nedoos.\$$C -MT $@ -MF $@ $<
30
 portsngs.asm \
40
DEPS+=hobeta.${DEPEXT}
-
 
41
# FIXME: No output file specified here (we must check sources manually):
31
 ps2drv.asm \
42
nedoos.$$C: hobeta.asm
32
 sl811.asm \
43
	${SJASMPLUS} ${SJASMPLUSFLAGS} $<
33
 sysbdos.asm \
44
HOBETA_BINS+=nedoos.\$$C
-
 
45
 
34
 syskey1.asm \
46
hobeta: nedoos.$$C
-
 
47
 
35
 syskey2.asm \
48
clean-hobeta:
36
 syskrnl.asm \
49
	${RM} ${HOBETA_BINS}
-
 
50
 
37
 trdosfs.asm \
51
BINS+=${HOBETA_BINS}
-
 
52
 
38
 trdosio.asm \
53
####################
39
 unmegalz.asm \
54
## Common targets ##
40
 userkrnl.asm \
55
####################
41
 w5300.asm
56
 
42
	$(AS) $(ASFLAGS) $<
57
${eval ${call sjasmplus_odd_rule,initcode.c syscode.c user.l,${SOURCES},,DEPS,BINS}}
43
 
58
 
44
syscode.c.mlz: syscode.c
59
syscode.c.mlz: syscode.c
45
	$(MHMT) -mlz $< > $(NUL)
60
	${MHMT} -mlz $<
-
 
61
BINS+=syscode.c.mlz
46
 
62
 
47
# order matters!
63
# The order of files does matter!
48
code.c: initcode.c syscode.c.mlz
64
${NAME}: initcode.c syscode.c.mlz
49
	$(CAT) $^ > $@
65
	cat $^ > $@
-
 
66
BINS+=${NAME}
50
 
67
 
-
 
68
all: ${NAME}
-
 
69
 
51
install: nedoos.$$C
70
install: all
-
 
71
 
-
 
72
install-doc:
52
 
73
 
53
clean:
74
clean:
54
	$(RM) \
75
	${RM} ${DEPS} ${BINS}
-
 
76
 
55
 code.c \
77
##################
56
 ffsfunc.ast \
78
## Dependencies ##
57
 initcode.c \
79
##################
-
 
80
 
58
 nedoos.\$$C \
81
ifneq "${sort \
-
 
82
${filter empty,${MAKECMDGOALS}} \
-
 
83
${filter clean,${MAKECMDGOALS}} \
-
 
84
}" ""
59
 syscode.c \
85
else
-
 
86
# FIXME: Triggered when multiple targets specified.
60
 syscode.c.mlz
87
include ${DEPS}
-
 
88
endif