comparison src/gpf3/ccd/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 #-----------------------------------------------------------------------------
2 # Project :
3 # Modul : makefile
4 #-----------------------------------------------------------------------------
5 # Copyright 2002 Texas Instruments Deutschland GmbH
6 # All rights reserved.
7 #
8 # This file is confidential and a trade secret of Texas
9 # Instruments Deutschland GmbH
10 # The receipt of or possession of this file does not convey
11 # any rights to reproduce or disclose its contents or to
12 # manufacture, use, or sell anything it may describe, in
13 # whole, or in part, without the specific written consent of
14 # Texas Instruments Deutschland GmbH.
15 #-----------------------------------------------------------------------------
16 # Purpose: (gnu-) makefile to build libraries of the Condat Coder Decoder
17 # targets: ccd.dll, ccd.lib and clean
18 # Hint: To achieve variations of ccd.lib you need to set some
19 # environment variables, e.g. DEBUG and TRACE. To ease the building
20 # process you can also use the batch file "m.bat".
21 #-----------------------------------------------------------------------------
22
23 include ccd_inc.mk
24
25 VPATH=$(OBJDIR)
26
27 #---------- Directories
28 GPF:=$(subst \,/,$(GPF))
29
30 # force to use sh.exe in gpf
31 ifneq ($(OSENV), sus)
32 SHELL=$(GPF)/tools/bin/sh.exe
33 endif
34
35 ifeq "$(CLEARCASE_PRIMARY_GROUP)" ""
36 CLRCAS=0
37 else
38 ifeq "$(IN_VOB)" "FALSE"
39 CLRCAS=0
40 else
41 CLRCAS=1
42 endif
43 endif
44
45 ifdef PATH_CC_1_22E
46 Path:=$(PATH_CC_1_22E);$(Path)
47 PATH:=$(PATH_CC_1_22E);$(PATH)
48 C_DIR:=$(PATH_CC_1_22E)
49 endif
50
51 ifeq ($(TOOL_CHOICE), 3)
52 COPTS= --align_structs=4 -pden
53 ifndef PATH_CC_2_54
54 PATH_CC_2_54=C:/Dvpt_tools/Codegen/TMS4701x_2.54
55 endif
56 Path:=$(PATH_CC_2_54)/bin;$(Path)
57 INCLUDES += -I"$(PATH_CC_2_54)/include"
58 endif
59
60 ifeq ($(TOOL_CHOICE), 5)
61 COPTS= --align_structs=4 -pden
62 ifndef PATH_CC_2_55
63 PATH_CC_2_55=C:/Dvpt_tools/Codegen/TMS4701x_2.55
64 endif
65 Path:=$(PATH_CC_2_55)/bin;$(Path)
66 INCLUDES += -I"$(PATH_CC_2_55)/include"
67 endif
68
69 ifeq ($(TOOL_CHOICE), 6)
70 # --code_state=16 => -mt
71 # --endian=little => -me
72 COPTS= -mv=5e --abi=ti_arm9_abi
73 COPTS+= -pden -pdv -mf -ms -qq -disable_branch_chaining -pi
74 COPTS+= -O=2
75 ifndef PATH_CC_4_11
76 PATH_CC_4_11=C:/Dvpt_tools/Codegen/TMS4701x_4.11
77 endif
78 Path:=$(PATH_CC_4_11)/bin;$(Path)
79 INCLUDES += -I"$(PATH_CC_4_11)/include"
80 endif
81
82 # for created object files
83 ifeq ($(PLATFORM), )
84 OBJDIR=obj/ccd/$(TARGET)$(TRACEDIR)$(DEBUGDIR)$(PSDIR)
85 else
86 OBJDIR=obj/ccd/$(TARGET)/$(PLATFORM)$(TSDIR)$(TRACEDIR)$(DEBUGDIR)$(PSDIR)$(DADIR)$(SECTION)
87 endif
88
89 # guarantee / as path seperator even if OBJDIR is set with the make call
90 override OBJDIR:=$(subst \,/,$(OBJDIR))
91
92 # for stack calculation
93 GAWK=$(GPF)/tools/bin/gawk.exe
94 AWK_PROG=$(GPF)/BIN/cg$(tTail).awk
95
96 # for created libraries
97 LIBDIR=../LIB
98 BINDIR=../BIN$(DEBUGDIR)
99
100 FRAMELIB_DIR =../lib/win32$(DEBUGDIR)
101
102 # for CCD source files
103 CCD_SRC=./
104
105
106 #---------- shell calls
107 RM = rm -rf
108 ECHO = @echo
109 ifeq ($(OSENV), sus)
110 MKDIR = mkdir
111 else
112 MKDIR = $(GPF)/tools/bin/mkdir
113 endif
114
115 ifeq ($(CLRCAS), 1)
116 CHECKOUT = -cleartool co -nda -nc
117 CHECKIN = -cleartool ci -nc
118 else
119 CHECKOUT = attrib -r
120 CHECKIN = attrib +r
121 endif
122
123 CO_LIBS = $(CCD_LIB)
124
125 _CCD_OBJS = ccd.$(OBJTAIL) bitfun.$(OBJTAIL) cdc_std.$(OBJTAIL) \
126 cdc_com.$(OBJTAIL) ccd_err.$(OBJTAIL) ccd_store.$(OBJTAIL)\
127 gsm1_tv.$(OBJTAIL) gsm1_v.$(OBJTAIL) gsm2_t.$(OBJTAIL) gsm3_tv.$(OBJTAIL) gsm3_v.$(OBJTAIL) gsm4_lv.$(OBJTAIL) \
128 gsm4_tlv.$(OBJTAIL) gsm5_tlv.$(OBJTAIL) gsm5_tv.$(OBJTAIL) gsm5_v.$(OBJTAIL) gsm6_tlv.$(OBJTAIL) gsm7_lv.$(OBJTAIL) \
129 bcd_mnc.$(OBJTAIL) bcd_nofill.$(OBJTAIL) bcdeven.$(OBJTAIL) bcdodd.$(OBJTAIL) \
130 gsm1_asn.$(OBJTAIL) \
131 csn1_s1.$(OBJTAIL) csn1_sh.$(OBJTAIL) s_padding.$(OBJTAIL) t30_ident.$(OBJTAIL) \
132 asn1_bitstr.$(OBJTAIL) asn1_octet.$(OBJTAIL) asn1_integ.$(OBJTAIL) \
133 asn1_seq.$(OBJTAIL) asn1_choice.$(OBJTAIL) no_code.$(OBJTAIL)\
134 asn1_choice_ext.$(OBJTAIL) asn1_seq_ext.$(OBJTAIL) asn1_integ_ext.$(OBJTAIL) \
135 asn1_opentype.$(OBJTAIL) asn1_objid.$(OBJTAIL)\
136 noncritical_ext.$(OBJTAIL) critical_ext.$(OBJTAIL)\
137 ccd_elem.$(OBJTAIL) s_padding_0.$(OBJTAIL) csn1_s0.$(OBJTAIL) hl_flag.$(OBJTAIL) \
138 freq_list.$(OBJTAIL) fdd_ci.$(OBJTAIL) tdd_ci.$(OBJTAIL) freq_list_com.$(OBJTAIL) \
139 csn1_concat.$(OBJTAIL) break_cond.$(OBJTAIL) csn1_sx.$(OBJTAIL) \
140 csn1_choice_1.$(OBJTAIL) csn1_choice_2.$(OBJTAIL) csn1_choice_x.$(OBJTAIL) \
141 csn1_sh_opt.$(OBJTAIL) csn1_s1_opt.$(OBJTAIL) csn1_s0_opt.$(OBJTAIL)
142
143 ifeq ($(TARGET), win32)
144 _CCD_OBJS += ccd_config.obj ccd_patch.obj
145 endif
146
147 #----------------------------------- Special settings for each target
148 #----------Nucleus
149 ifeq ($(TARGET), nuc)
150 ifeq ($(PLATFORM), arm7)
151
152 ifeq ($(TOOL_CHOICE), )
153 COPTS+= -mw -x -pw2
154 endif
155
156 CC=cl470
157 COPTS+= -me -mt -q
158 ifeq ($(ASM_ONLY), 1)
159 COPTS+= -q -n -x0 -fs $(OBJDIR)
160 MKLIB = $(GAWK) -f $(AWK_PROG) > $(CCD_LIB)
161 OBJTAIL = asm
162 CCD_LIB = $(OBJDIR)/ccd$(XXX).pa
163 else
164 COPTS+= -o
165 MKLIB = ar470 $(LFLAGS)
166 LIBEXT = lib
167 OBJTAIL = obj
168 CCD_LIB = $(LIBDIR)/ccd$(XXX).$(LIBEXT)
169 endif
170
171 ifeq ($(DEBUG), 1)
172 ifeq ($(TOOL_CHOICE), )
173 COPTS += -g
174 else
175 COPTS += -gt
176 endif
177 COPTS += -mn
178 endif
179 COPTS += -fr $(OBJDIR) -c
180
181 ifeq ($(TRACE), 1)
182 DEFINES += -dDEBUG_CCD -dERR_TRC_STK_CCD
183 endif
184
185 ifeq ($(RUN_INT_RAM), 1)
186 DEFINES += -dRUN_INT_RAM
187 endif
188
189 ifeq ($(RUN_FLASH), 1)
190 DEFINES += -dRUN_FLASH
191 endif
192
193 ifeq ($(MEMSUPER), 1)
194 DEFINES += -dMEMORY_SUPERVISION
195 endif
196
197 INCLUDES += -I"." -I"../inc" -I"../inc/nuc"
198 ifeq ($(DYNARR), 1)
199 DEFINES += -dDYNAMIC_ARRAYS
200 endif
201 DEFINES += -dM_INTEL -dSHARED_VSI -dSHARED_CCD
202 DEFINES += -dCCDDATA_STATIC_DATA
203 DEFINES += -d_TMS470 -dNEW_ENTITY -dERR_TRACE_CCD
204 COPTSNF = $(COPTS) $(DEFINES) $(INCLUDES)
205 INCLUDELIST = $(INCLUDES)
206 DEFINELIST = $(subst -d,-D,$(DEFINES))
207 COMMLFLAGS = -rq $@
208 LFLAGS = $(COMMLFLAGS)
209
210 endif # platform: arm7, TI compiler
211 endif # target: nucleus OS
212
213 #----------Nucleus & arm9
214 ifeq ($(TARGET), nuc)
215 ifeq ($(PLATFORM), arm9)
216
217 CC=cl470
218 COPTS+= -me -mt -q
219
220 ifeq ($(ASM_ONLY), 1)
221 COPTS+= -n -pn -pi -fs $(OBJDIR)
222 MKLIB = $(GAWK) -f $(AWK_PROG) > $(CCD_LIB)
223 OBJTAIL = asm
224 CCD_LIB = $(OBJDIR)/ccd$(XXX).pa
225 else
226 COPTS+= -c -o
227 MKLIB=ar470 $(LFLAGS)
228 LIBEXT=lib
229 OBJTAIL=obj
230 CCD_LIB=$(LIBDIR)/ccd$(XXX).$(LIBEXT)
231 ifeq ($(DEBUG), 1)
232 COPTS += -mn
233 endif
234 endif
235
236 ifeq ($(DEBUG), 1)
237 ifeq ($(TOOL_CHOICE), 6)
238 COPTS += --symdebug:coff
239 else
240 # toolset 3 and 5
241 COPTS += -gt
242 endif
243 COPTS += -mn
244 endif
245 COPTS += -fr $(OBJDIR)
246
247 ifeq ($(TRACE), 1)
248 DEFINES += -dDEBUG_CCD -dERR_TRC_STK_CCD
249 endif
250 ifeq ($(MEMSUPER), 1)
251 DEFINES += -dMEMORY_SUPERVISION
252 endif
253
254 INCLUDES += -I"." -I"../inc" -I"../inc/nuc"
255
256 DEFINES += -dM_INTEL -dSHARED_VSI -dCCD_PLUGIN_GSM -dSHARED_CCD
257 DEFINES += -dCCDDATA_STATIC_DATA -dDYNAMIC_ARRAYS
258 DEFINES += -d_TMS470 -dNEW_ENTITY -dERR_TRACE_CCD
259 DEFINES += -dCCDDATA_U32
260 ifeq ($(CCD_SYMBOLS), 1)
261 DEFINES += -dCCD_SYMBOLS
262 endif
263
264 COPTSNF = $(COPTS) $(DEFINES) $(INCLUDES)
265 COMMLFLAGS = -rq $@
266 LFLAGS=$(COMMLFLAGS)
267
268 endif # platform: arm9, TI compiler
269 endif # target: nucleus OS
270
271 #----------NucleusWin
272 ifeq ($(TARGET), nuc)
273 ifeq ($(PLATFORM), pc)
274
275 CC=cl
276 COPTS = /c /nologo /W3 /GX /Zp1
277 COPTS += /Fo$(OBJDIR)/
278 ifeq ($(DEBUG), 1)
279 COPTS += /MTd /Z7
280 else
281 COPTS += /MT
282 endif
283
284 ifeq ($(GLOBS), 1)
285 _CCD_OBJS = pc_globs.obj
286 CCD_LIB = $(OBJDIR)/pc_globs.exe
287 MKLIB = link.exe /out:$@ $(LFLAGS) /INCREMENTAL:NO /PDB:NONE
288 else
289 CCD_LIB = $(LIBDIR)/ccd$(XXX).$(LIBEXT)
290 MKLIB = link.exe -lib /out:$@ $(LFLAGS)
291 endif
292
293 ifeq ($(TRACE), 1)
294 DEFINES += -DDEBUG_CCD -DERR_TRC_STK_CCD
295 endif
296 ifeq ($(MEMSUPER), 1)
297 DEFINES += -DMEMORY_SUPERVISION
298 endif
299
300 INCLUDES = -I"." -I"../inc" -I"../inc/nuc"
301 DEFINES += -D"M_INTEL" -D"SHARED_VSI" -D"SHARED_CCD"\
302 -D"CCDDATA_STATIC_DATA" -D"DYNAMIC_ARRAYS"\
303 -D"CCD_SYMBOLS" -D"NEW_ENTITY" -D"WIN32"\
304 -D"ERR_TRACE_CCD"
305 COPTSNF = $(COPTS) $(DEFINES) $(INCLUDES)
306 INCLUDELIST = $(subst /I ,-I,$(INCLUDES))
307 DEFINELIST = $(subst /D ,-D,$(DEFINES))
308 COMMLFLAGS = /nologo #/subsystem:console /machine:I386
309 LFLAGS = $(COMMLFLAGS)
310 LIBEXT = lib
311 OBJTAIL = obj
312
313 endif # platform: PC
314 endif # target: nucleus OS
315
316 #----------------------------------- Special settings for each target
317 #----------Win32
318 ifeq ($(TARGET), win32)
319 LIBDIR=../LIB/WIN32$(DEBUGDIR)
320 CCD_IMPORTLIB=$(LIBDIR)/ccd.lib
321
322 CC=cl
323 COPTS += /c /nologo /W3 /GX /Zp1
324
325 ifeq ($(DEBUG), 1)
326 COPTS += /MDd /Z7
327 else
328 COPTS += /MD
329 endif
330
331 COPTS += /Fo./$(OBJDIR)/
332 INCLUDES = -I"." -I"../inc" -I"../inc/vcms" -I"../inc/vcms/win32"
333 DEFINES += -D"M_INTEL" -D"_TOOLS_" -D"CCDDATA_LOAD"\
334 -D"WIN32" -D"TARGET_WIN32" -D"CCD_SYMBOLS" -D"CCD_MK"
335
336 DEFINES += -D"SHARED_VSI" -D"SHARED_CCD"\
337 -D"NEW_ENTITY" -D"DYNAMIC_ARRAYS" -D"ERR_TRACE_CCD"
338 DEFINES += -D"ERR_TRC_STK_CCD" -D"DEBUG_CCD"
339
340 COPTSNF = $(COPTS) $(DEFINES) $(INCLUDES)
341 INCLUDELIST=$(INCLUDES)
342 DEFINELIST=$(DEFINES)
343 COMMLFLAGS += /nologo /subsystem:console /machine:I386
344
345 LFLAGS = $(COMMLFLAGS)
346 MKLIB = lib.exe /out:$@ $(LFLAGS)
347 LIBEXT = lib
348 OBJTAIL = obj
349 CCD_LIB = $(LIBDIR)/ccd.$(LIBEXT)
350
351 endif # target: win32
352
353 ifeq ($(OSENV), sus)
354 COPTS += -c -o $(OBJDIR)/$@
355 ifeq ($(DEBUG), 1)
356 COPTS += -g
357 endif
358 ifeq ($(TRACE), 1)
359 DEFINES += -DDEBUG_CCD -DERR_TRC_STK_CCD
360 endif
361 ifeq ($(MEMSUPER), 1)
362 DEFINES += -DMEMORY_SUPERVISION
363 endif
364
365 INCLUDES = -I. -I../inc -I../inc/$(OSENV)
366 DEFINES += -DSHARED_VSI -DSHARED_CCD\
367 -DCCDDATA_STATIC_DATA -DDYNAMIC_ARRAYS\
368 -DNEW_ENTITY \
369 -DERR_TRACE_CCD
370 ifeq ($(BYTESEX), motorola)
371 DEFINES += -DM_MOTOROLA
372 else
373 DEFINES += -DM_INTEL
374 endif
375 ifeq ($(TARGET), rtlpc)
376 COPTSNF = $(CFLAGS)
377 MKLIB= i386-linux-ar ruv $@
378 RANLIB= i386-linux-ranlib
379 DEFINES += -D_RT_LINUX_ -DCCD_SYMBOLS
380 else
381 ifeq ($(TARGET), linuxarm)
382 CC=arm-linux-gcc
383 MKLIB= arm-linux-ar ruv $@
384 RANLIB= arm-linux-ranlib
385 DEFINES += -DGSP_TARGET -DCCD_SYMBOLS
386 else
387 ifeq ($(TARGET), solsparc)
388 CC=gcc
389 MKLIB= ar ruv $@
390 RANLIB= ranlib
391 DEFINES += -DCCD_SYMBOLS
392 else
393 CC=gcc
394 MKLIB= ar ruv $@
395 RANLIB= ranlib
396 DEFINES += -DCCD_SYMBOLS
397 endif
398 endif
399 endif
400 COPTSNF += $(COPTS) $(DEFINES) $(INCLUDES)
401
402 LIBEXT = a
403 OBJTAIL = o
404 CCD_LIB = $(LIBDIR)/libccd$(XXX).$(LIBEXT)
405 endif
406
407 ######################### Rules and targets ##########################
408 .PHONY: all clean
409
410 all: $(OBJDIR) $(CCD_LIB)
411
412 CCD_OBJS=$(patsubst %.$(OBJTAIL),$(OBJDIR)/%.$(OBJTAIL),$(_CCD_OBJS))
413 LNTFILES=$(patsubst %.$(OBJTAIL),%.lto,$(_CCD_OBJS))
414
415 objdir $(OBJDIR):
416 @echo Creating object directory "$(OBJDIR)"
417 $(MKDIR) -p $(OBJDIR)
418
419 $(_CCD_OBJS) : %.$(OBJTAIL) : $(CCD_SRC)/%.c
420 $(CC) $(COPTSNF) $<
421
422 $(CCD_LIB) : $(_CCD_OBJS) makefile $(CCD_DEF)
423 $(MKLIB) $(CCD_OBJS)
424 ifeq ($(OSENV), sus)
425 $(RANLIB) $@
426 endif
427
428 colibs:
429 $(CHECKOUT) $(CO_LIBS)
430
431 cilibs:
432 $(CHECKIN) $(CO_LIBS)
433
434 help:
435 $(ECHO) usage...
436 $(ECHO) building:
437 $(ECHO) "gnumake TARGET={nuc|win32|vxworks|psos}\
438 [PLATFORM={arm7|arm|pc}] [CPU=PPC603] [DEBUG={1|0}]\
439 [TRACE={1|0}] [THUMB_MODE=1] [MEMSUPER={0|1} ..."
440 $(ECHO) cleaning:
441 $(ECHO) "gnumake clean TARGET={nuc|win32|vxworks|psos}\
442 [PLATFORM={arm7|arm|pc}] [CPU=PPC603] [DEBUG={1|0}]\
443 [TRACE={1|0}] [THUMB_MODE=1] [MEMSUPER={0|1} ..."
444
445 SRCFILES=$(patsubst %.$(OBJTAIL),%.c,$(_CCD_OBJS))
446 CCD_DEP=dep_ccd$(XXX).mk
447
448 clean:
449 $(RM) $(CCD_OBJS) $(CCD_LIB)
450
451 depend: $(SRCFILES)
452 @touch $(CCD_DEP)
453 makedepend -b -f$(CCD_DEP) $^ -Y -o.$(OBJTAIL) $(INCLUDELIST)\
454 $(DEFINELIST)
455 $(RM) $(CCD_DEP).bak
456
457 include ccd_lnt.mk
458 -include $(CCD_DEP)