comparison src/gpf3/frame/makefile @ 2:c41a534f33c6

src/gpf3: preened GPF goo from TCS3.2
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Sep 2016 23:52:50 +0000
parents
children
comparison
equal deleted inserted replaced
1:864b8cc0cf63 2:c41a534f33c6
1 ####################### Makefile for GNU make #####################
2 #
3 # makefile with rules for all different variations of Frame
4 #
5 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 #
8 # targets:
9 #
10 # os_layer (objects)
11 # frameobjs Frame + OS-Layer + TST (objects)
12 # ../lib/frame.lib or ../lib/frame.dll
13 # ../lib/ofe.lib or ../lib/ofe.dll Frame + OS_LAYER + TST + OFE
14 # clean delete object files
15 #
16 #######################################################################
17
18
19 VPATH=$(OS_LAYER_SRC) $(OBJDIR)
20 OWN_MAKELEVEL=0
21
22
23 GPF:=$(subst \,/,$(GPF))
24
25 ifdef TOOL_CHOICE
26 TS:=/ts$(TOOL_CHOICE)
27 tsTail :=_ts$(TOOL_CHOICE)
28 else
29 TS:=
30 endif
31
32 ifdef PATH_CC_1_22E
33 PATH:=$(PATH_CC_1_22E);$(PATH)
34 C_DIR:=$(PATH_CC_1_22E)
35 endif
36
37 ifeq ($(TOOL_CHOICE), 3)
38 COPTS= --align_structs=4 -pden -q
39 ifndef PATH_CC_2_54
40 PATH_CC_2_54=C:/Dvpt_tools/Codegen/TMS4701x_2.54
41 C_DIR=PATH_CC_2_54
42 endif
43 Path:=$(PATH_CC_2_54)/bin;$(Path)
44 INCLUDES += -I"$(PATH_CC_2_54)/include"
45 endif
46
47 ifeq ($(TOOL_CHOICE), 5)
48 COPTS= --align_structs=4 -pden -q
49 ifndef PATH_CC_2_55
50 PATH_CC_2_55=C:\Dvpt_tools\Codegen\TMS4701x_2.55
51 # C_DIR=PATH_CC_2_55
52 endif
53 Path:=$(PATH_CC_2_55)/bin;$(Path)
54 INCLUDES += -I"$(PATH_CC_2_55)/include"
55 endif
56
57 ifeq ($(TOOL_CHOICE), 6)
58 # --code_state=16 => -mt
59 # --endian=little => -me
60 # what is -ml?
61 COPTS= -mv=5e --abi=ti_arm9_abi
62 COPTS+= -pden -pdv -mf -ms -qq -disable_branch_chaining -pi
63 ifndef PATH_CC_4_11
64 PATH_CC_4_11=C:\Dvpt_tools\Codegen\TMS4701x_4.11
65 # C_DIR=PATH_CC_4_11
66 endif
67 Path:=$(PATH_CC_4_11)/bin;$(Path)
68 INCLUDES += -I"$(PATH_CC_4_11)/include"
69 endif
70
71 #*==== PARAMETERS-ANALYSIS =========================================*#
72 ifeq ($(FLOAT), 1)
73 REPLACE = -replace
74 endif
75
76 ifeq ($(OS_ONLY), 1)
77 OSAL:=/os
78 else
79 OSAL:=
80 endif
81
82 ifeq ($(TARGET), nuc)
83 ifeq ($(RUN_FLASH), 1)
84 SECTION:=/fl
85 endif
86
87 ifeq ($(RUN_INT_RAM), 1)
88 SECTION:=/ir
89 endif
90 else
91 SECTION:=
92 endif
93
94 ifeq ($(TARGET), linuxpc)
95 ESF=1
96 endif
97 ifeq ($(TARGET), linuxarm)
98 ESF=1
99 endif
100 ifeq ($(TARGET), solsparc)
101 ESF=1
102 endif
103
104 ifeq ($(ESF), 1)
105 ES:=/esf
106 else
107 ES:=
108 endif
109
110 ifeq ($(NO_LINT), 1)
111 USE_LINT:=1
112 else
113 USE_LINT:=0
114 endif
115
116 ifeq "$(CLEARCASE_PRIMARY_GROUP)" ""
117 CLRCAS=0
118 else
119 ifeq "$(IN_VOB)" "FALSE"
120 CLRCAS=0
121 else
122 CLRCAS=1
123 endif
124 endif
125
126 ifeq ($(CLRCAS), 1)
127 CHECKOUT = -cleartool co -nc
128 CHECKIN = -cleartool ci -nc
129 else
130 CHECKOUT = attrib -r
131 CHECKIN = attrib +r
132 endif
133
134 # for created object files
135 ifeq ($(TARGET), nuc)
136 OBJDIR=obj/$(TARGET)/$(PLATFORM)$(DB)$(OSAL)$(PS)$(ES)$(SECTION)$(OPT)$(TS)
137 NUC_OBJDIR=e:/nucleus/v1.1/os/asm
138 TIF_OBJDIR=../tst/$(OBJDIR)
139 MISC_OBJDIR=../misc/$(OBJDIR)
140 else
141 OBJDIR=obj/$(TARGET)$(DB)$(OSAL)$(PS)$(ES)
142 endif
143
144 # for stack calculation
145 GAWK=../tools/bin/gawk.exe
146 AWK_PROG=../BIN/cg$(tTail).awk
147
148 # Lint
149 LINT=lint-nt.exe
150 LINT_INC=-i/gpf/template/lint/
151 LINT_OPT_FILE=/gpf/template/lint/options.lnt
152
153 # general directories
154 GPFDIR=..
155 INCDIR=../inc
156 ifndef TI_DIR
157 TI_DIR=/chipsetsw/
158 endif
159 override TI_DIR:=$(subst \,/,$(TI_DIR))
160
161 # for created libraries
162 ifeq ($(TARGET), win32)
163 LIBDIR=../LIB/WIN32$(DEBUGDIR)
164 BINDIR=../BIN$(DEBUGDIR)
165 else
166 LIBDIR:=../LIB
167 endif
168
169
170 OS_LAYER_SRC=./$(TARGET)
171 FRAME_SRC=./
172
173
174
175 #-------------------------general exported include files
176 INC_FILES=Vsi.h os.h typedefs.h drvconf.h STDDEFS.H gdi.h comp.h Header.h \
177 ofe.h PEI.H poolconf.h TOK.H $(LIBDIR)/FrmConst.h
178
179 #-------------------------Suffixes for the name of the output file
180 #---------e.g. frame_tr_rt_po_db.lib
181
182 ifeq ($(ESF), 1)
183 esfTail :=_esf
184 else
185 esfTail :=
186 endif
187
188 ifeq ($(RUN_FLASH), 1)
189 flTail :=_fl
190 else
191 flTail:=
192 endif
193
194 ifeq ($(RUN_INT_RAM), 1)
195 irTail :=_ir
196 else
197 irTail:=
198 endif
199
200 ifeq ($(TARGET), nuc)
201 ifeq ($(PLATFORM), arm7)
202 tTail :=_na7
203 else
204 ifeq ($(PLATFORM), arm9)
205 tTail :=_na9
206 else
207 ifeq ($(PLATFORM), pc)
208 tTail :=_npc
209 endif
210 endif
211 endif
212 else
213 ifeq ($(TARGET), nuc_ARM)
214 tTail :=_ar
215 else
216 ifeq ($(TARGET), win32)
217 tTail :=
218 else
219 ifeq ($(TARGET), psos)
220 tTail :=_po
221 else
222 ifeq ($(TARGET), vxworks)
223 tTail :=_vx
224 ifeq ($(TOOL), gnu)
225 tlTail :=_gn
226 else
227 tlTail :=_di
228 endif
229 ifeq ($(CPU), PPC603)
230 cpTail :=_pp
231 endif
232 else
233 ifeq ($(TARGET), linuxpc)
234 tTail :=_lpc
235 OSENV=sus
236 NO_LINT=1
237 else
238 ifeq ($(TARGET), rtlpc)
239 tTail :=_rlp
240 OSENV=sus
241 NO_LINT=1
242 RTL_VERSION=2.0
243 RTL_DIR=/opt/rtldk-$(RTL_VERSION)/rtlinuxpro
244 include $(RTL_DIR)/rtl.mk
245 else
246 ifeq ($(TARGET), linuxarm)
247 tTail :=_la9
248 OSENV=sus
249 NO_LINT=1
250 else
251 ifeq ($(TARGET), solsparc)
252 tTail :=_ssp
253 OSENV=sus
254 NO_LINT=1
255 endif
256 endif
257 endif
258 endif
259 endif
260 endif
261 endif
262 endif
263 endif
264
265
266 ifeq ($(DEBUG), 1)
267 DB=/db
268 ifeq ($(TARGET), win32)
269 DEBUGDIR=/debug
270 dbTail :=
271 else
272 dbTail :=_db
273 endif
274 else
275 dbTail:=
276 DB=
277 endif
278
279 ifeq ($(OS_ONLY), 1)
280 LIBNAME = os
281 else
282 LIBNAME = frame
283 endif
284
285 ifeq ($(NO_OPT), 1)
286 DISABLE_OPT:=1
287 OPT:=/no
288 noTail:=_no
289 else
290 DISABLE_OPT:=0
291 OPT:=
292 noTail:=
293 endif
294
295 #---------- shell calls
296 RM = -rm -rf
297 ifeq ($(OSENV), sus)
298 MKDIR = mkdir
299 else
300 MKDIR = gmkdir
301 endif
302 COPY = cp
303 MOVE = mv
304 COPTS_FILE =
305 CLEARTOOL = cleartool
306 ECHO = @echo
307
308 #-------------------------Suffixes for the name of the output files
309 #--------frame.lib suffixes
310
311 ifeq ($(MEMSUPER), 2)
312 msTail :=_ps
313 PS=/ps
314 endif
315 ifeq ($(MEMSUPER), 1)
316 msTail :=_pm
317 endif
318 ifeq ($(MEMSUPER), 0)
319 msTail:=
320 PS=
321 endif
322
323 XXX:=$(tTail)$(tlTail)$(cpTail)$(dbTail)$(msTail)$(esfTail)$(irTail)$(flTail)$(noTail)$(tsTail)
324
325 #-------------------------Suffixes for the name of the output files
326
327 _OS_LAYER= os_pro.$(OBJTAIL) os_com.$(OBJTAIL) os_tim.$(OBJTAIL) os_sem.$(OBJTAIL) os_mis.$(OBJTAIL) os_mem.$(OBJTAIL) $(OS_ISR) $(OS_PART) $(OSDRV)
328
329 ifeq ($(OS_ONLY), 1)
330 _FRAMEOBJS = $(ESF_FUNC)
331 else
332 _FRAMEOBJS = frame.$(OBJTAIL) vsi_sem.$(OBJTAIL) vsi_com.$(OBJTAIL) vsi_mem.$(OBJTAIL) vsi_tim.$(OBJTAIL)\
333 vsi_mis.$(OBJTAIL) vsi_drv.$(OBJTAIL) vsi_trc.$(OBJTAIL) vsi_pro.$(OBJTAIL) xalert.$(OBJTAIL)\
334 route.$(OBJTAIL) prf_func.$(OBJTAIL) frm_ext.$(OBJTAIL) $(ESF_FUNC)
335 endif
336
337 _TIFOBJS = $(TIF_OBJDIR)/tst_pei.$(OBJTAIL) $(TIF_OBJDIR)/tstdriver.$(OBJTAIL) $(TIF_OBJDIR)/tif.$(OBJTAIL)\
338 $(TIF_OBJDIR)/tr.$(OBJTAIL) $(TIF_OBJDIR)/titrc.$(OBJTAIL)
339
340 _MISCOBJS = $(MISC_OBJDIR)/tok.$(OBJTAIL) $(MISC_OBJDIR)/tools.$(OBJTAIL)
341
342
343 _NUCOBJS = $(NUC_OBJDIR)/inc.$(OBJTAIL) $(NUC_OBJDIR)/dmi.$(OBJTAIL) $(NUC_OBJDIR)/evi.$(OBJTAIL) $(NUC_OBJDIR)/pmi.$(OBJTAIL) $(NUC_OBJDIR)/mbi.$(OBJTAIL) $(NUC_OBJDIR)/ioi.$(OBJTAIL) $(NUC_OBJDIR)/tmi.$(OBJTAIL) \
344 $(NUC_OBJDIR)/qui.$(OBJTAIL) $(NUC_OBJDIR)/hii.$(OBJTAIL) $(NUC_OBJDIR)/eri.$(OBJTAIL) $(NUC_OBJDIR)/pii.$(OBJTAIL) $(NUC_OBJDIR)/smi.$(OBJTAIL) $(NUC_OBJDIR)/tci.$(OBJTAIL) $(NUC_OBJDIR)/erc.$(OBJTAIL) \
345 $(NUC_OBJDIR)/mbd.$(OBJTAIL) $(NUC_OBJDIR)/iod.$(OBJTAIL) $(NUC_OBJDIR)/hid.$(OBJTAIL) $(NUC_OBJDIR)/pid.$(OBJTAIL) $(NUC_OBJDIR)/qud.$(OBJTAIL) $(NUC_OBJDIR)/erd.$(OBJTAIL) $(NUC_OBJDIR)/lic.$(OBJTAIL) \
346 $(NUC_OBJDIR)/rld.$(OBJTAIL) $(NUC_OBJDIR)/lid.$(OBJTAIL) $(NUC_OBJDIR)/ioc.$(OBJTAIL) $(NUC_OBJDIR)/ioce.$(OBJTAIL) $(NUC_OBJDIR)/iof.$(OBJTAIL) $(NUC_OBJDIR)/quc.$(OBJTAIL) $(NUC_OBJDIR)/quce.$(OBJTAIL) \
347 $(NUC_OBJDIR)/quf.$(OBJTAIL) $(NUC_OBJDIR)/qus.$(OBJTAIL) $(NUC_OBJDIR)/quse.$(OBJTAIL) $(NUC_OBJDIR)/pic.$(OBJTAIL) $(NUC_OBJDIR)/pice.$(OBJTAIL) $(NUC_OBJDIR)/pif.$(OBJTAIL) $(NUC_OBJDIR)/pis.$(OBJTAIL) \
348 $(NUC_OBJDIR)/pise.$(OBJTAIL) $(NUC_OBJDIR)/mbc.$(OBJTAIL) $(NUC_OBJDIR)/mbce.$(OBJTAIL) $(NUC_OBJDIR)/mbf.$(OBJTAIL) $(NUC_OBJDIR)/mbs.$(OBJTAIL) $(NUC_OBJDIR)/mbse.$(OBJTAIL) $(NUC_OBJDIR)/sms.$(OBJTAIL) \
349 $(NUC_OBJDIR)/smse.$(OBJTAIL) $(NUC_OBJDIR)/tcs.$(OBJTAIL) $(NUC_OBJDIR)/tcse.$(OBJTAIL) $(NUC_OBJDIR)/evf.$(OBJTAIL) $(NUC_OBJDIR)/hic.$(OBJTAIL) $(NUC_OBJDIR)/dmc.$(OBJTAIL) $(NUC_OBJDIR)/dmce.$(OBJTAIL) \
350 $(NUC_OBJDIR)/dmd.$(OBJTAIL) $(NUC_OBJDIR)/dmf.$(OBJTAIL) $(NUC_OBJDIR)/evc.$(OBJTAIL) $(NUC_OBJDIR)/evce.$(OBJTAIL) $(NUC_OBJDIR)/evd.$(OBJTAIL) $(NUC_OBJDIR)/pmf.$(OBJTAIL) $(NUC_OBJDIR)/smf.$(OBJTAIL) \
351 $(NUC_OBJDIR)/tcf.$(OBJTAIL) $(NUC_OBJDIR)/tmf.$(OBJTAIL) $(NUC_OBJDIR)/rlc.$(OBJTAIL) $(NUC_OBJDIR)/csc.$(OBJTAIL) $(NUC_OBJDIR)/tmc.$(OBJTAIL) $(NUC_OBJDIR)/pmc.$(OBJTAIL) $(NUC_OBJDIR)/pmce.$(OBJTAIL) \
352 $(NUC_OBJDIR)/pmd.$(OBJTAIL) $(NUC_OBJDIR)/smc.$(OBJTAIL) $(NUC_OBJDIR)/smce.$(OBJTAIL) $(NUC_OBJDIR)/smd.$(OBJTAIL) $(NUC_OBJDIR)/tcc.$(OBJTAIL) $(NUC_OBJDIR)/tcce.$(OBJTAIL) $(NUC_OBJDIR)/tcd.$(OBJTAIL) \
353 $(NUC_OBJDIR)/tms.$(OBJTAIL) $(NUC_OBJDIR)/tmse.$(OBJTAIL) $(NUC_OBJDIR)/tmd.$(OBJTAIL)
354
355
356 ifeq ($(MEMSUPER), 2)
357 _FRAMEOBJS += vsi_ppm.$(OBJTAIL)
358 endif
359
360 _FRAMEOBJS += frame_version.$(OBJTAIL)
361
362 #----------------------------------- Special settings for each target
363 #----------Nucleus
364 ifeq ($(TARGET), nuc)
365 ifeq ($(PLATFORM), arm7)
366
367 OSDRV = os_drv.$(OBJTAIL)
368 OS_ISR = os_isr.$(OBJTAIL)
369 OS_LAYER_SRC:=./nuc/
370 _OS_LAYER += os_evt.$(OBJTAIL)
371
372 ifeq ($(TOOL_CHOICE), )
373 COPTS+= -mw -x -pw2 -q -o
374 endif
375
376 CC=cl470
377 COPTS+= -me -mt
378
379 ifeq ($(DEBUG), 1)
380 ifeq ($(TOOL_CHOICE), )
381 COPTS += -g
382 else
383 COPTS += -gt
384 endif
385 COPTS += -mn
386 DEFINES += -dNU_DEBUG
387 endif
388
389 ifeq ($(ASM_ONLY), 1)
390 ASMOBJS = $(_NUCOBJS) $(_TIFOBJS) $(_MISCOBJS)
391 COPTS+= -q -n -x0 -fs $(OBJDIR)
392 MKLIB = $(GAWK) -f $(AWK_PROG) > $(FRAME_LIB)
393 OBJTAIL = asm
394 FRAME_LIB = $(OBJDIR)/frame$(XXX).pa
395 else
396 LIBEXT = lib
397 OBJTAIL = obj
398 FRAME_LIB=$(LIBDIR)/$(LIBNAME)$(XXX).$(LIBEXT)
399 LINT_OPT_FILE += nucleus.lnt
400 LINT_OPTS = $(LINT_INC) -I"$(subst \,/,$(C_DIR))" -u $(LINT_OPT_FILE)
401 MKLIB = ar470 $(LFLAGS)
402 endif
403
404 ifeq ($(OS_ONLY), 1)
405 DEFINES += -dFF_OS_ONLY
406 else
407 DEFINES += -d_FF_RV_EXIST_
408 COPTS+= -o3
409 endif
410
411 ifeq ($(POOL_SPLIT), 1)
412 DEFINES += -dFF_POOL_SPLIT
413 endif
414
415 ifeq ($(RUN_INT_RAM), 1)
416 COPTS += -dRUN_INT_RAM
417 endif
418
419 ifeq ($(RUN_FLASH), 1)
420 COPTS += -dRUN_FLASH
421 endif
422
423 COPTS += -fr $(OBJDIR) -c
424
425 ifeq ($(MEMSUPER), 2)
426 DEFINES += -dMEMORY_SUPERVISION -dOPTIMIZE_POOL
427 endif
428 ifeq ($(MEMSUPER), 1)
429 DEFINES += -dMEMORY_SUPERVISION
430 endif
431
432 INCLUDES+=-I"." -I"..\FRAME\NUC" -I"..\INC\NUC" -I"..\INC\NUC\ARM7" -I"..\INC" \
433 -I"..\TST" -I"$(TI_DIR)\Riviera" -I"$(TI_DIR)\Riviera\rv" -I"$(TI_DIR)\Services\dar" \
434 -I"$(TI_DIR)\Riviera\rvm" -I"$(TI_DIR)\System" -I"$(TI_DIR)\Services" \
435 -I"$(TI_DIR)\Drivers\drv_app" -I"$(TI_DIR)\Drivers\drv_app\ffs" \
436 -I"$(TI_DIR)\System\deps_objs\gprs_dsample_amr_nw" -I"$(TI_DIR)\System\deps_objs\gprs_dsample_amr_nw\config"
437
438
439 DEFINES += -d_TARGET_ -d_NUCLEUS_
440 COPTSNF = $(COPTS) $(DEFINES) $(INCLUDES)
441 INCLUDELIST=$(INCLUDES)
442 DEFINELIST=$(subst -d,-D,$(DEFINES))
443 COPTS_FILE=
444 COMMLFLAGS = -rq $@ # only one command:a
445 LFLAGS=$(COMMLFLAGS)
446 LIBEXT=lib
447
448 clean:
449 @$(RM) obj/$(TARGET)/$(PLATFORM)$(DB)$(OSAL)$(PS)$(SECTION)$(TS)/*.$(OBJTAIL)
450 @$(RM) $(FRAME_LIB)
451
452 endif
453 endif # nucleus & arm7
454
455 #----------Nucleus
456 ifeq ($(TARGET), nuc)
457 ifeq ($(PLATFORM), arm9)
458
459 OSDRV = os_drv.$(OBJTAIL)
460 OS_ISR = os_isr.$(OBJTAIL)
461 OS_LAYER_SRC:=./nuc/
462 _OS_LAYER += os_evt.$(OBJTAIL)
463
464 CC=cl470
465 COPTS+= -me -mt
466
467 ifneq ($(DISABLE_OPT), 1)
468 ifeq ($(TOOL_CHOICE), 6)
469 COPTS+= -O=2
470 else
471 COPTS+= -o
472 endif
473 endif
474
475 ifeq ($(DEBUG), 1)
476 ifeq ($(TOOL_CHOICE), 6)
477 COPTS += --symdebug:coff
478 else
479 # toolset 3 and 5
480 COPTS += -gt
481 endif
482 COPTS += -mn
483 DEFINES += -dNU_DEBUG
484 endif
485
486 LINT_OPT_FILE += nucleus.lnt
487 LINT_OPTS = $(LINT_INC) -I"$(subst \,/,$(C_DIR))" -u $(LINT_OPT_FILE)
488
489 ifeq ($(OS_ONLY), 1)
490 DEFINES += -dFF_OS_ONLY
491 endif
492
493 ifeq ($(ESF), 1)
494 ESF_FUNC = esf_func.$(OBJTAIL)
495 DEFINES += -d_ESF_SUPPORT_
496 endif
497
498 ifeq ($(RUN_INT_RAM), 1)
499 COPTS += -dRUN_INT_RAM
500 endif
501
502 ifeq ($(RUN_FLASH), 1)
503 COPTS += -dRUN_FLASH
504 endif
505
506 COPTS += -fr $(OBJDIR) -c
507
508 ifeq ($(MEMSUPER), 2)
509 DEFINES += -dMEMORY_SUPERVISION -dOPTIMIZE_POOL
510 endif
511 ifeq ($(MEMSUPER), 1)
512 DEFINES += -dMEMORY_SUPERVISION
513 endif
514
515 INCLUDES+=-I"." -I"..\FRAME\NUC" -I"..\INC\NUC" -I"..\INC" -I"..\TST"
516 MKLIB=ar470 $(LFLAGS)
517
518 INCLUDES += -I"..\inc\NUC\ARM9"
519
520 DEFINES += -d_TARGET_ -d_NUCLEUS_
521 COPTSNF = $(COPTS) $(DEFINES) $(INCLUDES)
522 INCLUDELIST=$(INCLUDES)
523 DEFINELIST=$(subst -d,-D,$(DEFINES))
524 COPTS_FILE=
525 COMMLFLAGS = -rq $@ # only one command:a
526 LFLAGS=$(COMMLFLAGS)
527 LIBEXT=lib
528 OBJTAIL=obj
529 FRAME_LIB=$(LIBDIR)/$(LIBNAME)$(XXX).$(LIBEXT)
530
531 clean:
532 @$(RM) obj/$(TARGET)/$(PLATFORM)$(DB)$(OSAL)$(PS)$(ES)$(SECTION)$(OPT)$(TS)/*.$(OBJTAIL)
533 @$(RM) $(FRAME_LIB)
534
535 endif
536 endif # nucleus & arm9
537
538
539 #----------------------------------- Special settings for each target
540 #----------Nucleus_ARM
541 ifeq ($(TARGET), nuc_ARM)
542
543 OSDRV = os_drv.$(OBJTAIL)
544 OS_LAYER_SRC:=./nuc/
545 _OS_LAYER += os_evt.$(OBJTAIL)
546
547 CC=perl "\G23M\Condat\INT\BIN\gti_compile.pl"
548 COPTS= -me -mt -pw2 -q -x -mw -o # from condat_env.mak and os.mak for nucleus.lib
549
550 ifeq ($(DEBUG), 1)
551 COPTS += -g -mn
552 DEFINES += -dNU_DEBUG
553 endif
554 COPTS += -fr $(OBJDIR) -fo $(OBJDIR)/$@ -c
555
556 ifeq ($(MEMSUPER), 2)
557 DEFINES += -dMEMORY_SUPERVISION -dOPTIMIZE_POOL
558 endif
559 ifeq ($(MEMSUPER), 1)
560 DEFINES += -dMEMORY_SUPERVISION
561 endif
562
563 INCLUDES+=-I"..\FRAME\NUC" -I"..\inc\NUC" -I"..\inc\NUC\ARM7" -I"..\inc" -I"..\TST"
564 DEFINES += -d_TARGET_ -d_NUCLEUS_
565 COPTSNF = $(COPTS) $(DEFINES) $(INCLUDES)
566 INCLUDELIST=$(INCLUDES)
567 DEFINELIST=$(subst -d,-D,$(DEFINES))
568 COPTS_FILE=
569 COMMLFLAGS = -rq $@ # only one command:a
570 LFLAGS=$(COMMLFLAGS)
571 MKLIB=perl "\G23M\Condat\INT\BIN\gti_archive.pl" $(LFLAGS)
572 LIBEXT=lib
573 OBJTAIL=obj
574 FRAME_LIB=$(LIBDIR)/$(LIBNAME)$(XXX).$(LIBEXT)
575
576 clean:
577 @$(RM) obj/$(TARGET)$(DB)$(PS)/*.$(OBJTAIL)
578 @$(RM) $(FRAME_LIB)
579
580 endif # target: Nucleus_ARM
581
582
583 #----------------------------------- Special settings for each target
584 #----------NucleusWin
585 ifeq ($(TARGET), nuc)
586 ifeq ($(PLATFORM), pc)
587
588 OS_ISR = os_isr.$(OBJTAIL)
589 _OS_LAYER += os_ctb.obj
590 _OS_LAYER += os_evt.$(OBJTAIL)
591 OS_LAYER_SRC:=./nuc/
592 CC=cl
593 COPTS = /c /nologo /W3 /GX /Zp1 /GZ
594 INCLUDES += -I"." -I"..\inc\NUC" -I"..\inc\NUC\PC" -I"..\inc" -I"..\TST"
595 LINT_OPT_FILE += co-msc50.lnt
596 LINT_OPTS = $(LINT_INC) -D_WIN32 -D_M_IX86 -I"NUC" -u $(LINT_OPT_FILE)
597
598 ifeq ($(DEBUG), 1)
599 COPTS += /MD /DEBUG /Z7
600 DEFINES += -D"_DEBUG" -D"NU_DEBUG"
601 else
602 COPTS += /MT
603 endif
604
605 COPTS += /FR"..\temp\nucwin" /Fd"..\temp\nucwin" /Fo./$(OBJDIR)/
606
607 ifeq ($(OS_ONLY), 1)
608 DEFINES += -D"FF_OS_ONLY"
609 endif
610
611 ifeq ($(MEMSUPER), 2)
612 DEFINES += -D"MEMORY_SUPERVISION" -D"OPTIMIZE_POOL"
613 endif
614 ifeq ($(MEMSUPER), 1)
615 DEFINES += -D"MEMORY_SUPERVISION"
616 endif
617
618 ifeq ($(POOL_SPLIT), 1)
619 DEFINES += -D"FF_POOL_SPLIT"
620 endif
621
622 DEFINES += -D"_NUCLEUS_"
623 COPTSNF = $(COPTS) $(DEFINES) $(INCLUDES)
624 COPTS_FILE =
625 INCLUDELIST=$(subst /I ,-I,$(INCLUDES))
626 DEFINELIST=$(subst /D ,-D,$(DEFINES))
627
628 COMMLFLAGS = /nologo /subsystem:console /machine:I386
629 LFLAGS=$(COMMLFLAGS) #/debug??
630 MKLIB=LIB /out:$@ $(LFLAGS)
631 LIBEXT=lib
632 OBJTAIL=obj
633 FRAME_LIB=$(LIBDIR)/$(LIBNAME)$(XXX).$(LIBEXT)
634
635 clean:
636 @$(RM) obj/$(TARGET)/$(PLATFORM)$(DB)$(OSAL)$(PS)/*.$(OBJTAIL)
637 @$(RM) $(FRAME_LIB)
638
639 endif
640 endif # nucleus && pc
641
642
643 ifeq ($(OSENV), sus)
644
645 #_OS_LAYER += os_ctb.o
646 OS_ISR = os_isr.$(OBJTAIL)
647 ESF_FUNC = esf_func.$(OBJTAIL)
648 OS_LAYER_SRC:=./$(OSENV)/
649 COPTS = -c -o$(OBJDIR)/$@
650 INCLUDES += -I. -I../inc/$(OSENV) -I../inc -I../TST -I$(OS_LAYER_SRC)
651 ifeq ($(TARGET), linuxtool)
652 DEFINES += -D_TOOLS_
653 endif
654
655 DEFINES += -DPURE_USER_MODE
656
657 ifeq ($(OSL_LOG), 1)
658 DEFINES += -DOSL_OSL_LOG
659 endif
660 ifeq ($(OS_ONLY), 1)
661 DEFINES += -DFF_OS_ONLY
662 endif
663
664 ifeq ($(DEBUG), 1)
665 COPTS += -g
666 DEFINES += -DOSL_DEBUG
667 endif
668
669 ifeq ($(MEMSUPER), 2)
670 DEFINES += -DMEMORY_SUPERVISION -DOPTIMIZE_POOL
671 endif
672 ifeq ($(MEMSUPER), 1)
673 DEFINES += -DMEMORY_SUPERVISION
674 endif
675
676 ifeq ($(TARGET), rtlpc)
677 COPTSNF = $(CFLAGS)
678 MKLIB= i386-linux-ar ruv $@
679 RANLIB= i386-linux-ranlib
680 DEFINES += -D_RT_LINUX_
681 else
682 ifeq ($(TARGET), linuxarm)
683 CC=arm-linux-gcc
684 MKLIB= arm-linux-ar ruv $@
685 RANLIB= arm-linux-ranlib
686 DEFINES += -D_TARGET -D_LINUX_ -D_ESF_SUPPORT_
687 else
688 ifeq ($(TARGET), solsparc)
689 CC=gcc
690 MKLIB= ar ruv $@
691 RANLIB= ranlib
692 DEFINES += -D_SOLARIS_ -D_LINUX_ -D_ESF_SUPPORT_
693 else
694 CC=gcc
695 MKLIB= ar ruv $@
696 RANLIB= ranlib
697 DEFINES += -D_LINUX_ -D_ESF_SUPPORT_
698 endif
699 endif
700 endif
701 COPTSNF += $(COPTS) $(DEFINES) $(INCLUDES)
702 COPTS_FILE =
703 INCLUDELIST=$(subst /I ,-I,$(INCLUDES))
704 DEFINELIST=$(subst /D ,-D,$(DEFINES))
705
706 MKLIB=ar ruv $@
707 LIBEXT=a
708 OBJTAIL=o
709 FRAME_LIB=$(LIBDIR)/lib$(LIBNAME)$(XXX).$(LIBEXT)
710
711 clean:
712 @$(RM) $(OBJDIR)/*.$(OBJTAIL)
713 @$(RM) $(FRAME_LIB)
714
715 #_TESTOBJS=os_pro.o os_mem.o os_com.o os_sem.o os_tim.o os_mis.o
716 #TESTOBJS=$(patsubst %.$(OBJTAIL),$(OBJDIR)/%.$(OBJTAIL),$(_TESTOBJS))
717 os_test: os_test$(tTail)
718 @echo os_test$(tTail) built
719
720 os_test$(tTail): $(_TESTOBJS) sus/os_test.c $(FRAME_LIB)
721 $(CC) -g -o $@ $(INCLUDES) $(DEFINES) sus/os_test.c $(FRAME_LIB) -lpthread -lrt
722
723 endif # osenv = sus
724
725 #----------------------------------- Special settings for each target
726 #----------Win32
727 ifeq ($(TARGET), win32)
728 MISCXXX:=$(tTail)$(dbTail)
729 TIFXXX:=$(tTail)$(dbTail)
730 TOOLS_LIBDIR=../tools/lib
731 OS_LAYER_SRC:=./vcms/
732 CC=cl
733 COPTS += /c /nologo /GX /W3 /Zp1 /GZ
734 INCLUDES += -I"." -I$(OS_LAYER_SRC) -I"..\inc\vcms" -I"..\inc\win32" -I"..\inc\vcms\win32" -I"..\inc"
735 LINT_OPT_FILE += co-msc50.lnt
736 LINT_OPTS = $(LINT_INC) -D_WIN32 -D_M_IX86 -D_MSC_VER -D"WIN32" -u $(LINT_OPT_FILE)
737
738 INCLUDES += -I"..\lib\win32"
739 _OS_LAYER += frame_dllmain.$(OBJTAIL)
740
741 COPTS += /FR"..\temp\win32" /Fo./$(OBJDIR)/
742
743 DEFINES += -D"CRASH_TOL"
744 DEFINES += -D"_TOOLS_"
745
746 DEFINES += -D"FRAME_DLL"
747 DLLFLAGS= /dll\
748 $(EXPFILE) $(LIBDIR)/misc$(MISCXXX).lib \
749 $(LIBDIR)/tif$(TIFXXX).lib \
750 $(LIBDIR)/ntutils.lib $(TOOLS_LIBDIR)/psapi.lib \
751 user32.lib
752
753 COMMLFLAGS = $(DLLFLAGS)
754 COMMLFLAGS += /nologo
755 ifeq ($(DEBUG), 1)
756 COPTS += -DEBUG /MDd /Z7
757 DEFINES += -D"_DEBUG"
758 COMMLFLAGS += /DEBUG /incremental:no /pdb:none\
759 ../os_lib/win32/debug/cms.lib \
760 /nodefaultlib:"libcmtd"
761 else #debug
762 COPTS += /MD
763 COMMLFLAGS += ../os_lib/win32/cms.lib \
764 /nodefaultlib:"libcmt"
765 endif #debug
766 COPTSNF = $(COPTS) $(DEFINES) $(INCLUDES)
767 INCLUDELIST=$(subst /I ,-I,$(INCLUDES))
768 DEFINELIST=$(subst /D ,-D,$(DEFINES))
769
770 LFLAGS=$(COMMLFLAGS)
771 LFLAGS += /SECTION:FRAME_SHARED,RWS
772 LIBEXT = dll
773 MKLIB=link.exe /out:$@ $(LFLAGS)
774 OBJTAIL=obj
775 FRAME_LIB=$(BINDIR)/$(LIBNAME)$(XXX).$(LIBEXT)
776
777 COPTS_FILE=
778 EXPFILE=$(LIBDIR)/frame$(XXX).exp
779 IMPLIB=$(LIBDIR)/frame$(XXX).lib
780
781 INC_FILES+=vcms/os_const.h
782
783 implib: $(IMPLIB)
784
785 $(IMPLIB) $(EXPFILE): $(OBJDIR) $(_OS_LAYER) $(_FRAMEOBJS)
786 # OWN_MAKELEVEL == 0 if makefile called directly, == 1 if nested
787 ifneq ($(OWN_MAKELEVEL), 0)
788 @echo checking out and touching using $(MAKE) for two possible targets ($@), make level $(OWN_MAKELEVEL)
789 $(CHECKOUT) $(IMPLIB)
790 touch -c $(IMPLIB)
791 else
792 gnumake MAKE=gnumake OWN_MAKELEVEL=1 $(subst \,/,$@ $<)
793 @echo proceeding using $(MAKE) for two possible targets ($@), make level $(OWN_MAKELEVEL)
794 lib.exe /nologo /MACHINE:IX86 /DEF:frame$(msTail).def $(FRAMEOBJS)\
795 $(OS_LAYER) /OUT:$(IMPLIB) /NAME:frame$(XXX).dll
796 endif
797
798 clean:
799 $(RM) $(OBJDIR)/*.$(OBJTAIL)
800 $(RM) $(IMPLIB) $(EXPFILE) $(FRAME_LIB)
801
802 endif # target: win32
803
804
805
806 #----------------------------------- Special settings for each target
807 #----------pSOS+
808 ifeq ($(TARGET), psos)
809
810 OS_LAYER_SRC:=./psos/
811 CC=cc386
812 COPTS_FILE:=c.opt
813 _OS_LAYER += drv_conf.$(OBJTAIL)
814 SPEC_F_OBJS=
815
816 -include $(PSS_BSP)/bsp.mk# board support settings e.g. MODEL, FPU
817
818 ifeq ( FPU,H )
819 FPUOPT = -VNDP
820 else
821 FPUOPT=
822 endif
823
824 COPTS1 = -c -V$(MODEL) -VROM -VBSS -VANSI -VLONGNAME -VSPROTO -VQUIET -VDIAGNOSTICS
825 COPTS2 = $(FPUOPT) -I$(COMFSRC)/configps/
826 COPTS3 = -I. -I$(PSS_ROOT)/include -I$(PSS_BSP) -I$(PSS_ROOT)/bsps/devices
827 COPTS4 = -I./ -I../inc/ -I../inc/psos/ -I./psos/ -I../../g23net/dev/config -I../TST
828 COPTS5 = -DMODEL=$(MODEL) -VNOSIGNEDCHAR -D__CADUL__=1 -DPSOS=1 -D_PSOS_
829
830 ifeq ($(MEMSUPER), 2)
831 COPTS5 += -DMEMORY_SUPERVISION -DOPTIMIZE_POOL
832 endif
833 ifeq ($(MEMSUPER), 1)
834 COPTS5 += -DMEMORY_SUPERVISION
835 endif
836
837 ifeq ($(DEBUG), 1)
838 COPTS5 += -VXDB
839 endif
840
841 COPTS5 += -DTEST_TARGET_IP_ADDRESS
842
843 COPTS = @c.opt
844
845 #$(COPTS1) $(COPTS2) $(COPTS3) $(COPTS4) $(COPTS5) ich wollte c.opt umgehen. erstmal keinen Erfolg.
846
847 COPTS += -o $(OBJDIR)/$@
848 COPTSNF = $(COPTS)
849 LIBEXT = lib
850 MKLIB = lib386 $@ # psos related libs will not be included here
851 OBJTAIL=obj
852 FRAME_LIB=$(LIBDIR)/$(LIBNAME)$(XXX).$(LIBEXT)
853
854 c.opt: makefile
855 @echo $(COPTS1) > c.opt
856 @echo $(COPTS2) >> c.opt
857 @echo $(COPTS3) >> c.opt
858 @echo $(COPTS4) >> c.opt
859 @echo $(COPTS5) >> c.opt
860
861 #psos.abs: os.abs wie? wozu??
862
863 #~~~~~~
864 clean:
865 @$(RM) obj/$(TARGET)$(DB)$(PS)/*.$(OBJTAIL)
866 @$(RM) $(FRAME_LIB)
867 @$(RM) c.opt
868 endif # target: psos
869
870 #----------------------------------- Special settings for each target
871 #---------- vxworks
872 ifeq ($(TARGET), vxworks)
873
874 OS_PART = os_part.$(OBJTAIL)
875
876 CC = ccppc
877 OS_LAYER_SRC = ./$(TARGET)
878 SPEC_OSL_INC =
879 SPEC_OSL_OBJS =
880 SPEC_F_OBJS =
881
882 ifeq ($(DEBUG), 1)
883 COPTSNF = -g
884 else
885 COPTSNF = -O2
886 endif
887 COPTSNF += -c -mstrict-align -ansi -nostdinc -DRW_MULTI_THREAD -D_REENTRANT \
888 -fvolatile -fno-builtin -fno-for-scope -DCPU=$(CPU) \
889 -I$(WIND_BASE)/target/h -I. -I../../g23net/dev/config -I../inc/$(TARGET) \
890 -I../inc -D_VXWORKS_ -I../TST
891
892 ifeq ($(MEMSUPER), 2)
893 COPTSNF += -DMEMORY_SUPERVISION -DOPTIMIZE_POOL
894 endif
895 ifeq ($(MEMSUPER), 1)
896 COPTSNF += -DMEMORY_SUPERVISION
897 endif
898
899 COPTSNF += -o $(OBJDIR)/$@
900 LIBEXT = a
901 MKLIB = arppc crus $@
902 OBJTAIL=obj
903
904 FRAME_LIB= $(LIBDIR)/$(LIBNAME)$(XXX).$(LIBEXT)
905
906 clean:
907 @$(RM) obj/$(TARGET)$(DB)$(PS)/*.o*
908 @$(RM) $(FRAME_LIB)
909
910 endif
911 # target: vxworks
912
913 ######################### echo for control ##################################
914
915 #echo:
916 # @echo $(_OS_LAYER)
917 # @echo $(OS_LAYER)
918 # @echo $(_FRAMEOBJS)
919 # @echo $(FRAMEOBJS)
920 # @echo $(SRCFILES)
921 # @echo $(DEFINES)
922 # @echo $(DEFINELIST)
923
924 ######################### OS layer ##################################
925
926 OS_LAYER=$(patsubst %.$(OBJTAIL),$(OBJDIR)/%.$(OBJTAIL),$(_OS_LAYER))
927
928 os_layer: $(COPTS_FILE) $(_OS_LAYER)
929
930 ######################### Frame ##################################
931 .PHONY: all label help
932
933 asm: $(OBJDIR) $(FRAME_LIB)
934
935 FRAMEOBJS=$(patsubst %.$(OBJTAIL),$(OBJDIR)/%.$(OBJTAIL),$(_FRAMEOBJS))
936
937 frameobjs: $(COPTS_FILE) $(_OS_LAYER) $(_FRAMEOBJS)
938
939 frame.$(LIBEXT): $(FRAME_LIB)
940
941 $(OBJDIR) :
942 $(MKDIR) -p $(OBJDIR)
943
944 $(FRAME_LIB) : $(OBJDIR) $(COPTS_FILE) $(_OS_LAYER) $(_FRAMEOBJS) makefile $(EXPFILE)
945 # OWN_MAKELEVEL == 0 if makefile called directly, == 1 if nested
946 ifneq ($(OWN_MAKELEVEL), 0)
947 @echo checking out and touching using $(MAKE)
948 $(CHECKOUT) $@ $(IMPLIB)
949 touch -c $@ $(IMPLIB)
950 else
951 gnumake MAKE=gnumake OWN_MAKELEVEL=1 $(subst \,/,$@ $<)
952 @echo proceeding using $(MAKE)
953 ifneq ($(OSENV), sus)
954 $(RM) $@
955 endif
956 $(MKLIB) $(FRAMEOBJS) $(OS_LAYER) $(ASMOBJS)
957 ifeq ($(OSENV), sus)
958 $(RANLIB) $@
959 endif
960 endif
961
962 $(_OS_LAYER) $(_FRAMEOBJS): %.$(OBJTAIL) : %.c
963 $(RM) $(OBJDIR)/frame_version.$(OBJTAIL)
964 ifneq ($(NO_LINT), 1)
965 $(LINT) $(LINT_OPTS) $(DEFINES) $(INCLUDES) $<
966 endif
967 $(CC) $(COPTSNF) $<
968
969 SRCFILES=$(patsubst %.$(OBJTAIL),%.c,$(_FRAMEOBJS) $(_OS_LAYER))
970
971 FRAME_DEP=dep_frame_$(PROJECT)$(XXX).mk
972
973 help:
974 $(ECHO) usage...
975 $(ECHO) building:
976 $(ECHO) "gnumake [DEBUG={1|0}] [ROUTING={1|0}] [MEMSUPER={1|0}] ..."
977 $(ECHO) cleaning:
978 $(ECHO) "gnumake clean [DEBUG={1|0}] [ROUTING={1|0}] [MEMSUPER={1|0}] ..."
979 $(ECHO) ClearCase:
980 $(ECHO) "gnumake checkin - not implemeted yet -"
981 $(ECHO) "gnumake label LABEL=<label type> [FLOAT={1|0}] [DEBUG={1|0}] [ROUTING={1|0}] "
982 $(ECHO) " [MEMSUPER={1|0}] ..."
983 $(ECHO) help:
984 $(ECHO) "gnumake help"
985
986 DEPEND_DIRS=$(GPFDIR) $(LIBDIR) $(BINDIR) $(INCDIR)
987 EXPORT_FILES=$(IMPLIB) $(FRAME_LIB)
988 INCLUDE_FILES=$(patsubst %,../inc/%,$(INC_FILES))
989
990 label:
991 -$(CLEARTOOL) mklabel -recurse $(REPLACE) $(LABEL) . 2>> error.log
992 -$(CLEARTOOL) mklabel $(REPLACE) $(LABEL) $(DEPEND_DIRS) \
993 $(EXPORT_FILES) $(INCLUDE_FILES) 2>> error.log
994
995 depend: $(SRCFILES)
996 @touch $(FRAME_DEP)
997 makedepend -b -f$(FRAME_DEP) $^ -Y -o.$(OBJTAIL) $(INCLUDELIST) $(DEFINELIST)
998 @$(RM) $(FRAME_DEP)
999
1000 -include $(FRAME_DEP)
1001