FreeCalypso > hg > tcs211-fcmodem
comparison gpf/FRAME/cust_os/makefile @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 ####################### Makefile for GNU make ##################### | |
2 # | |
3 # makefile to build cust.lib | |
4 # | |
5 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
6 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
7 # | |
8 # targets: | |
9 # | |
10 # osx.lib functions which belong neither to frame nor to tif, somehow old files | |
11 # clean delete temp files | |
12 # | |
13 ####################################################################### | |
14 | |
15 OWN_MAKELEVEL=0 | |
16 | |
17 #---------- Directories | |
18 # to add the right header file for the specified board type | |
19 BOARD=5 | |
20 | |
21 ifdef TOOL_CHOICE | |
22 TS:=/ts$(TOOL_CHOICE) | |
23 tsTail :=_ts$(TOOL_CHOICE) | |
24 else | |
25 TS:= | |
26 endif | |
27 | |
28 ifdef PATH_CC_1_22E | |
29 PATH:=$(PATH_CC_1_22E);$(PATH) | |
30 C_DIR:=$(PATH_CC_1_22E) | |
31 endif | |
32 | |
33 ifeq ($(TOOL_CHOICE), 3) | |
34 COPTS= --align_structs=4 -pden -o -q | |
35 ifndef PATH_CC_2_54 | |
36 PATH_CC_2_54=C:/Dvpt_tools/Codegen/TMS4701x_2.54 | |
37 endif | |
38 Path:=$(PATH_CC_2_54)/bin;$(Path) | |
39 INCLUDES += -I"$(PATH_CC_2_54)/include" | |
40 endif | |
41 | |
42 ifeq ($(TOOL_CHOICE), 5) | |
43 COPTS= --align_structs=4 -pden -o -q | |
44 ifndef PATH_CC_2_55 | |
45 PATH_CC_2_55=C:\Dvpt_tools\Codegen\TMS4701x_2.55 | |
46 endif | |
47 Path:=$(PATH_CC_2_55)/bin;$(Path) | |
48 INCLUDES += -I"$(PATH_CC_2_55)/include" | |
49 endif | |
50 | |
51 ifeq ($(TOOL_CHOICE), 6) | |
52 # --code_state=16 => -mt | |
53 # --endian=little => -me | |
54 # what is -ml? | |
55 COPTS= -mv=5e --abi=ti_arm9_abi | |
56 COPTS+= -pden -pdv -mf -ms -qq -disable_branch_chaining -pi | |
57 ifndef PATH_CC_4_11 | |
58 PATH_CC_4_11=C:\Dvpt_tools\Codegen\TMS4701x_4.11 | |
59 endif | |
60 Path:=$(PATH_CC_4_11)/bin;$(Path) | |
61 INCLUDES += -I"$(PATH_CC_4_11)/include" | |
62 endif | |
63 | |
64 # for created object files | |
65 ifeq ($(TARGET), nuc) | |
66 OBJDIR=obj/$(TARGET)/$(PLATFORM)$(DB)$(OSAL)$(PS)$(OPT)$(TS) | |
67 else | |
68 OBJDIR=obj/$(TARGET)$(DB)$(OSAL)$(PS) | |
69 endif | |
70 | |
71 ifeq "$(CLEARCASE_PRIMARY_GROUP)" "" | |
72 CLRCAS=0 | |
73 else | |
74 ifeq "$(IN_VOB)" "FALSE" | |
75 CLRCAS=0 | |
76 else | |
77 CLRCAS=1 | |
78 endif | |
79 endif | |
80 | |
81 ifeq ($(CLRCAS), 1) | |
82 CHECKOUT = -cleartool co -nc | |
83 CHECKIN = -cleartool ci -nc | |
84 else | |
85 CHECKOUT = attrib -r | |
86 CHECKIN = attrib +r | |
87 endif | |
88 | |
89 VPATH=$(OBJDIR);$(OSX_SRC) | |
90 | |
91 # for created libraries | |
92 LIBDIR=../../LIB | |
93 | |
94 # Lint | |
95 LINT=lint-nt.exe | |
96 LINT_INC=-i/gpf/template/lint/ | |
97 LINT_OPT_FILE=/gpf/template/lint/options.lnt | |
98 | |
99 #-------------------------Suffixes for the name of the output file | |
100 #---------e.g. osx_na7_db.lib | |
101 | |
102 ifeq ($(TARGET), nuc) | |
103 ifeq ($(PLATFORM), arm7) | |
104 tTail :=_na7 | |
105 else | |
106 ifeq ($(PLATFORM), arm9) | |
107 tTail :=_na9 | |
108 else | |
109 ifeq ($(PLATFORM), pc) | |
110 tTail :=_npc | |
111 endif | |
112 endif | |
113 endif | |
114 endif | |
115 ifeq ($(TARGET), linuxpc) | |
116 tTail :=_lpc | |
117 OSENV=sus | |
118 NO_LINT=1 | |
119 else | |
120 ifeq ($(TARGET), rtlpc) | |
121 tTail :=_rlp | |
122 OSENV=sus | |
123 NO_LINT=1 | |
124 RTL_VERSION=2.0 | |
125 RTL_DIR=/opt/rtldk-$(RTL_VERSION)/rtlinuxpro | |
126 include $(RTL_DIR)/rtl.mk | |
127 else | |
128 ifeq ($(TARGET), linuxarm) | |
129 tTail :=_la9 | |
130 OSENV=sus | |
131 NO_LINT=1 | |
132 else | |
133 ifeq ($(TARGET), solsparc) | |
134 tTail :=_ssp | |
135 OSENV=sus | |
136 NO_LINT=1 | |
137 endif | |
138 endif | |
139 endif | |
140 endif | |
141 | |
142 #---------- shell calls | |
143 RM = -rm -rf | |
144 ifeq ($(OSENV), sus) | |
145 MKDIR = mkdir | |
146 else | |
147 MKDIR = gmkdir | |
148 endif | |
149 COPY = cp | |
150 COPTS_FILE = | |
151 CLEARTOOL = cleartool | |
152 | |
153 ifeq ($(DEBUG), 1) | |
154 dbTail :=_db | |
155 DB=/db | |
156 else | |
157 dbTail:= | |
158 endif | |
159 | |
160 ifeq ($(OS_ONLY), 1) | |
161 osTail :=_os | |
162 OSAL=/os | |
163 else | |
164 osTail:= | |
165 endif | |
166 | |
167 ifeq ($(NO_OPT), 1) | |
168 DISABLE_OPT:=1 | |
169 OPT:=/no | |
170 noTail:=_no | |
171 else | |
172 DISABLE_OPT:=0 | |
173 OPT:= | |
174 noTail:= | |
175 endif | |
176 | |
177 ifeq ($(MEMSUPER), 2) | |
178 msTail :=_ps | |
179 PS=/ps | |
180 endif | |
181 ifeq ($(MEMSUPER), 1) | |
182 msTail :=_pm | |
183 endif | |
184 ifeq ($(MEMSUPER), 0) | |
185 msTail:= | |
186 PS= | |
187 endif | |
188 | |
189 XXX:=$(tTail)$(osTail)$(dbTail)$(msTail)$(noTail)$(tsTail) | |
190 | |
191 #---------- Special settings for each target: for Nucleus/arm7 | |
192 ifeq ($(TARGET), nuc) | |
193 ifeq ($(PLATFORM), arm7) | |
194 | |
195 LINT_OPTS = $(LINT_INC) -I"$(subst \,/,$(C_DIR))" -u $(LINT_OPT_FILE) | |
196 | |
197 ifeq ($(MEMSUPER), 2) | |
198 DEFINES = -dMEMORY_SUPERVISION -dOPTIMIZE_POOL | |
199 endif | |
200 ifeq ($(MEMSUPER), 1) | |
201 DEFINES = -dMEMORY_SUPERVISION | |
202 endif | |
203 | |
204 ifeq ($(TOOL_CHOICE), ) | |
205 COPTS+= -mw -x -pw2 -q -o | |
206 endif | |
207 | |
208 CC=cl470 | |
209 COPTS+= -me -mt | |
210 | |
211 ifeq ($(DEBUG), 1) | |
212 ifeq ($(TOOL_CHOICE), ) | |
213 COPTS += -g | |
214 else | |
215 COPTS += -gt | |
216 endif | |
217 COPTS += -mn | |
218 endif | |
219 | |
220 ifeq ($(OS_ONLY), 1) | |
221 DEFINES += -d_OSX_ON_OS_ | |
222 else | |
223 COPTS+= -o3 | |
224 endif | |
225 | |
226 COPTS += -fr $(OBJDIR) -c | |
227 | |
228 INCLUDES += -I"." -I"..\..\INC" -I"..\..\INC\NUC" | |
229 | |
230 DEFINES += -d_TARGET_ -d_NUCLEUS_ | |
231 COPTSNF = $(COPTS) $(DEFINES) $(INCLUDES) | |
232 COMMLFLAGS = -rq $@ # only one command is allowed and it is "r" for replace | |
233 LFLAGS=$(COMMLFLAGS) | |
234 LIB = ar470 $(LFLAGS) | |
235 LIBEXT=lib | |
236 OSX_LIB=$(LIBDIR)/osx$(XXX).$(LIBEXT) | |
237 OBJTAIL=obj | |
238 | |
239 clean: | |
240 @$(RM) obj/$(TARGET)/$(PLATFORM)$(DB)$(OSAL)$(PS)$(TS)/*.obj | |
241 @$(RM) $(OSX_LIB) | |
242 | |
243 | |
244 endif # platform: arm7 | |
245 endif # target: nucleus | |
246 | |
247 | |
248 #---------- Special settings for each target: for Nucleus/arm9 | |
249 ifeq ($(TARGET), nuc) | |
250 ifeq ($(PLATFORM), arm9) | |
251 | |
252 INCLUDES = -I"." -I"..\..\INC" -I"..\..\INC\NUC" | |
253 | |
254 CC=cl470 | |
255 | |
256 COPTS+= -me -mt | |
257 | |
258 ifneq ($(DISABLE_OPT), 1) | |
259 ifeq ($(TOOL_CHOICE), 6) | |
260 COPTS+= -O=2 | |
261 else | |
262 COPTS+= -o | |
263 endif | |
264 endif | |
265 | |
266 ifeq ($(DEBUG), 1) | |
267 ifeq ($(TOOL_CHOICE), 6) | |
268 COPTS += --symdebug:coff | |
269 else | |
270 COPTS += -gt | |
271 # toolsets 3 und 5 | |
272 endif | |
273 COPTS += -mn | |
274 endif | |
275 | |
276 LINT_OPTS = $(LINT_INC) -I"$(subst \,/,$(C_DIR))" -u $(LINT_OPT_FILE) | |
277 | |
278 ifeq ($(MEMSUPER), 2) | |
279 DEFINES = -dMEMORY_SUPERVISION -dOPTIMIZE_POOL | |
280 endif | |
281 ifeq ($(MEMSUPER), 1) | |
282 DEFINES = -dMEMORY_SUPERVISION | |
283 endif | |
284 | |
285 ifeq ($(OS_ONLY), 1) | |
286 DEFINES += -d_OSX_ON_OS_ | |
287 endif | |
288 | |
289 COPTS += -fr $(OBJDIR) -c | |
290 | |
291 DEFINES += -d_TARGET_ -d_NUCLEUS_ | |
292 COPTSNF = $(COPTS) $(DEFINES) $(INCLUDES) | |
293 COMMLFLAGS = -rq $@ # only one command is allowed and it is "r" for replace | |
294 LFLAGS=$(COMMLFLAGS) | |
295 LIB=ar470 $(LFLAGS) | |
296 LIBEXT=lib | |
297 OSX_LIB=$(LIBDIR)/osx$(XXX).$(LIBEXT) | |
298 OBJTAIL=obj | |
299 | |
300 clean: | |
301 @$(RM) obj/$(TARGET)/$(PLATFORM)$(DB)$(OSAL)$(PS)$(RV)$(OPT)$(TS)/*.obj | |
302 @$(RM) $(OSX_LIB) | |
303 | |
304 | |
305 endif # platform: arm9 | |
306 endif # target: nucleus | |
307 | |
308 #----------NucleusWin | |
309 ifeq ($(TARGET), nuc) | |
310 ifeq ($(PLATFORM), pc) | |
311 | |
312 CC=cl | |
313 COPTS = /c /nologo /W3 /GX /Zp1 /GZ | |
314 INCLUDES = -I"." -I"..\..\inc" -I"..\..\inc\nuc" | |
315 LINT_OPT_FILE += co-msc50.lnt | |
316 LINT_OPTS = $(LINT_INC) -D_WIN32 -D_M_IX86 -I"NUC" -u $(LINT_OPT_FILE) | |
317 | |
318 ifeq ($(DEBUG), 1) | |
319 COPTS += /MD /DEBUG /Z7 | |
320 DEFINES += -D"_DEBUG" -D"NU_DEBUG" | |
321 else | |
322 COPTS += /MT | |
323 endif | |
324 | |
325 COPTS += /FR"..\..\temp\nucwin" /Fd"..\..\temp\nucwin" /Fo./$(OBJDIR)/ | |
326 | |
327 ifeq ($(OS_ONLY), 1) | |
328 DEFINES += -D"_OSX_ON_OS_" | |
329 endif | |
330 | |
331 ifeq ($(MEMSUPER), 2) | |
332 DEFINES += -D"MEMORY_SUPERVISION" -D"OPTIMIZE_POOL" | |
333 endif | |
334 ifeq ($(MEMSUPER), 1) | |
335 DEFINES += -D"MEMORY_SUPERVISION" | |
336 endif | |
337 | |
338 DEFINES += -D"_NUCLEUS_" | |
339 COPTSNF = $(COPTS) $(DEFINES) $(INCLUDES) | |
340 COPTS_FILE = | |
341 INCLUDELIST=$(subst /I ,-I,$(INCLUDES)) | |
342 DEFINELIST=$(subst /D ,-D,$(DEFINES)) | |
343 | |
344 COMMLFLAGS = /nologo /subsystem:console /machine:I386 | |
345 LFLAGS=$(COMMLFLAGS) #/debug?? | |
346 LIB=LIB /out:$@ $(LFLAGS) | |
347 LIBEXT=lib | |
348 OBJTAIL=obj | |
349 OSX_LIB=$(LIBDIR)/osx$(XXX).$(LIBEXT) | |
350 | |
351 clean: | |
352 @$(RM) obj/$(TARGET)/$(PLATFORM)$(DB)$(OSAL)$(PS)$(RV)/*.obj | |
353 @$(RM) $(OSX_LIB) | |
354 | |
355 endif | |
356 endif # nucleus && pc | |
357 | |
358 ifeq ($(OSENV), sus) | |
359 | |
360 #_OS_LAYER += os_ctb.o | |
361 OS_LAYER_SRC:=./$(OSENV)/ | |
362 COPTS = -c -o$(OBJDIR)/$@ | |
363 INCLUDES = -I. -I../../inc/$(OSENV) -I../../inc | |
364 ifeq ($(TARGET), linuxtool) | |
365 DEFINES += -D_TOOLS_ | |
366 endif | |
367 | |
368 DEFINES += -DPURE_USER_MODE #-DGSP_OSL_LOG | |
369 ifeq ($(OS_ONLY), 1) | |
370 DEFINES += -D_OSX_ON_OS_ | |
371 endif | |
372 | |
373 ifeq ($(DEBUG), 1) | |
374 COPTS += -g | |
375 DEFINES += -DOSL_DEBUG | |
376 endif | |
377 | |
378 ifeq ($(MEMSUPER), 2) | |
379 DEFINES += -DMEMORY_SUPERVISION -DOPTIMIZE_POOL | |
380 endif | |
381 ifeq ($(MEMSUPER), 1) | |
382 DEFINES += -DMEMORY_SUPERVISION | |
383 endif | |
384 | |
385 ifeq ($(TARGET), rtlpc) | |
386 COPTSNF = $(CFLAGS) | |
387 MKLIB= i386-linux-ar ruv $@ | |
388 RANLIB= i386-linux-ranlib | |
389 DEFINES += -D_RT_LINUX_ | |
390 else | |
391 ifeq ($(TARGET), linuxarm) | |
392 CC=arm-linux-gcc | |
393 MKLIB= arm-linux-ar ruv $@ | |
394 RANLIB= arm-linux-ranlib | |
395 DEFINES += -D_TARGET -D_LINUX_ -DGSP_OSL_LOG | |
396 else | |
397 ifeq ($(TARGET), solsparc) | |
398 CC=gcc | |
399 MKLIB= ar ruv $@ | |
400 RANLIB= ranlib | |
401 DEFINES += -D_SOLARIS_ -D_LINUX_ | |
402 else | |
403 CC=gcc | |
404 MKLIB= ar ruv $@ | |
405 RANLIB= ranlib | |
406 DEFINES += -D_LINUX_ | |
407 endif | |
408 endif | |
409 endif | |
410 COPTSNF += $(COPTS) $(DEFINES) $(INCLUDES) | |
411 COPTS_FILE = | |
412 INCLUDELIST=$(subst /I ,-I,$(INCLUDES)) | |
413 DEFINELIST=$(subst /D ,-D,$(DEFINES)) | |
414 | |
415 LIB=ar ruv $@ | |
416 LIBEXT=a | |
417 OBJTAIL=o | |
418 OSX_LIB=$(LIBDIR)/libosx$(XXX).$(LIBEXT) | |
419 | |
420 clean: | |
421 @$(RM) obj/$(TARGET)/$(PLATFORM)$(DB)$(PS)/*.$(OBJTAIL) | |
422 @$(RM) $(FRAME_LIB) | |
423 | |
424 endif # osenv = sus | |
425 ######################### osx.lib ################################## | |
426 OSX_INC = ../../inc/typedefs.h ../../inc/vsi.h ../../inc/header.h cust_os.h | |
427 | |
428 OSX_SRC=./ | |
429 | |
430 _OSX_OBJS = osx.$(OBJTAIL) | |
431 OSX_OBJS=$(patsubst %.$(OBJTAIL),$(OBJDIR)/%.$(OBJTAIL),$(_OSX_OBJS)) | |
432 | |
433 | |
434 foo: | |
435 echo $(OSX_OBJS) | |
436 echo $(_OSX_OBJS) | |
437 echo $(OBJDIR) | |
438 echo $(OBJTAIL) | |
439 | |
440 osx.$(LIBEXT): $(COPTS_FILE) $(OSX_LIB) | |
441 | |
442 $(OBJDIR) : | |
443 $(MKDIR) -p $(OBJDIR) | |
444 | |
445 $(OSX_LIB) : $(OBJDIR) $(COPTS_FILE) $(_OSX_OBJS) makefile | |
446 # OWN_MAKELEVEL == 0 if makefile called directly, == 1 if nested | |
447 ifneq ($(OWN_MAKELEVEL), 0) | |
448 @echo checking out and touching using $(MAKE) | |
449 $(CHECKOUT) $@ | |
450 touch -c $@ | |
451 else | |
452 gnumake MAKE=gnumake OWN_MAKELEVEL=1 $(subst \,/,$@ $<) | |
453 @echo proceeding using $(MAKE) | |
454 $(LIB) $(OSX_OBJS) | |
455 ifeq ($(OSENV), sus) | |
456 $(RANLIB) $@ | |
457 endif | |
458 endif | |
459 | |
460 | |
461 $(_OSX_OBJS) : %.$(OBJTAIL) : $(OSX_SRC)/%.c $(OSX_INC) | |
462 # $(LINT) $(LINT_OPTS) $(DEFINES) $(INCLUDES) $< | |
463 $(CC) $(COPTSNF) $< |