Subversion Repositories NedoOS

Rev

Rev 926 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 926 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, GNU sed, tools/aspp, tools/sjasmplus.
4
 
6
 
5
include ../_sdk/common.mk
7
include ../_sdk/common.mk
6
include ../_sdk/iar.mk
-
 
7
 
8
 
-
 
9
NAME		= fatfs.raw
-
 
10
#SOURCES		= ff_sj.asm
8
C_OPTIONS	= -S -v0 -ml -uua -q -e -K -gA -z9 -t4 -T -Llist/ -Olist/ -Alist/ -I$(IARINC)
11
EXPORTS_FILE	= ../kernel/ffsfunc.asm
9
 
12
 
-
 
13
# All targets
10
.PHONY: all install clean
14
.PHONY: empty all install install-doc clean
11
 
15
 
12
all: \
-
 
13
 fatfs.exp \
16
.DEFAULT_GOAL=all
14
 fatfs.raw
-
 
15
 
17
 
16
ifeq ($(OS),Windows_NT)
-
 
17
list:
18
empty:
18
	$(MKDIR) $@
19
	@echo 'Usage: make [ all | install | install-doc | clean ]'
19
 
20
 
20
list/ff.lst \
21
# Clear lists
21
list/ff.r01 \
-
 
22
list/ff.s01: ff.c \
-
 
23
 diskio.h \
-
 
24
 ff.h \
22
DEPS=
25
 ffconf.h \
-
 
26
 integer.h \
-
 
27
 | list
23
OBJECTS=
28
	$(ICCZ80) $(C_OPTIONS) $<
-
 
29
 
24
 
30
list/ccsbcs.lst \
25
####################
31
list/ccsbcs.r01 \
26
## Common targets ##
32
list/ccsbcs.s01: ccsbcs.c \
27
####################
33
 ff.h \
28
 
34
 ffconf.h \
29
fatfs_EXP=ff_sj.exp
35
 integer.h \
-
 
36
 | list
-
 
37
	$(ICCZ80) $(C_OPTIONS) $<
-
 
38
 
30
 
39
list/mylib.r01: mylib.asm | list
31
#{eval ${call sjasmplus_odd_rule,${NAME} ${fatfs_EXP},${SOURCES},--exp=${fatfs_EXP},DEPS,}}
40
	$(AZ80) -S -O$|/ -uu $<
-
 
41
 
32
 
42
fatfs.raw \
33
${EXPORTS_FILE}: ${fatfs_EXP}
43
list/cout.l: link.lnk \
34
	echo '; ${@F} - FatFS calls.' > $@
44
 list/ccsbcs.r01 \
35
	echo '; This file is a part of NedoOS project.' >> $@
45
 list/ff.r01 \
36
	echo '; Compatible compiler: sjasmplus.' >> $@
46
 list/mylib.r01 \
37
	echo '; This file was generated automatically while building FatFS.' >> $@
47
 | list
38
	echo 'ffsfunc' >> $@
48
	$(XLINK) ff ccsbcs mylib -f $<
39
	sed -re 's/^.+/.&/' $< >> $@
49
 
40
 
50
fatfs.exp: list/cout.l
41
#all: ${NAME} ${EXPORTS_FILE}
51
	$(GREP) -Ee '^[[:space:]]+f_[[:alnum:]]+[[:space:]]+[[:xdigit:]]+' $< > fatfs.tmp
-
 
52
	$(SED) -Ee 's/^[[:space:]]+(f_[[:alnum:]]+)[[:space:]]+([[:xdigit:]]+).*/\1 \2/' fatfs.tmp > $@
-
 
53
	$(RM) fatfs.tmp
-
 
54
else
-
 
55
fatfs.raw \
42
all: ${NAME}
56
fatfs.exp:
-
 
57
	$(error Target "$@" is not implemented)
-
 
58
endif
-
 
59
 
43
 
60
install: all
44
install: all
61
 
45
 
62
ifeq ($(OS),Windows_NT)
46
install-doc:
-
 
47
 
63
clean:
48
clean:
64
#	$(RM) fatfs.exp fatfs.raw
49
	${RM} ${DEPS} ${OBJECTS} ${fatfs_EXP}
65
	$(RM) fatfs.tmp
50
#	${RM} ${DEPS} ${OBJECTS} ${fatfs_EXP} ${NAME} ${EXPORTS_FILE}
-
 
51
 
66
# list/ccsbcs.lst \
52
##################
67
# list/ccsbcs.r01 \
53
## Dependencies ##
68
# list/ccsbcs.s01 \
54
##################
69
# list/cout.l \
55
 
70
# list/ff.lst \
56
ifneq "${sort \
71
# list/ff.r01 \
57
${filter empty,${MAKECMDGOALS}} \
72
# list/ff.s01 \
58
${filter clean,${MAKECMDGOALS}} \
73
# list/mylib.r01
-
 
74
#	$(RMDIR) list
-
 
75
	$(RM) -r list/
59
}" ""
76
else
60
else
-
 
61
# FIXME: Triggered when multiple targets specified.
77
clean: ;
62
include ${DEPS}
78
endif
63
endif