source: ssp_qb_r5f100le_cs/trunk/sample/Makefile@ 93

Last change on this file since 93 was 93, checked in by nmir-saito, 8 years ago

add Combined package of SSP kernel for QB-R5F100LE-TB(RL78 processor)

File size: 14.4 KB
Line 
1#
2# TOPPERS/ASP Kernel
3# Toyohashi Open Platform for Embedded Real-Time Systems/
4# Advanced Standard Profile Kernel
5#
6# Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
7# Toyohashi Univ. of Technology, JAPAN
8# Copyright (C) 2006-2010 by Embedded and Real-Time Systems Laboratory
9# Graduate School of Information Science, Nagoya Univ., JAPAN
10# Copyright (C) 2010 by Meika Sugimoto
11#
12# ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
13# ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
14# •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
15# (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
16# Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
17# ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
18# (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
19# —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
20ƒƒ“ƒgi—˜—p
21# ŽÒƒ}ƒjƒ…
22ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
23# ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
24# (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
25# —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
26# ‚ƁD
27# (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
28ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
29ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
30# ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
31# (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
32# •ñ‚·‚邱‚ƁD
33# (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
34# ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
35# ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
36# —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
37# –Ɛӂ·‚邱‚ƁD
38#
39# –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
40# ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
41# ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
42# ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
43# ‚̐ӔC‚𕉂í‚È‚¢D
44#
45#
46
47#
48# ƒ^[ƒQƒbƒg‚ÌŽw’èiMakefile.target‚ŏ㏑‚«‚³‚ê‚é‚Ì‚ð–h‚®‚½‚߁j
49#
50all:
51
52#
53# ƒ^[ƒQƒbƒg—ªÌ‚Ì’è‹`
54#
55TARGET = @(TARGET)
56
57#
58# ƒvƒƒOƒ‰ƒ~ƒ“ƒOŒ¾Œê‚Ì’è‹`
59#
60SRCLANG = @(SRCLANG)
61ifeq ($(SRCLANG),c++)
62 USE_CXX = true
63 CXXLIBS = -lstdc++ -lm -lc
64 CXXRTS = cxxrt.o newlibrt.o
65endif
66
67#
68# ƒ\[ƒXƒtƒ@ƒCƒ‹‚̃fƒBƒŒƒNƒgƒŠ‚Ì’è‹`
69#
70SRCDIR = @(SRCDIR)
71
72#
73# ƒIƒuƒWƒFƒNƒgƒtƒ@ƒCƒ‹–¼‚ÌŠg’£Žq‚̐ݒè
74#
75OBJEXT = @(OBJEXT)
76
77#
78# ŽÀsŠÂ‹«‚Ì’è‹`iƒ^[ƒQƒbƒgˆË‘¶‚ɏ㏑‚«‚³‚ê‚éê‡‚ª‚ ‚éj
79#
80DBGENV := @(DBGENV)
81
82#
83# ƒJ[ƒlƒ‹ƒ‰ƒCƒuƒ‰ƒŠilibkernel.aj‚̃fƒBƒŒƒNƒgƒŠ–¼
84# iƒJ[ƒlƒ‹ƒ‰ƒCƒuƒ‰ƒŠ‚àmake‘Ώۂɂ·‚鎞‚́C‹ó‚É’è‹`‚·‚éj
85#
86KERNEL_LIB = @(KERNEL_LIB)
87
88#
89# ƒJ[ƒlƒ‹‚ðŠÖ”’PˆÊ‚ŃRƒ“ƒpƒCƒ‹‚·‚é‚©‚Ç‚¤‚©‚Ì’è‹`
90#
91KERNEL_FUNCOBJS = @(KERNEL_FUNCOBJS)
92
93#
94# ƒgƒŒ[ƒXƒƒO‚ðŽæ“¾‚·‚é‚©‚Ç‚¤‚©‚Ì’è‹`
95#
96ENABLE_TRACE = @(ENABLE_TRACE)
97
98#
99# ƒ†[ƒeƒBƒŠƒeƒBƒvƒƒOƒ‰ƒ€‚Ì–¼Ì
100#
101PERL = @(PERL)
102CFG = @(CFG)
103
104#
105# ƒIƒuƒWƒFƒNƒgƒtƒ@ƒCƒ‹–¼‚Ì’è‹`
106#
107OBJNAME = ssp
108ifdef OBJEXT
109 OBJFILE = $(OBJNAME).$(OBJEXT)
110 CFG1_OUT = cfg1_out.$(OBJEXT)
111else
112 OBJFILE = $(OBJNAME)
113 CFG1_OUT = cfg1_out
114endif
115
116#
117# ƒ^[ƒQƒbƒgˆË‘¶•”‚̃fƒBƒŒƒNƒgƒŠ‚Ì’è‹`
118#
119TARGETDIR = $(SRCDIR)/target/$(TARGET)
120
121#
122# ƒ^[ƒQƒbƒgˆË‘¶‚Ì’è‹`‚̃Cƒ“ƒNƒ‹[ƒh
123#
124include $(TARGETDIR)/Makefile.target
125
126#
127# ƒJ[ƒlƒ‹\¬’è‹`‚̃Cƒ“ƒNƒ‹[ƒh
128#
129-include Makefile.config
130
131#
132# ƒRƒ“ƒtƒBƒMƒ…
133ƒŒ[ƒ^ŠÖŒW‚̕ϐ”‚Ì’è‹`
134#
135CFG_TABS := --api-table $(SRCDIR)/kernel/ssp_kernel_api.csv \
136 --cfg1-def-table $(SRCDIR)/kernel/ssp_kernel_def.csv \
137 --cfg1-def-table $(SRCDIR)/syssvc/syssvc_def.csv $(CFG_TABS)
138CFG_OBJS := kernel_cfg.o $(CFG_OBJS)
139CFG2_OUT := kernel_cfg.c kernel_cfg.h $(CFG2_OUT)
140
141#
142# ‹¤’ʃRƒ“ƒpƒCƒ‹ƒIƒvƒVƒ‡ƒ“‚Ì’è‹`
143#
144COPTS := $(COPTS) -g
145ifndef OMIT_WARNING_ALL
146 COPTS := $(COPTS) -Wall
147endif
148ifndef OMIT_OPTIMIZATION
149 COPTS := $(COPTS) -Os
150endif
151CDEFS := $(CDEFS)
152INCLUDES := -I. -I$(SRCDIR)/include -I$(SRCDIR)/arch -I$(SRCDIR) $(INCLUDES)
153LDFLAGS := $(LDFLAGS)
154LIBS := $(LIBS) $(CXXLIBS)
155CFLAGS = $(COPTS) $(CDEFS) $(INCLUDES)
156
157#
158# ƒAƒvƒŠƒP[ƒVƒ‡ƒ“ƒvƒƒOƒ‰ƒ€‚ÉŠÖ‚·‚é’è‹`
159#
160APPLNAME = @(APPLNAME)
161APPLDIR = @(APPLDIR)
162APPL_CFG = $(APPLNAME).cfg
163
164APPL_DIR = $(APPLDIR)
165APPL_ASMOBJS =
166ifdef USE_CXX
167 APPL_CXXOBJS = $(APPLNAME).o @(APPLOBJS)
168 APPL_COBJS =
169else
170 APPL_COBJS = $(APPLNAME).o @(APPLOBJS)
171endif
172APPL_CFLAGS =
173APPL_LIBS =
174ifdef APPLDIR
175 INCLUDES := $(INCLUDES) $(foreach dir,$(APPLDIR),-I$(dir))
176endif
177
178#
179# ƒVƒXƒeƒ€ƒT[ƒrƒX‚ÉŠÖ‚·‚é’è‹`
180#
181SYSSVC_DIR := $(SYSSVC_DIR) $(SRCDIR)/syssvc $(SRCDIR)/library
182SYSSVC_ASMOBJS := $(SYSSVC_ASMOBJS)
183SYSSVC_COBJS := $(SYSSVC_COBJS) banner.o serial.o vasyslog.o syslog.o log_output.o logtask.o
184SYSSVC_CFLAGS := $(SYSSVC_CFLAGS)
185SYSSVC_LIBS := $(SYSSVC_LIBS)
186INCLUDES := $(INCLUDES)
187
188#
189# Šg’£ƒpƒbƒP[ƒW‚ÉŠÖ‚·‚é’è‹`
190#
191
192EXTPKG_DIR := $(EXTPKG_DIR) $(SRCDIR)/extension
193
194
195#
196# ƒJ[ƒlƒ‹‚ÉŠÖ‚·‚é’è‹`
197#
198# KERNEL_ASMOBJS: ƒJ[ƒlƒ‹ƒ‰ƒCƒuƒ‰ƒŠ‚ÉŠÜ‚ß‚éCƒ\[ƒX‚ªƒAƒZƒ“ƒuƒŠŒ¾Œê‚Ì
199# ƒIƒuƒWƒFƒNƒgƒtƒ@ƒCƒ‹D
200# KERNEL_COBJS: ƒJ[ƒlƒ‹‚̃‰ƒCƒuƒ‰ƒŠ‚ÉŠÜ‚ß‚éCƒ\[ƒX‚ªCŒ¾Œê‚ŁCƒ\[ƒX
201# ƒtƒ@ƒCƒ‹‚Æ1‘Î1‚ɑΉž‚·‚éƒIƒuƒWƒFƒNƒgƒtƒ@ƒCƒ‹D
202# KERNEL_LCSRCS: ƒJ[ƒlƒ‹‚̃‰ƒCƒuƒ‰ƒŠ‚ÉŠÜ‚ß‚éCŒ¾Œê‚̃\[ƒXƒtƒ@ƒCƒ‹‚ŁC
203# 1‚‚̃\[ƒXƒtƒ@ƒCƒ‹‚©‚ç•¡”‚̃IƒuƒWƒFƒNƒgƒtƒ@ƒCƒ‹‚ð¶
204# ¬‚·‚é‚à‚́D
205# KERNEL_LCOBJS: ã‚̃\[ƒXƒtƒ@ƒCƒ‹‚©‚琶¬‚³‚ê‚éƒIƒuƒWƒFƒNƒgƒtƒ@ƒCƒ‹D
206# KERNEL_AUX_COBJS: ƒ[ƒhƒ‚ƒWƒ…
207[ƒ‹‚ÉŠÜ‚ß‚È‚¢‚ªCƒJ[ƒlƒ‹‚̃\[ƒXƒtƒ@
208# ƒCƒ‹‚Æ“¯‚¶ƒIƒvƒVƒ‡ƒ“‚ð“K—p‚µ‚ăRƒ“ƒpƒCƒ‹‚·‚ׂ«Cƒ\[
209# ƒX‚ªCŒ¾Œê‚̃IƒuƒWƒFƒNƒgƒtƒ@ƒCƒ‹D
210#
211KERNEL_DIR := $(KERNEL_DIR) $(SRCDIR)/kernel
212KERNEL_ASMOBJS := $(KERNEL_ASMOBJS)
213KERNEL_COBJS := $(KERNEL_COBJS)
214KERNEL_CFLAGS := $(KERNEL_CFLAGS) -I$(SRCDIR)/kernel -I$(EXTPKG_DIR)
215
216#
217# ƒ^[ƒQƒbƒgƒtƒ@ƒCƒ‹i•¡”‚𓯎ž‚É‘I‘ð‚µ‚Ä‚Í‚È‚ç‚È‚¢j
218#
219all: $(OBJFILE)
220#all: $(OBJNAME).bin
221#all: $(OBJNAME).srec
222
223##### ˆÈ‰º‚͕ҏW‚µ‚È‚¢‚±‚Æ #####
224
225#
226# ŠÂ‹«‚Ɉˑ¶‚·‚éƒRƒ“ƒpƒCƒ‹ƒIƒvƒVƒ‡ƒ“‚Ì’è‹`
227#
228ifdef DBGENV
229 CDEFS := $(CDEFS) -D$(DBGENV)
230endif
231#
232# ƒJ[ƒlƒ‹ƒ‰ƒCƒuƒ‰ƒŠ‚ÉŠÖ˜A‚·‚é’è‹`
233#
234ifdef KERNEL_LIB
235 LIBKERNEL = $(KERNEL_LIB)/libkernel.a
236else
237 LIBKERNEL = libkernel.a
238endif
239
240#
241# ƒJ[ƒlƒ‹‚̃tƒ@ƒCƒ‹\¬‚Ì’è‹`
242#
243include $(SRCDIR)/kernel/Makefile.kernel
244ifdef KERNEL_FUNCOBJS
245 KERNEL_LCSRCS := $(KERNEL_FCSRCS)
246 KERNEL_LCOBJS := $(foreach file,$(KERNEL_FCSRCS),$($(file:.c=)))
247else
248 KERNEL_CFLAGS := -DALLFUNC $(KERNEL_CFLAGS)
249 KERNEL_COBJS := $(KERNEL_COBJS) \
250 $(foreach file,$(KERNEL_FCSRCS),$(file:.c=.o))
251endif
252
253
254#
255# ƒ\[ƒXƒtƒ@ƒCƒ‹‚Ì‚ ‚éƒfƒBƒŒƒNƒgƒŠ‚ÉŠÖ‚·‚é’è‹`
256#
257vpath %.c $(KERNEL_DIR) $(SYSSVC_DIR) $(APPL_DIR) $(EXTPKG_DIR)
258vpath %.S $(KERNEL_DIR) $(SYSSVC_DIR) $(APPL_DIR) $(EXTPKG_DIR)
259
260#
261# ƒRƒ“ƒpƒCƒ‹‚Ì‚½‚߂̕ϐ”‚Ì’è‹`
262#
263KERNEL_LIB_OBJS = $(KERNEL_ASMOBJS) $(KERNEL_COBJS) $(KERNEL_LCOBJS)
264SYSSVC_OBJS = $(SYSSVC_ASMOBJS) $(SYSSVC_COBJS)
265APPL_OBJS = $(APPL_ASMOBJS) $(APPL_COBJS) $(APPL_CXXOBJS)
266ALL_OBJS = $(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
267 $(END_OBJS) $(HIDDEN_OBJS)
268ALL_LIBS = $(APPL_LIBS) $(SYSSVC_LIBS) $(LIBKERNEL) $(LIBS)
269
270ifdef TEXT_START_ADDRESS
271 LDFLAGS := $(LDFLAGS) -Wl,-Ttext,$(TEXT_START_ADDRESS)
272endif
273ifdef DATA_START_ADDRESS
274 LDFLAGS := $(LDFLAGS) -Wl,-Tdata,$(DATA_START_ADDRESS)
275endif
276ifdef LDSCRIPT
277 LDFLAGS := $(LDFLAGS) -T $(LDSCRIPT)
278endif
279
280
281#
282# ƒJ[ƒlƒ‹‚̃Rƒ“ƒtƒBƒMƒ…
283ƒŒ[ƒVƒ‡ƒ“ƒtƒ@ƒCƒ‹‚̐¶¬
284#
285cfg1_out.c:
286 $(CFG) --pass 1 --kernel ssp $(INCLUDES) $(CFG_TABS) $(APPL_CFG)
287
288kernel_cfg.timestamp: $(START_OBJS) cfg1_out.o $(END_OBJS) $(HIDDEN_OBJS)
289kernel_cfg.timestamp $(CFG2_OUT):
290 $(LINK) $(CFLAGS) $(LDFLAGS) $(CFG1_OUT_LDFLAGS) -o $(CFG1_OUT) \
291 $(START_OBJS) cfg1_out.o $(END_OBJS)
292 $(NM) -C $(CFG1_OUT) > cfg1_out.syms
293 $(OBJCOPY) -O srec -S $(CFG1_OUT) cfg1_out.srec
294 $(CFG) --pass 2 --kernel ssp $(INCLUDES) \
295 -T $(TARGETDIR)/target.tf $(CFG_TABS) $(APPL_CFG)
296 touch kernel_cfg.timestamp
297
298#
299# ƒJ[ƒlƒ‹ƒ‰ƒCƒuƒ‰ƒŠƒtƒ@ƒCƒ‹‚̐¶¬
300#
301libkernel.a: $(KERNEL_LIB_OBJS)
302 rm -f libkernel.a
303 $(AR) -rcs libkernel.a $(KERNEL_LIB_OBJS)
304 $(RANLIB) libkernel.a
305
306#
307# “Á•Ê‚Ȉˑ¶ŠÖŒW‚Ì’è‹`
308#
309banner.o: kernel_cfg.timestamp $(filter-out banner.o,$(ALL_OBJS)) \
310 $(filter %.a,$(ALL_LIBS))
311
312#
313# ‘S‘̂̃Šƒ“ƒN
314#
315$(OBJFILE): kernel_cfg.timestamp $(ALL_OBJS) $(filter %.a,$(ALL_LIBS))
316 $(LINK) $(CFLAGS) $(LDFLAGS) -o $(OBJFILE) $(START_OBJS) \
317 $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) $(ALL_LIBS) $(END_OBJS)
318 $(NM) -C $(OBJFILE) > $(OBJNAME).syms
319 $(OBJCOPY) -O srec -S $(OBJFILE) $(OBJNAME).srec
320 $(CFG) --pass 3 --kernel ssp $(INCLUDES) \
321 --rom-image $(OBJNAME).srec --symbol-table $(OBJNAME).syms \
322 -T $(TARGETDIR)/target_check.tf $(CFG_TABS) $(APPL_CFG)
323
324#
325# ƒoƒCƒiƒŠƒtƒ@ƒCƒ‹‚̐¶¬
326#
327$(OBJNAME).bin: $(OBJFILE)
328 $(OBJCOPY) -O binary -S $(OBJFILE) $(OBJNAME).bin
329
330#
331# SƒŒƒR[ƒhƒtƒ@ƒCƒ‹‚̐¶¬
332#
333$(OBJNAME).srec: $(OBJFILE)
334 $(OBJCOPY) -O srec -S $(OBJFILE) $(OBJNAME).srec
335
336#
337# ƒRƒ“ƒpƒCƒ‹Œ‹‰Ê‚̏Á‹Ž
338#
339.PHONY: clean
340clean:
341 rm -f \#* *~ *.o $(CLEAN_FILES)
342 rm -f $(OBJFILE) $(OBJNAME).syms $(OBJNAME).srec $(OBJNAME).bin
343 rm -f kernel_cfg.timestamp $(CFG2_OUT)
344 rm -f cfg1_out.c $(CFG1_OUT) cfg1_out.syms cfg1_out.srec
345ifndef KERNEL_LIB
346 rm -f $(LIBKERNEL)
347endif
348 rm -f makeoffset.s offset.h
349 rm -f Makefile.config
350
351.PHONY: cleankernel
352cleankernel:
353 rm -rf $(KERNEL_LIB_OBJS)
354 rm -f makeoffset.s offset.h
355
356.PHONY: cleandep
357cleandep:
358 if ! [ -f Makefile.depend ]; then \
359 rm -f kernel_cfg.timestamp $(CFG2_OUT); \
360 rm -f cfg1_out.c cfg1_out.o $(CFG1_OUT) cfg1_out.syms cfg1_out.srec; \
361 rm -f makeoffset.s offset.h; \
362 fi
363 rm -f Makefile.depend
364
365.PHONY: realclean
366realclean: cleandep clean
367ifneq ($(REALCLEAN_FILES),)
368 rm -f $(REALCLEAN_FILES)
369endif
370
371#
372# kernel_cfg.c‚Æcfg1_out.c‚̃Rƒ“ƒpƒCƒ‹ƒ‹[ƒ‹‚ƈˑ¶ŠÖŒWì¬ƒ‹[ƒ‹‚Ì’è‹`
373#
374# kernel_cfg.c‚Æcfg1_out.c‚́CƒAƒvƒŠƒP[ƒVƒ‡ƒ“ƒvƒƒOƒ‰ƒ€—pCƒVƒXƒeƒ€ƒT[
375# ƒrƒX—pCƒJ[ƒlƒ‹—p‚Ì‚·‚ׂẴIƒvƒVƒ‡ƒ“‚ð•t‚¯‚ăRƒ“ƒpƒCƒ‹‚·‚éD
376#
377KERNEL_CFG_CFLAGS = $(APPL_CFLAGS) $(SYSSVC_CFLAGS) $(KERNEL_CFLAGS)
378
379kernel_cfg.o cfg1_out.o : %.o: %.c
380 $(CC) -c $(CFLAGS) $(KERNEL_CFG_CFLAGS) $<
381
382kernel_cfg.s cfg1_out.s : %.s: %.c
383 $(CC) -S $(CFLAGS) $(KERNEL_CFG_CFLAGS) $<
384
385kernel_cfg.d cfg1_out.d : %.d: %.c
386 @$(PERL) $(SRCDIR)/utils/makedep -C $(CC) $(MAKEDEP_OPTS) \
387 -O "$(CFLAGS) $(KERNEL_CFG_CFLAGS)" $< >> Makefile.depend
388
389#
390# “ÁŽê‚Ȉˑ¶ŠÖŒWì¬ƒ‹[ƒ‹‚Ì’è‹`
391#
392cfg1_out.depend:
393 @$(CFG) -M cfg1_out.c $(INCLUDES) $(APPL_CFG) >> Makefile.depend
394
395makeoffset.d: makeoffset.c
396 @$(PERL) $(SRCDIR)/utils/makedep -C $(CC) $(MAKEDEP_OPTS) \
397 -T "makeoffset.s" -O "$(CFLAGS) $(KERNEL_CFLAGS)" $< >> Makefile.depend
398
399#
400# ˆË‘¶ŠÖŒWƒtƒ@ƒCƒ‹‚̐¶¬
401#
402.PHONY: gendepend
403gendepend:
404 @echo "Generating Makefile.depend."
405
406.PHONY: depend
407ifdef KERNEL_LIB
408depend: cleandep kernel_cfg.timestamp gendepend \
409 cfg1_out.depend cfg1_out.d \
410 $(ALL_OBJS:.o=.d)
411else
412depend: cleandep kernel_cfg.timestamp gendepend \
413 cfg1_out.depend cfg1_out.d \
414 $(KERNEL_AUX_COBJS:.o=.d) $(KERNEL_ASMOBJS:.o=.d) \
415 $(KERNEL_COBJS:.o=.d) $(KERNEL_LCSRCS:.c=.d) $(ALL_OBJS:.o=.d)
416endif
417
418#
419# ˆË‘¶ŠÖŒWƒtƒ@ƒCƒ‹‚ðƒCƒ“ƒNƒ‹[ƒh
420#
421-include Makefile.depend
422
423#
424# ŠJ”­ƒc[ƒ‹‚̃Rƒ}ƒ“ƒh–¼‚Ì’è‹`
425#
426ifeq ($(TOOL),gcc)
427 #
428 # GNUŠJ”­ŠÂ‹«—p
429 #
430 ifdef GCC_TARGET
431 GCC_TARGET_PREFIX = $(GCC_TARGET)-
432 else
433 GCC_TARGET_PREFIX =
434 endif
435 CC = $(GCC_TARGET_PREFIX)gcc
436 CXX = $(GCC_TARGET_PREFIX)g++
437 AS = $(GCC_TARGET_PREFIX)as
438 LD = $(GCC_TARGET_PREFIX)ld
439 AR = $(GCC_TARGET_PREFIX)ar
440 NM = $(GCC_TARGET_PREFIX)nm
441 RANLIB = $(GCC_TARGET_PREFIX)ranlib
442 OBJCOPY = $(GCC_TARGET_PREFIX)objcopy
443 OBJDUMP = $(GCC_TARGET_PREFIX)objdump
444endif
445
446ifdef USE_CXX
447 LINK = $(CXX)
448else
449 LINK = $(CC)
450endif
451
452#
453# ƒRƒ“ƒpƒCƒ‹ƒ‹[ƒ‹‚Ì’è‹`
454#
455KERNEL_ALL_COBJS = $(KERNEL_COBJS) $(KERNEL_AUX_COBJS)
456
457$(KERNEL_ALL_COBJS): %.o: %.c
458 $(CC) -c $(CFLAGS) $(KERNEL_CFLAGS) $<
459
460$(KERNEL_ALL_COBJS:.o=.s): %.s: %.c
461 $(CC) -S $(CFLAGS) $(KERNEL_CFLAGS) $<
462
463$(KERNEL_LCOBJS): %.o:
464 $(CC) -DTOPPERS_$(*F) -o $@ -c $(CFLAGS) $(KERNEL_CFLAGS) $<
465
466$(KERNEL_LCOBJS:.o=.s): %.s:
467 $(CC) -DTOPPERS_$(*F) -o $@ -S $(CFLAGS) $(KERNEL_CFLAGS) $<
468
469$(KERNEL_ASMOBJS): %.o: %.S
470 $(CC) -c $(CFLAGS) $(KERNEL_CFLAGS) $<
471
472$(SYSSVC_COBJS): %.o: %.c
473 $(CC) -c $(CFLAGS) $(SYSSVC_CFLAGS) $<
474
475$(SYSSVC_COBJS:.o=.s): %.s: %.c
476 $(CC) -S $(CFLAGS) $(SYSSVC_CFLAGS) $<
477
478$(SYSSVC_ASMOBJS): %.o: %.S
479 $(CC) -c $(CFLAGS) $(SYSSVC_CFLAGS) $<
480
481$(APPL_COBJS): %.o: %.c
482 $(CC) -c $(CFLAGS) $(APPL_CFLAGS) $<
483
484$(APPL_COBJS:.o=.s): %.s: %.c
485 $(CC) -S $(CFLAGS) $(APPL_CFLAGS) $<
486
487$(APPL_CXXOBJS): %.o: %.cpp
488 $(CXX) -c $(CFLAGS) $(APPL_CFLAGS) $<
489
490$(APPL_CXXOBJS:.o=.s): %.s: %.cpp
491 $(CXX) -S $(CFLAGS) $(APPL_CFLAGS) $<
492
493$(APPL_ASMOBJS): %.o: %.S
494 $(CC) -c $(CFLAGS) $(APPL_CFLAGS) $<
495
496#
497# ˆË‘¶ŠÖŒWì¬ƒ‹[ƒ‹‚Ì’è‹`
498#
499$(KERNEL_COBJS:.o=.d): %.d: %.c
500 @$(PERL) $(SRCDIR)/utils/makedep -C $(CC) $(MAKEDEP_OPTS) \
501 -O "$(CFLAGS) $(KERNEL_CFLAGS)" $< >> Makefile.depend
502
503$(KERNEL_LCSRCS:.c=.d): %.d: %.c
504 @$(PERL) $(SRCDIR)/utils/makedep -C $(CC) $(MAKEDEP_OPTS) -T "$($*)" \
505 -O "-DALLFUNC $(CFLAGS) $(KERNEL_CFLAGS)" $< >> Makefile.depend
506
507$(KERNEL_ASMOBJS:.o=.d): %.d: %.S
508 @$(PERL) $(SRCDIR)/utils/makedep -C $(CC) $(MAKEDEP_OPTS) \
509 -O "$(CFLAGS) $(KERNEL_CFLAGS)" $< >> Makefile.depend
510
511$(SYSSVC_COBJS:.o=.d): %.d: %.c
512 @$(PERL) $(SRCDIR)/utils/makedep -C $(CC) $(MAKEDEP_OPTS) \
513 -O "$(CFLAGS) $(SYSSVC_CFLAGS)" $< >> Makefile.depend
514
515$(SYSSVC_ASMOBJS:.o=.d): %.d: %.S
516 @$(PERL) $(SRCDIR)/utils/makedep -C $(CC) $(MAKEDEP_OPTS) \
517 -O "$(CFLAGS) $(SYSSVC_CFLAGS)" $< >> Makefile.depend
518
519$(APPL_COBJS:.o=.d): %.d: %.c
520 @$(PERL) $(SRCDIR)/utils/makedep -C $(CC) $(MAKEDEP_OPTS) \
521 -O "$(CFLAGS) $(APPL_CFLAGS)" $< >> Makefile.depend
522
523$(APPL_CXXOBJS:.o=.d): %.d: %.cpp
524 @$(PERL) $(SRCDIR)/utils/makedep -C $(CXX) $(MAKEDEP_OPTS) \
525 -O "$(CFLAGS) $(APPL_CFLAGS)" $< >> Makefile.depend
526
527$(APPL_ASMOBJS:.o=.d): %.d: %.S
528 @$(PERL) $(SRCDIR)/utils/makedep -C $(CC) $(MAKEDEP_OPTS) \
529 -O "$(CFLAGS) $(APPL_CFLAGS)" $< >> Makefile.depend
530
531#
532# ƒfƒtƒHƒ‹ƒgƒRƒ“ƒpƒCƒ‹ƒ‹[ƒ‹‚ðã‘‚«
533#
534%.o: %.c
535 @echo "*** Default compile rules should not be used."
536 $(CC) -c $(CFLAGS) $<
537
538%.s: %.c
539 @echo "*** Default compile rules should not be used."
540 $(CC) -S $(CFLAGS) $<
541
542%.o: %.cpp
543 @echo "*** Default compile rules should not be used."
544 $(CXX) -c $(CFLAGS) $<
545
546%.s: %.cpp
547 @echo "*** Default compile rules should not be used."
548 $(CXX) -S $(CFLAGS) $<
549
550%.o: %.S
551 @echo "*** Default compile rules should not be used."
552 $(CC) -c $(CFLAGS) $<
Note: See TracBrowser for help on using the repository browser.