Subversion Repositories NedoOS

Rev

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

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