1 | #define XCOMM # |
---|
2 | #define _POUND_ # |
---|
3 | _POUND_ $Id: imake.tmpl,v 1.113.2.2 2006/10/06 22:33:17 yuri Exp $ |
---|
4 | _POUND_================================================== |
---|
5 | _POUND_ Copyright IBM 1993 |
---|
6 | _POUND_================================================== |
---|
7 | |
---|
8 | _POUND_################################################## |
---|
9 | _POUND_ This makefile is automatically generated by |
---|
10 | _POUND_ imake... do not modify or you may lose your |
---|
11 | _POUND_ changes when imake generates makefiles again. |
---|
12 | _POUND_ Ignore this message if you are not using imake. |
---|
13 | _POUND_################################################## |
---|
14 | |
---|
15 | /* On Linux, the imake that comes with X11 defines "linux" to be "1". |
---|
16 | This causes problems because the word "linux" appears in several |
---|
17 | directory names (e.g., /usr/include/linux, ts/kernext/gpl-linux). |
---|
18 | If "linux" is defined, undefine it and define "LINUX_IMAKE" instead. */ |
---|
19 | #ifdef linux |
---|
20 | #undef linux |
---|
21 | #define LINUX_IMAKE 1 |
---|
22 | #endif |
---|
23 | |
---|
24 | RESOLVLIB = |
---|
25 | |
---|
26 | DESTDIR = $(SHARKCLONEROOT) |
---|
27 | TOOLDIR = /local/bin |
---|
28 | SHELL = /bin/sh |
---|
29 | CSHELL = /bin/csh |
---|
30 | |
---|
31 | #ifdef LINUX_IMAKE |
---|
32 | IMAKE = /usr/X11R6/bin/imake |
---|
33 | CC=g++ |
---|
34 | C_COMP=gcc |
---|
35 | /* CC = egcs */ |
---|
36 | /* C_COMP = egcs */ |
---|
37 | INSTALL = /usr/bin/install |
---|
38 | AR = ar clq |
---|
39 | BARELD = ld |
---|
40 | KAR = ld $(LDFLAGS2) -r -o |
---|
41 | ARDEL = ar d |
---|
42 | MAKEDEPEND = g++ |
---|
43 | CPLUSINC = |
---|
44 | #else /* LINUX_IMAKE */ |
---|
45 | IMAKE = $(TOOLDIR)/imake |
---|
46 | CC = xlC_r |
---|
47 | C_COMP = cc_r |
---|
48 | INSTALL = /usr/ucb/install |
---|
49 | AR = ar -clq |
---|
50 | KAR = $(AR) |
---|
51 | ARDEL = ar -d |
---|
52 | MAKEDEPEND = xlC_r |
---|
53 | CPLUSINC = -I/usr/lpp/xlC/include |
---|
54 | #endif |
---|
55 | |
---|
56 | LD = $(CC) |
---|
57 | CDEBUGFLAGS = |
---|
58 | |
---|
59 | NATIVE_CC=$(CC) |
---|
60 | NATIVE_C_COMP=$(C_COMP) |
---|
61 | NATIVE_LD=$(NATIVE_CC) |
---|
62 | |
---|
63 | /* Default flags for supplemental patches that must be applied to select |
---|
64 | portions of the code, which are not part of the standard kernel patching. |
---|
65 | These flags can be modified in individual Imakefiles if multiple |
---|
66 | supplemental patches are required (by setting flags *before* ObjectRule). */ |
---|
67 | PATCHED_KERNEL_FLAGS = |
---|
68 | |
---|
69 | /* Default location for cxi header files */ |
---|
70 | CXI_HEADER_DIR = $(DESTDIR)/include |
---|
71 | #ifdef LINUX_IMAKE |
---|
72 | /* For Linux we want cxi headers separated from proprietary headers */ |
---|
73 | CXI_HEADER_DIR = $(DESTDIR)/include/cxi |
---|
74 | #endif /* LINUX_IMAKE */ |
---|
75 | |
---|
76 | SOURCE_CONTROL = cvs |
---|
77 | SRC_UPDATE_CMD = $(SOURCE_CONTROL) update -d |
---|
78 | SRC_CHECKIN_CMD = $(SOURCE_CONTROL) ci -a |
---|
79 | |
---|
80 | DEPENDSCRIPT = $(DESTDIR)/bin/depend.sh |
---|
81 | PATCHSCRIPT = $(DESTDIR)/bin/applypatch.sh |
---|
82 | IMAKE_DEFINES = |
---|
83 | |
---|
84 | |
---|
85 | IRULESRC = $(DESTDIR)/shark/config |
---|
86 | |
---|
87 | NIDLFLAGS = -exts C.c,S.c,W.c |
---|
88 | NIDLINCLUDES = $(LOCALNIDLINCLUDES) |
---|
89 | |
---|
90 | LINTOPTS = -axz |
---|
91 | LINTLIBFLAG = -C |
---|
92 | |
---|
93 | #ifdef LINUX_IMAKE |
---|
94 | STD_CFLAGS = |
---|
95 | STD_LDFLAGS = |
---|
96 | STD_INCLUDES = -I$(DESTDIR)/include -I$(CXI_HEADER_DIR) |
---|
97 | ARFLAGS = |
---|
98 | KARFLAGS = |
---|
99 | STD_LDFLAGS = $(EXTRASTD_LDFLAGS) |
---|
100 | LDFLAGS2 = $(EXTRALDFLAGS2) |
---|
101 | #else |
---|
102 | STD_CFLAGS = -qtbtable=full -qinfo=gen:ret:uni:ini $(EXTRASTD_CFLAGS) |
---|
103 | STD_LDFLAGS = -qtwolink $(EXTRASTD_LDFLAGS) |
---|
104 | STD_INCLUDES = -I$(DESTDIR)/include -I$(CXI_HEADER_DIR) |
---|
105 | LDFLAGS2 = $(EXTRALDFLAGS2) |
---|
106 | ARFLAGS = $(EXTRAARFLAGS) |
---|
107 | KARFLAGS = $(EXTRAARFLAGS) |
---|
108 | M4FLAGS = $(EXTRAM4FLAGS) |
---|
109 | ASFLAGS = $(EXTRAASFLAGS) |
---|
110 | CFLAGS32 = -q32 |
---|
111 | CFLAGS64 = -q64 -qlargetype |
---|
112 | #endif |
---|
113 | STD_KINCLUDES = $(STD_INCLUDES) |
---|
114 | |
---|
115 | AS = as |
---|
116 | CPP = /lib/cpp |
---|
117 | LINT = lint |
---|
118 | RM = rm -f |
---|
119 | MV = mv |
---|
120 | CP = cp |
---|
121 | LN = ln -s |
---|
122 | RANLIB = ranlib |
---|
123 | RPM = rpm |
---|
124 | RPMBUILD = /usr/bin/rpmbuild |
---|
125 | |
---|
126 | LS = ls |
---|
127 | AWK = awk |
---|
128 | SORT = sort |
---|
129 | TR = tr |
---|
130 | MAKE = /usr/bin/make |
---|
131 | MAKEDASH = - |
---|
132 | /* Override above to empty for gnumake */ |
---|
133 | SED = sed |
---|
134 | LEX = lex |
---|
135 | YACC = yacc |
---|
136 | BISON = bison |
---|
137 | NIDL = /etc/ncs/nidl $(NIDLFLAGS) |
---|
138 | |
---|
139 | MKTRACE = $(DESTDIR)/bin/mktrace |
---|
140 | MERGETRC = $(DESTDIR)/bin/mergetrc |
---|
141 | MKTRCFMT = $(DESTDIR)/bin/mktrcfmt |
---|
142 | MKRPC = $(DESTDIR)/bin/mkrpc |
---|
143 | CHKSYSTYPES = $(SHARKCLONEROOT)/../tools/chksystypes |
---|
144 | |
---|
145 | _POUND_ Ship values |
---|
146 | |
---|
147 | LPP_NAME=mmfs |
---|
148 | LOCAL_PROD_NAME = mmfs |
---|
149 | SHIP_TYPE = FILE |
---|
150 | SHIP_OWNER = bin |
---|
151 | SHIP_GROUP = system |
---|
152 | SHIP_CLASS = apply |
---|
153 | SHIP_ROOT = $(SHARKCLONEROOT)/ship |
---|
154 | SHIPDIR = $(SHIP_ROOT)/usr/lpp/$(LPP_NAME) |
---|
155 | SHIP_CMD = /usr/ucb/install -c |
---|
156 | |
---|
157 | _POUND_################################################## |
---|
158 | _POUND_ The following comes from the site.mcr |
---|
159 | _POUND_################################################## |
---|
160 | #include <site.mcr> |
---|
161 | _POUND_################################################## |
---|
162 | _POUND_ Back from site.mcr |
---|
163 | _POUND_################################################## |
---|
164 | |
---|
165 | .SUFFIXES: .o .32o .64o .C .c .s .spp .y .l .idl .sh .ko .spec .po .pko .rpc |
---|
166 | ALL_INCLUDES = -I. $(IMAKE_INCLUDES) $(STD_INCLUDES) |
---|
167 | ALL_KINCLUDES = -I. $(IMAKE_INCLUDES) $(STD_KINCLUDES) |
---|
168 | ALL_LIBPATHS = -L. $(IMAKE_LIBS) |
---|
169 | IMAKE_CMD = $(IMAKE) -Timake.tmpl -I. -I$(IRULESRC) -s makefile |
---|
170 | DOTDOTIMAKE_CMD = $(IMAKE) -Timake.tmpl -I. -I$(IRULESRC) -s makefile |
---|
171 | |
---|
172 | ALL_DEFINES = $(IMAKE_DEFINES) $(SITE_DEFINES) $(SITE_FAR_TRACE_OPTS) $(IMAKE_DEFINES_LAST) |
---|
173 | ALL_KDEFINES = $(IMAKE_DEFINES) $(SITE_DEFINES) $(SITE_OTHER_KDEFINES) $(SITE_KFAR_TRACE_OPTS) |
---|
174 | CFLAGS = $(OPTFLAGS) $(STD_CFLAGS) $(IMAKE_CFLAGS) $(CDEBUGFLAGS) $(ALL_INCLUDES) $(ALL_DEFINES) |
---|
175 | NATIVECFLAGS = -O $(STD_CFLAGS) $(IMAKE_CFLAGS) $(CDEBUGFLAGS) $(ALL_INCLUDES) $(ALL_DEFINES) |
---|
176 | KCFLAGS = $(KOPTFLAGS) $(STD_CFLAGS) $(IMAKE_CFLAGS) $(CDEBUGFLAGS) $(ALL_KINCLUDES) $(ALL_KDEFINES) |
---|
177 | TESTING_CFLAGS = -DTESTINGONLYTESTING $(CFLAGS) |
---|
178 | |
---|
179 | /* ***************************************************************** *\ |
---|
180 | * shark.rls - macro (rules) for Imakefiles |
---|
181 | \* ***************************************************************** */ |
---|
182 | |
---|
183 | /* ***************************************************************** *\ |
---|
184 | * Standard Compilation Rules |
---|
185 | \* ***************************************************************** */ |
---|
186 | |
---|
187 | /*************************************************** |
---|
188 | * Export: |
---|
189 | * AppendFiles() |
---|
190 | * CleanTarget() |
---|
191 | * CppAndFilter() |
---|
192 | * DependTarget() |
---|
193 | * SharedObjectTarget() |
---|
194 | * LibraryTarget() |
---|
195 | * MkdirTarget() |
---|
196 | * NormalAsmPPRule() |
---|
197 | * NormalAsmRule() |
---|
198 | * NormalLexRule() |
---|
199 | * NativeObjectRule() |
---|
200 | * NormalObjectRule() |
---|
201 | * SharedObjectRule(shflags) |
---|
202 | * NormalYaccRule() |
---|
203 | * NidlTarget() |
---|
204 | * NativeProgramTarget() |
---|
205 | * ProgramTarget() |
---|
206 | * CProgramTarget() |
---|
207 | * TestProgramTarget() |
---|
208 | * TestingOnlyTestingRule() |
---|
209 | * MsgTarget() |
---|
210 | ***************************************************/ |
---|
211 | |
---|
212 | /* Linux hack to reset header include search paths for portability layer so |
---|
213 | that we only try to include portability and cxi header files from GPFS */ |
---|
214 | #ifdef GPFS_LINUX |
---|
215 | GPL_HEADER_DIR = $(DESTDIR)/include/gpl-linux |
---|
216 | GPL_LIB_DIR = $(DESTDIR)/lib/gpl-linux |
---|
217 | |
---|
218 | #define SetGplIncludePath() @@\ |
---|
219 | STD_KINCLUDES = -I$(CXI_HEADER_DIR) -I$(GPL_HEADER_DIR) -I$(KERNEL_HEADER_DIR) |
---|
220 | |
---|
221 | /* Try to catch dumb mistakes in building portability layer. Skip the check |
---|
222 | if LINUX_SKIP_DIST_CHECK is defined. */ |
---|
223 | #define CheckLinuxDistribution() |
---|
224 | #ifndef LINUX_SKIP_DIST_CHECK |
---|
225 | Headers:: @@\ |
---|
226 | @if [ "$(LINUX_DISTRIBUTION)" = "REDHAT_LINUX" ]; then \ @@\ |
---|
227 | if [ ! -f /etc/redhat-release ]; then \ @@\ |
---|
228 | echo "Error: the current Linux environment does not agree with the setting, LINUX_DISTRIBUTION = $(LINUX_DISTRIBUTION), specified in site.mcr!"; exit 1; \ @@\ |
---|
229 | else \ @@\ |
---|
230 | rhreltype=`awk '/Enterprise/ {print "Enterprise"}' /etc/redhat-release`; \ @@\ |
---|
231 | if [ "$$rhreltype" = "Enterprise" ]; then \ @@\ |
---|
232 | echo "Error: the current Linux environment appears to be RedHat Enterprise Linux, which requires setting LINUX_DISTRIBUTION = REDHAT_AS_LINUX in site.mcr!"; exit 1; \ @@\ |
---|
233 | fi; \ @@\ |
---|
234 | fi; \ @@\ |
---|
235 | elif [ "$(LINUX_DISTRIBUTION)" = "REDHAT_AS_LINUX" ]; then \ @@\ |
---|
236 | if [ ! -f /etc/redhat-release ]; then \ @@\ |
---|
237 | echo "Error: the current Linux environment does not agree with the setting, LINUX_DISTRIBUTION = $(LINUX_DISTRIBUTION), specified in site.mcr!"; exit 1; \ @@\ |
---|
238 | else \ @@\ |
---|
239 | rhreltype=`awk '/Enterprise/ {print "Enterprise"}' /etc/redhat-release`; \ @@\ |
---|
240 | if [ "$$rhreltype" != "Enterprise" ]; then \ @@\ |
---|
241 | echo "Error: the current Linux environment appears to be RedHat Linux (not Enterprise Linux [AS|ES|WS] version), which requires setting LINUX_DISTRIBUTION = REDHAT_LINUX in site.mcr!"; exit 1; \ @@\ |
---|
242 | fi; \ @@\ |
---|
243 | fi; \ @@\ |
---|
244 | elif [ "$(LINUX_DISTRIBUTION)" = "SUSE_LINUX" ]; then \ @@\ |
---|
245 | if [ ! -f /etc/SuSE-release ]; then \ @@\ |
---|
246 | echo "Error: the current Linux environment does not agree with the setting, LINUX_DISTRIBUTION = $(LINUX_DISTRIBUTION), specified in site.mcr!"; exit 1; \ @@\ |
---|
247 | fi; \ @@\ |
---|
248 | elif [ "$(LINUX_DISTRIBUTION)" = "KERNEL_ORG_LINUX" ]; then \ @@\ |
---|
249 | echo "This is OK" > /dev/null; \ @@\ |
---|
250 | else \ @@\ |
---|
251 | echo "Error: LINUX_DISTRIBUTION = '$(LINUX_DISTRIBUTION)' is not a valid choice in site.mcr!"; exit 1; \ @@\ |
---|
252 | fi; |
---|
253 | #endif /* LINUX_SKIP_DIST_CHECK */ |
---|
254 | #endif /* GPFS_LINUX */ |
---|
255 | |
---|
256 | #define NativeObjectRule() @@\ |
---|
257 | .C.o: @@\ |
---|
258 | $(RM) $@ @@\ |
---|
259 | $(NATIVE_CC) -c $(NATIVECFLAGS) $*.C @@\ |
---|
260 | .c.o: @@\ |
---|
261 | $(RM) $@ @@\ |
---|
262 | $(NATIVE_C_COMP) -c $(NATIVECFLAGS) $*.c |
---|
263 | |
---|
264 | #define LinuxKernelObjectRule() @@\ |
---|
265 | .c.ko: @@\ |
---|
266 | $(RM) $@ @@\ |
---|
267 | $(C_COMP) -o $@ -c $(KCFLAGS) $*.c |
---|
268 | |
---|
269 | #define NormalObjectRule() @@\ |
---|
270 | .C.o: @@\ |
---|
271 | $(RM) $@ @@\ |
---|
272 | $(CC) -c $(CFLAGS) $*.C @@\ |
---|
273 | .C.32o: @@\ |
---|
274 | $(RM) $@ @@\ |
---|
275 | $(CC) -c $(CFLAGS) $(CFLAGS32) $*.C -o $*.32o @@\ |
---|
276 | .C.64o: @@\ |
---|
277 | $(RM) $@ @@\ |
---|
278 | $(CC) -c $(CFLAGS) $(CFLAGS64) $*.C -o $*.64o @@\ |
---|
279 | .c.o: @@\ |
---|
280 | $(RM) $@ @@\ |
---|
281 | $(C_COMP) -c $(CFLAGS) $*.c @@\ |
---|
282 | .c.32o: @@\ |
---|
283 | $(RM) $@ @@\ |
---|
284 | $(C_COMP) -c $(CFLAGS) $(CFLAGS32) $*.c -o $*.32o @@\ |
---|
285 | .c.64o: @@\ |
---|
286 | $(RM) $@ @@\ |
---|
287 | $(C_COMP) -c $(CFLAGS) $(CFLAGS64) $*.c -o $*.64o @@\ |
---|
288 | LinuxKernelObjectRule() @@\ |
---|
289 | .C.ko: @@\ |
---|
290 | $(RM) $@ @@\ |
---|
291 | $(CC) -o $@ -c $(KCFLAGS) $*.C @@\ |
---|
292 | .S.o: @@\ |
---|
293 | $(RM) $@ @@\ |
---|
294 | $(CC) -o $@ -c $(CFLAGS) $*.S @@\ |
---|
295 | .S.ko: @@\ |
---|
296 | $(RM) $@ @@\ |
---|
297 | $(CC) -o $@ -c $(KCFLAGS) $*.S @@\ |
---|
298 | .c.pko: @@\ |
---|
299 | $(RM) $@ @@\ |
---|
300 | $(C_COMP) -o $@ -c $(PATCHED_KERNEL_FLAGS) $(KCFLAGS) $*.c @@\ |
---|
301 | .C.pko: @@\ |
---|
302 | $(RM) $@ @@\ |
---|
303 | $(CC) -o $@ -c $(PATCHED_KERNEL_FLAGS) $(KCFLAGS) $*.C @@\ |
---|
304 | .rpc.h: @@\ |
---|
305 | $(MKRPC) $*.rpc |
---|
306 | |
---|
307 | |
---|
308 | #define SharedObjectRule(shflags) @@\ |
---|
309 | .C.o: @@\ |
---|
310 | $(RM) $@ @@\ |
---|
311 | $(CC) -c $(CFLAGS) shflags $*.C @@\ |
---|
312 | .c.o: @@\ |
---|
313 | $(RM) $@ @@\ |
---|
314 | $(C_COMP) -c $(CFLAGS) shflags $*.c @@\ |
---|
315 | .c.ko: @@\ |
---|
316 | $(RM) $@ @@\ |
---|
317 | $(C_COMP) -o $@ -c $(KCFLAGS) shflags $*.c @@\ |
---|
318 | .C.ko: @@\ |
---|
319 | $(RM) $@ @@\ |
---|
320 | $(CC) -o $@ -c $(KCFLAGS) shflags $*.C @@\ |
---|
321 | .S.o: @@\ |
---|
322 | $(RM) $@ @@\ |
---|
323 | $(CC) -o $@ -c $(CFLAGS) shflags $*.S @@\ |
---|
324 | .S.ko: @@\ |
---|
325 | $(RM) $@ @@\ |
---|
326 | $(CC) -o $@ -c $(KCFLAGS) shflags $*.S |
---|
327 | |
---|
328 | #define NormalYaccRule() @@\ |
---|
329 | .y.o: @@\ |
---|
330 | $(YACC) $(YFLAGS) $< @@\ |
---|
331 | $(MV) y.tab.c $*.c @@\ |
---|
332 | $(NATIVE_C_COMP) -c ${NATIVECFLAGS} $*.c @@\ |
---|
333 | $(RM) $*.c @@\ |
---|
334 | [ -f y.tab.h ] && $(MV) -f y.tab.h $*.h |
---|
335 | |
---|
336 | |
---|
337 | #define NormalAsmPPRule() @@\ |
---|
338 | .spp.o: @@\ |
---|
339 | $(RM) $@ ,$*.s ,$*.c @@\ |
---|
340 | $(CP) $*.spp ,$*.c @@\ |
---|
341 | $(C_COMP) -E $(CFLAGS) ,$*.c > ,$*.s @@\ |
---|
342 | $(AS) -o $*.o ,$*.s @@\ |
---|
343 | $(RM) ,$*.c ,$*.s |
---|
344 | |
---|
345 | |
---|
346 | #define NormalLexRule() @@\ |
---|
347 | .l.o: @@\ |
---|
348 | $(LEX) $*.l @@\ |
---|
349 | $(RM) $*.c @@\ |
---|
350 | $(MV) lex.yy.c $*.c @@\ |
---|
351 | $(C_COMP) -c $(CFLAGS) $*.c @@\ |
---|
352 | $(RM) $*.c |
---|
353 | |
---|
354 | |
---|
355 | #define NormalAsmRule() @@\ |
---|
356 | .s.o: @@\ |
---|
357 | $(RM) $@ @@\ |
---|
358 | $(AS) -o $*.o $*.s |
---|
359 | |
---|
360 | #define SharkAsmRule() @@\ |
---|
361 | .s.o: @@\ |
---|
362 | $(RM) $@ @@\ |
---|
363 | m4 $(M4FLAGS) $(ALL_DEFINES) -I/usr/include /usr/include/sys/asdef.s $*.s | as $(ASFLAGS) -o $*.o |
---|
364 | |
---|
365 | #define ShellScriptRule(File) @@\ |
---|
366 | .sh: @@\ |
---|
367 | cp $< $@; chmod 0777 $@ |
---|
368 | |
---|
369 | #define RpmRule(rpmfile, specfile, imagetree, rpmflags) @@\ |
---|
370 | rpm:: rpmfile @@\ |
---|
371 | rpmfile: specfile @@\ |
---|
372 | $(RM) rpmfile @@\ |
---|
373 | if [ -e imagetree ]; then \ @@\ |
---|
374 | $(RM) -r imagetree; \ @@\ |
---|
375 | fi; @@\ |
---|
376 | [ -e $(RPMBUILD) ] && rpmbuild=$(RPMBUILD) || rpmbuild=rpm; \@@\ |
---|
377 | $$rpmbuild -ba rpmflags --buildroot imagetree specfile |
---|
378 | |
---|
379 | #define CppAndFilter(file, lyfile, incfiles, filter) @@\ |
---|
380 | file: lyfile incfiles @@\ |
---|
381 | $(RM) file @@\ |
---|
382 | $(CPP) lyfile | filter > file |
---|
383 | |
---|
384 | #define AppendFiles(target, sources) @@\ |
---|
385 | target: sources @@\ |
---|
386 | $(RM) target @@\ |
---|
387 | cat sources > target |
---|
388 | |
---|
389 | #define TestingOnlyTestingRule(libs, syslibs) @@\ |
---|
390 | .SUFFIXES: .test @@\ |
---|
391 | .c.test: @@\ |
---|
392 | $(RM) $@ @@\ |
---|
393 | $(C_COMP) $(TESTING_CFLAGS) -o $*.test $*.c libs syslibs @@\ |
---|
394 | $(RM) $*.o @@\ |
---|
395 | clean:: ; $(RM) *.test |
---|
396 | |
---|
397 | #define LibraryTarget(library, objs) @@\ |
---|
398 | libs:: library @@\ |
---|
399 | library: objs @@\ |
---|
400 | $(RM) $@ @@\ |
---|
401 | $(AR) $(ARFLAGS) $@ objs |
---|
402 | |
---|
403 | #define kLibraryTarget(library, objs) @@\ |
---|
404 | libs:: library @@\ |
---|
405 | library: objs @@\ |
---|
406 | $(RM) $@ @@\ |
---|
407 | $(KAR) $(KARFLAGS) $@ objs |
---|
408 | |
---|
409 | #ifndef GPFS_LINUX |
---|
410 | #define SharedObjectTarget(shared, objs, imps, exps, other) @@\ |
---|
411 | shared: objs imps exps @@\ |
---|
412 | $(RM) $@ @@\ |
---|
413 | @ IMPS= ; EXPS= ; COL=\: ; \ @@\ |
---|
414 | for i in imps ; \ @@\ |
---|
415 | do IMPS="$${IMPS} -bI$${COL}$${i}" ; \ @@\ |
---|
416 | done; \ @@\ |
---|
417 | for i in exps ; \ @@\ |
---|
418 | do EXPS="$${EXPS} -bE$${COL}$${i}" ; \ @@\ |
---|
419 | done; \ @@\ |
---|
420 | echo " ld -o $@ objs $(LDFLAGS2) -bnoentry -bM\:SRE $${IMPS} $${EXPS} other" ; \ @@\ |
---|
421 | ld -o $@ objs $(LDFLAGS2) -bnoentry -bM\:SRE $${IMPS} $${EXPS} other |
---|
422 | #else /* GPFS_LINUX */ |
---|
423 | #define SharedObjectTarget(shared_obj, objs, other) @@\ |
---|
424 | libs:: shared_obj @@\ |
---|
425 | shared_obj: objs @@\ |
---|
426 | $(RM) $@ @@\ |
---|
427 | echo " $(BARELD) $(LDFLAGS2) -o $@ objs --shared other" ; \ @@\ |
---|
428 | $(BARELD) $(LDFLAGS2) -o $@ objs --shared other |
---|
429 | #endif /* GPFS_LINUX */ |
---|
430 | |
---|
431 | |
---|
432 | #define TestProgramTarget(program, objs, libs, syslibs) @@\ |
---|
433 | test:: program @@\ |
---|
434 | program: objs libs @@\ |
---|
435 | $(RM) $@ @@\ |
---|
436 | $(LD) -o $@ objs libs $(STD_LDFLAGS) $(IMAKE_LDFLAGS) $(ALL_LIBPATHS) syslibs @@\ |
---|
437 | cleanTest:: ; $(RM) program objs @@\ |
---|
438 | clean:: ; $(RM) program |
---|
439 | |
---|
440 | #ifndef GPFS_LINUX |
---|
441 | #define MsgTarget(basename) @@\ |
---|
442 | headers:: basename/**/_msg.h @@\ |
---|
443 | basename/**/_msg.h: basename.msg @@\ |
---|
444 | $(RM) basename/**/_msg.h @@\ |
---|
445 | mkcatdefs basename basename.msg | gencat $(DESTDIR)/mmfs.cat @@\ |
---|
446 | clean:: ; $(RM) basename/**/_msg.h |
---|
447 | #else |
---|
448 | #define MsgTarget(basename) @@\ |
---|
449 | headers:: basename/**/_msg.h @@\ |
---|
450 | basename/**/_msg.h: basename.msg @@\ |
---|
451 | $(RM) basename/**/_msg.h @@\ |
---|
452 | gencat -H basename/**/_tmp.h -o $(DESTDIR)/mmfs.cat basename/**/.msg @@\ |
---|
453 | sed "s/AutomaticSet[0-9]*/ /" basename/**/_tmp.h > basename/**/_msg.h @@\ |
---|
454 | $(RM) basename/**/_tmp.h @@\ |
---|
455 | clean:: ; $(RM) basename/**/_msg.h |
---|
456 | #endif |
---|
457 | |
---|
458 | #define ShellMsgTarget(basename) @@\ |
---|
459 | headers:: basename/**/_msg.h @@\ |
---|
460 | basename/**/_msg.h:: basename.msg @@\ |
---|
461 | $(RM) basename/**/_msg.h @@\ |
---|
462 | mkcatdefs basename basename.msg -h | gencat $(DESTDIR)/mmfs.cat @@\ |
---|
463 | basename/**/_msg.h:: basename.msg @@\ |
---|
464 | touch basename/**/_msg.h @@\ |
---|
465 | clean:: ; $(RM) basename/**/_msg.h |
---|
466 | |
---|
467 | #define TraceTarget(basename,files) @@\ |
---|
468 | trcid: files @@\ |
---|
469 | $(MKTRACE) -hm files @@\ |
---|
470 | trclst:: basename.trclst @@\ |
---|
471 | basename.trclst: files trcid.h @@\ |
---|
472 | $(RM) basename.trclst @@\ |
---|
473 | $(MKTRACE) -l basename.trclst files @@\ |
---|
474 | clean:: ; $(RM) basename.trclst |
---|
475 | |
---|
476 | #define RpcTarget(target) @@\ |
---|
477 | target.h: target.rpc |
---|
478 | |
---|
479 | #define NidlTarget(basename) @@\ |
---|
480 | libs:: basename.h @@\ |
---|
481 | depend:: basename.h @@\ |
---|
482 | basename.h: basename.idl @@\ |
---|
483 | $(NIDL) basename.idl $(NIDLINCLUDES) -no_cpp @@\ |
---|
484 | clean:: @@\ |
---|
485 | $(RM) basename.h @@\ |
---|
486 | @(for i in basename; do \ @@\ |
---|
487 | echo " "$(RM) $${i}C.c $${i}S.c $${i}W.c; \ @@\ |
---|
488 | $(RM) $${i}C.c $${i}S.c $${i}W.c; \ @@\ |
---|
489 | done) |
---|
490 | |
---|
491 | |
---|
492 | #define NativeProgramTarget(program, objs, libs, syslibs) @@\ |
---|
493 | all:: program @@\ |
---|
494 | program: objs libs @@\ |
---|
495 | $(RM) $@ @@\ |
---|
496 | $(NATIVE_LD) -o $@ objs libs $(STD_LDFLAGS) $(IMAKE_LDFLAGS) $(ALL_LIBPATHS) syslibs @@\ |
---|
497 | clean:: ; $(RM) program |
---|
498 | |
---|
499 | #define ProgramTarget(program, objs, libs, syslibs) @@\ |
---|
500 | all:: program @@\ |
---|
501 | program: objs libs @@\ |
---|
502 | $(RM) $@ @@\ |
---|
503 | $(LD) -o $@ objs libs $(STD_LDFLAGS) $(IMAKE_LDFLAGS) $(ALL_LIBPATHS) syslibs @@\ |
---|
504 | clean:: ; $(RM) program |
---|
505 | |
---|
506 | #define CProgramTarget(program, objs, libs, syslibs) @@\ |
---|
507 | all:: program @@\ |
---|
508 | program: objs libs @@\ |
---|
509 | $(RM) $@ @@\ |
---|
510 | $(C_COMP) -o $@ objs libs $(STD_LDFLAGS) $(IMAKE_LDFLAGS) $(ALL_LIBPATHS) syslibs @@\ |
---|
511 | clean:: ; $(RM) program |
---|
512 | |
---|
513 | #define CTestProgramTarget(program, objs, libs, syslibs) @@\ |
---|
514 | test:: program @@\ |
---|
515 | program: objs libs @@\ |
---|
516 | $(RM) $@ @@\ |
---|
517 | $(C_COMP) -o $@ objs libs $(STD_LDFLAGS) $(IMAKE_LDFLAGS) $(ALL_LIBPATHS) syslibs @@\ |
---|
518 | clean:: ; $(RM) program |
---|
519 | |
---|
520 | #define CleanTarget(files) @@\ |
---|
521 | clean:: ; $(RM) files |
---|
522 | |
---|
523 | #define MkdirTarget(dirs) @@\ |
---|
524 | install.ti:: makedirs @@\ |
---|
525 | @echo '\c' @@\ |
---|
526 | install.he:: makedirs @@\ |
---|
527 | @echo '\c' @@\ |
---|
528 | makedirs:: @@\ |
---|
529 | @echo "Checking Destination Directories...." @@\ |
---|
530 | @sh -c 'for i in dirs; do \ @@\ |
---|
531 | if [ -f $$i ]; then \ @@\ |
---|
532 | echo "Mkdir: $$i is a FILE"; \ @@\ |
---|
533 | exit 1; \ @@\ |
---|
534 | elif [ ! -d $$i ]; then \ @@\ |
---|
535 | echo "Making directory $$i"; \ @@\ |
---|
536 | mkdir -p $$i; \ @@\ |
---|
537 | fi; \ @@\ |
---|
538 | done; \ @@\ |
---|
539 | exit 0' |
---|
540 | |
---|
541 | #define DependTarget(dependencies) @@\ |
---|
542 | depend:: dependencies @@\ |
---|
543 | $(DEPENDSCRIPT) "$(MAKEDEPEND)" \ @@\ |
---|
544 | "$(ALL_KINCLUDES) $(CPLUSINC) -I/" "$(ALL_DEFINES)" |
---|
545 | /* -I/ added to circumvent grossness of makedepend */ |
---|
546 | |
---|
547 | #define DependTargetK(dependencies) @@\ |
---|
548 | depend:: dependencies @@\ |
---|
549 | $(DEPENDSCRIPT) "$(MAKEDEPEND)" \ @@\ |
---|
550 | "$(ALL_KINCLUDES) $(CPLUSINC) -I/" "$(ALL_DEFINES)" "$(ALL_KDEFINES)" |
---|
551 | /* -I/ added to circumvent grossness of makedepend */ |
---|
552 | |
---|
553 | #define DependTargetPK(dependencies) @@\ |
---|
554 | depend:: dependencies @@\ |
---|
555 | $(DEPENDSCRIPT) "$(MAKEDEPEND)" \ @@\ |
---|
556 | "$(ALL_KINCLUDES) $(CPLUSINC) -I/" "$(ALL_DEFINES) -D__KERNEL__" "$(ALL_KDEFINES) -D__KERNEL__" "$(PATCHED_KERNEL_FLAGS) -D__KERNEL__" |
---|
557 | |
---|
558 | /* |
---|
559 | *================================================== |
---|
560 | * Installation rules |
---|
561 | *================================================== |
---|
562 | * Exported rules: |
---|
563 | * InstallDocs() |
---|
564 | * InstallFileToFile() |
---|
565 | * InstallFiles() |
---|
566 | * InstallHeaders() |
---|
567 | * InstallPatchedHeaders() |
---|
568 | * InstallHardLink() |
---|
569 | * InstallLibraries() |
---|
570 | * InstallLink() |
---|
571 | * InstallPrograms() |
---|
572 | *================================================== |
---|
573 | */ |
---|
574 | |
---|
575 | INSTUIDFLAGS = -c -m 4555 |
---|
576 | INSTLIBFLAGS = -c -m 0664 |
---|
577 | INSTINCFLAGS = -c -m 0444 |
---|
578 | INSTDOCFLAGS = -c -m 0444 |
---|
579 | INSTROOTFLAGS = -c $(EXTRAINSTROOTFLAGS) -m 0500 |
---|
580 | INSTROOTFLAGS2 = -c -m 0500 |
---|
581 | INSTPROGFLAGS = -c $(EXTRAINSTPROGFLAGS) -m 0555 |
---|
582 | INSTSHELLFLAGS = -c -m 0755 |
---|
583 | |
---|
584 | DASH_I = *-[^=\ ][i]* |
---|
585 | DASH_IK = *-[^=\ ][ik]* |
---|
586 | |
---|
587 | #define InstallFiles(files, mode, dest) @@\ |
---|
588 | install.ti:: files @@\ |
---|
589 | @(case '$(MAKEFLAGS)' in $(DASH_I)) set +e;; esac; \ @@\ |
---|
590 | changed="$?"; \ @@\ |
---|
591 | for i in $$changed; do \ @@\ |
---|
592 | (set -x; $(INSTALL) mode $$i dest/$$i) done) |
---|
593 | |
---|
594 | #define InstallHeaders(files, dest) @@\ |
---|
595 | install.he:: files @@\ |
---|
596 | @(case '$(MAKEFLAGS)' in $(DASH_I)) set +e;; esac; \ @@\ |
---|
597 | changed="$?"; \ @@\ |
---|
598 | for i in $$changed; do \ @@\ |
---|
599 | (set -x; $(INSTALL) $(INSTINCFLAGS) $$i dest/$$i) done) |
---|
600 | |
---|
601 | #define InstallPatchedHeaders(files, src, dest) @@\ |
---|
602 | install.he:: files @@\ |
---|
603 | @(case '$(MAKEFLAGS)' in $(DASH_I)) set +e;; esac; \ @@\ |
---|
604 | changed="$?"; \ @@\ |
---|
605 | for i in $$changed; do \ @@\ |
---|
606 | ($(PATCHSCRIPT) src dest $$i) done) |
---|
607 | |
---|
608 | #define InstallLibraries(libs, dest) @@\ |
---|
609 | library.ti:: libs @@\ |
---|
610 | @(case '$(MAKEFLAGS)' in $(DASH_I)) set +e;; esac; \ @@\ |
---|
611 | changed="$?"; \ @@\ |
---|
612 | for i in $$changed; do \ @@\ |
---|
613 | (set -x; \ @@\ |
---|
614 | $(INSTALL) $(INSTLIBFLAGS) $$i dest/$$i ) done) |
---|
615 | |
---|
616 | #define InstallFileToFile(file, mode, destfile) @@\ |
---|
617 | install.ti:: file @@\ |
---|
618 | $(INSTALL) mode file destfile |
---|
619 | |
---|
620 | #define ShipSupport(Destination) @@\ |
---|
621 | shipSupport:: $(SHIP_ROOT)/usr/lpp/$(LPP_NAME)/Destination @@\ |
---|
622 | $(SHIP_ROOT)/usr/lpp/$(LPP_NAME)/Destination: $(@F) @@\ |
---|
623 | [ -d $(@D) ] || mkdir -p $(@D) @@\ |
---|
624 | cp $(@F) $@ @@\ |
---|
625 | @@\ |
---|
626 | unshipSupport:: @@\ |
---|
627 | rm -f $(SHIP_ROOT)/usr/lpp/$(LPP_NAME)/Destination |
---|
628 | |
---|
629 | #define ShipFile(Destination,SourceFile,ProdName,Type,Owner,Group,Mode,Class,Size,CheckSum,Links,SymLinks,Program,Source,Acl,Xacl) @@\ |
---|
630 | shipFile:: $(SHIP_ROOT)/Destination @@\ |
---|
631 | $(SHIP_ROOT)/Destination:: SourceFile @@\ |
---|
632 | @[ -d $(@D) ] || mkdir -p $(@D) @@\ |
---|
633 | @([ -z "ProdName" ] && prodname=$(LOCAL_PROD_NAME) ||\ @@\ |
---|
634 | prodname=ProdName ;\ @@\ |
---|
635 | [ -n "Type" ] && type=Type || type="$(SHIP_TYPE)" ;\ @@\ |
---|
636 | [ -n "Owner" ] && owner=Owner || owner="$(SHIP_OWNER)";\ @@\ |
---|
637 | [ -n "Group" ] && group=Group || group="$(SHIP_GROUP)" ;\ @@\ |
---|
638 | [ -n "Mode" ] && mode=Mode || mode=555 ;\ @@\ |
---|
639 | [ -n "Class" ] && class_inv="Class" || class_inv="$(SHIP_CLASS)" ;\ @@\ |
---|
640 | [ "Type" = "DIRECTORY" ] && mkdir -p $(SHIP_ROOT)/Destination ; \ @@\ |
---|
641 | [ -z "SourceFile" ] || $(SHIP_CMD) -o $$owner -g $$group -m $$mode SourceFile $@ ;\ @@\ |
---|
642 | echo "\tShipping Destination ($$prodname)" ; \ @@\ |
---|
643 | [ -d $(SHIPDIR) ] || mkdir -p $(SHIPDIR) ; \ @@\ |
---|
644 | touch $(SHIPDIR)/$$prodname.il ||\ @@\ |
---|
645 | (echo "\nERROR: Failed to create file SHIPDIR/usr/lpp/$(LPP_NAME)/$$prodname.il" && exit 1) ;\ @@\ |
---|
646 | echo "Destination:" >> $(SHIPDIR)/$$prodname.il ;\ @@\ |
---|
647 | echo "\ttype = $$type" >> $(SHIPDIR)/$$prodname.il ;\ @@\ |
---|
648 | echo "\towner = $$owner" >> $(SHIPDIR)/$$prodname.il ;\ @@\ |
---|
649 | echo "\tgroup = $$group" >> $(SHIPDIR)/$$prodname.il ;\ @@\ |
---|
650 | if [ $$mode -gt 999 ] ; then \ @@\ |
---|
651 | if [ $$mode -ge 4000 -a $$mode -le 4999 ] ; then \ @@\ |
---|
652 | echo "\tmode = SUID,`expr $$mode - 4000`" >> \ @@\ |
---|
653 | $(SHIPDIR)/$$prodname.il ;\ @@\ |
---|
654 | elif [ $$mode -ge 2000 -a $$mode -le 2999 ] ; then \ @@\ |
---|
655 | echo "\tmode = SGID,`expr $$mode - 2000`" >> \ @@\ |
---|
656 | $(SHIPDIR)/$$prodname.il ;\ @@\ |
---|
657 | else \ @@\ |
---|
658 | ( echo "\nERROR: Unrecognized mode value $$mode" && exit 1 ); \ @@\ |
---|
659 | fi \ @@\ |
---|
660 | else \ @@\ |
---|
661 | echo "\tmode = $$mode" >> $(SHIPDIR)/$$prodname.il ;\ @@\ |
---|
662 | fi ; \ @@\ |
---|
663 | if [ "Type" != "DIRECTORY" ] ; then \ @@\ |
---|
664 | echo "\tclass = inventory,$$class_inv,$${prodname}" >> \ @@\ |
---|
665 | $(SHIPDIR)/$$prodname.il ;\ @@\ |
---|
666 | [ -z "Size" ] && echo "\tsize = `cksum < $@ | \ @@\ |
---|
667 | /bin/awk '{print $$2}'`" >> $(SHIPDIR)/$$prodname.il || \ @@\ |
---|
668 | echo "\tsize = Size" >> $(SHIPDIR)/$$prodname.il ; \ @@\ |
---|
669 | else \ @@\ |
---|
670 | echo "\tclass = $$class_inv,$${prodname}" >> \ @@\ |
---|
671 | $(SHIPDIR)/$$prodname.il ;\ @@\ |
---|
672 | fi ;\ @@\ |
---|
673 | [ -n "CheckSum" ] && echo "\tchecksum = CheckSum" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ |
---|
674 | [ -z "CheckSum" -a \( "Size" = "VOLATILE" \) ] && echo "\tchecksum = VOLATILE" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ |
---|
675 | [ -n "Links" ] && echo "\tlinks = Links" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ |
---|
676 | [ -n "SymLinks" ] && echo "\tsymlinks = SymLinks" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ |
---|
677 | [ -n "Program" ] && echo "\tprogram = Program" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ |
---|
678 | [ -n "Source" ] && echo "\tsource = Source\n" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ |
---|
679 | [ -n "Acl" ] && echo "\tacl = Acl\n" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ |
---|
680 | [ -n "Xacl" ] && echo "\txacl = Xacl\n" >> $(SHIPDIR)/$$prodname.il || true ;\ @@\ |
---|
681 | ) @@\ |
---|
682 | @@\ |
---|
683 | unshipFile:: @@\ |
---|
684 | -if [ -n "Destination" ] ; then \ @@\ |
---|
685 | [ ! -f $(SHIP_ROOT)/Destination ] || rm -f $(SHIP_ROOT)/Destination ;\ @@\ |
---|
686 | [ ! -d $(SHIP_ROOT)/Destination ] || rmdir $(SHIP_ROOT)/Destination ;\ @@\ |
---|
687 | fi @@\ |
---|
688 | @([ -z "ProdName" ] && prodname=$(LOCAL_PROD_NAME) || \ @@\ |
---|
689 | prodname=ProdName ;\ @@\ |
---|
690 | rm -f $(SHIP_ROOT)/usr/lpp/$(LPP_NAME)/$${prodname}.il ) |
---|
691 | |
---|
692 | #define InstallDocs(docs, mode, dest) @@\ |
---|
693 | install.ti:: docs @@\ |
---|
694 | @(case '$(MAKEFLAGS)' in $(DASH_I)) set +e;; esac; \ @@\ |
---|
695 | changed="$?"; \ @@\ |
---|
696 | for i in $$changed; do \ @@\ |
---|
697 | (set -x; $(INSTALL) $(INSTDOCFLAGS) $$i dest/$$i); \ @@\ |
---|
698 | done) |
---|
699 | |
---|
700 | |
---|
701 | #define InstallPrograms(files, dest) @@\ |
---|
702 | InstallFiles(files, $(INSTPROGFLAGS), dest) |
---|
703 | |
---|
704 | #define InstallRootPrograms(files, dest) @@\ |
---|
705 | InstallFiles(files, $(INSTROOTFLAGS), dest) |
---|
706 | |
---|
707 | #define InstallUidPrograms(files, dest) @@\ |
---|
708 | InstallFiles(files, $(INSTUIDFLAGS), dest) |
---|
709 | |
---|
710 | #define InstallHardLink(file, link) @@\ |
---|
711 | install.ti:: file @@\ |
---|
712 | $(RM) link @@\ |
---|
713 | ln file link |
---|
714 | |
---|
715 | #define InstallLink(file, link) @@\ |
---|
716 | install.ti:: @@\ |
---|
717 | $(RM) link @@\ |
---|
718 | $(LN) file link |
---|
719 | |
---|
720 | /* ***************************************************************** *\ |
---|
721 | * Internal (to template) rules |
---|
722 | \* ***************************************************************** */ |
---|
723 | #define GenericCleanTarget() @@\ |
---|
724 | clean:: @@\ |
---|
725 | $(RM) _POUND_* ,* *~ *.CKP *.BAK *.bak core @@\ |
---|
726 | $(RM) *.ln *.o *.32o *.64o *.po *.ko *.pko make.log *.a *.lst *.map *.so @@\ |
---|
727 | $(RM) install.ti install.he library.ti *.rpm |
---|
728 | |
---|
729 | #define MakefileTarget() @@\ |
---|
730 | makefile:: Imakefile $(IRULESRC)/imake.tmpl $(IRULESRC)/site.mcr @@\ |
---|
731 | $(IMAKE_CMD); \ @@\ |
---|
732 | touch .depends; \ @@\ |
---|
733 | cat .depends >>makefile |
---|
734 | |
---|
735 | #define SubdirTarget(dirs, mktag, string) @@\ |
---|
736 | mktag:: @@\ |
---|
737 | @(case '$(MAKEFLAGS)' in $(DASH_IK)) set +e;; esac; \ @@\ |
---|
738 | for i in dirs; do \ @@\ |
---|
739 | (cd $$i || exit $$?; \ @@\ |
---|
740 | echo string "(`pwd`)"; \ @@\ |
---|
741 | $(MAKE) $(MAKEDASH)$(MAKEFLAGS) $(MAKEEXTRA) DESTDIR=$(DESTDIR) mktag; \ @@\ |
---|
742 | exit $$?) || exit 1; \ @@\ |
---|
743 | done) |
---|
744 | |
---|
745 | #define MakeSubdirs(dirs) @@\ |
---|
746 | SubdirTarget(dirs, All, "making") |
---|
747 | |
---|
748 | #define InstallSubdirs(dirs) @@\ |
---|
749 | SubdirTarget(dirs, Install, "installing") |
---|
750 | |
---|
751 | #define InstLibSubdirs(dirs) @@\ |
---|
752 | SubdirTarget(dirs, InstallLibs, "Make-Install-Libraries-ing") |
---|
753 | |
---|
754 | #define LibSubdirs(dirs) @@\ |
---|
755 | SubdirTarget(dirs, Libs, "Make-Libraries-ing") |
---|
756 | |
---|
757 | #define MakeTestSubdirs(dirs) @@\ |
---|
758 | SubdirTarget(dirs, Test, "Make-Testing") |
---|
759 | |
---|
760 | #define dependInstallSubdirs(dirs) @@\ |
---|
761 | SubdirTarget(dirs, dependInstall, "depend-Installing") |
---|
762 | |
---|
763 | #define DependSubdirs(dirs) @@\ |
---|
764 | SubdirTarget(dirs, Depend, "Depending") |
---|
765 | |
---|
766 | #define CleanTestSubdirs(dirs) @@\ |
---|
767 | SubdirTarget(dirs, CleanTest, "cleaning tests") |
---|
768 | |
---|
769 | #define CleanSubdirs(dirs) @@\ |
---|
770 | SubdirTarget(dirs, Clean, "cleaning") |
---|
771 | |
---|
772 | #define CheckinSubdirs(dirs) @@\ |
---|
773 | SubdirTarget(dirs, Checkin, "checking mods in") |
---|
774 | |
---|
775 | #define ShipSubdirs(dirs) @@\ |
---|
776 | SubdirTarget(dirs, Ship, "Shipping") |
---|
777 | |
---|
778 | #define UnshipSubdirs(dirs) @@\ |
---|
779 | SubdirTarget(dirs, Unship, "Unshipping") |
---|
780 | |
---|
781 | #define HeaderSubdirs(dirs) @@\ |
---|
782 | SubdirTarget(dirs, Headers, "installing header files") |
---|
783 | |
---|
784 | #define MakeMakeSubdirs(dirs) @@\ |
---|
785 | Makefiles:: @@\ |
---|
786 | @(case '$(MAKEFLAGS)' in $(DASH_IK)) set +e;; esac; \ @@\ |
---|
787 | for i in dirs; do \ @@\ |
---|
788 | echo "Making Makefiles (`pwd`/$$i)"; \ @@\ |
---|
789 | $(MAKE) subdirMakefiles \ @@\ |
---|
790 | MAKE_SUBDIR=$$i || exit $$?; \ @@\ |
---|
791 | done) |
---|
792 | |
---|
793 | #define MakefileSubdirs(dirs) @@\ |
---|
794 | MakeMakeSubdirs(dirs) @@\ |
---|
795 | @@\ |
---|
796 | subdirMakefiles: @@\ |
---|
797 | cd $(MAKE_SUBDIR) || exit $$?; \ @@\ |
---|
798 | $(DOTDOTIMAKE_CMD); \ @@\ |
---|
799 | touch .depends; \ @@\ |
---|
800 | cat .depends >>makefile; \ @@\ |
---|
801 | $(MAKE) $(MAKEDASH)$(MAKEFLAGS) $(MAKEEXTRA) Makefiles |
---|
802 | |
---|
803 | all:: libs |
---|
804 | All:: all |
---|
805 | test:: |
---|
806 | Test:: test |
---|
807 | libs:: headers |
---|
808 | Libs:: libs |
---|
809 | installLibs:: trclst |
---|
810 | trclst:: |
---|
811 | installLibs:: libs |
---|
812 | installLibs:: library.ti |
---|
813 | InstallLibs:: installLibs |
---|
814 | instLibs:: installLibs |
---|
815 | InstLibs:: InstallLibs |
---|
816 | rpm:: |
---|
817 | |
---|
818 | depend:: headers |
---|
819 | depend:: makefile |
---|
820 | Depend:: depend |
---|
821 | install.he:: |
---|
822 | library.ti:: |
---|
823 | headers:: install.he |
---|
824 | Headers:: headers |
---|
825 | install.ti:: |
---|
826 | install:: headers |
---|
827 | install:: libs |
---|
828 | install:: all |
---|
829 | install:: install.ti |
---|
830 | Install:: install |
---|
831 | dependInstall:: depend |
---|
832 | dependInstall:: install |
---|
833 | clean:: |
---|
834 | Clean:: clean |
---|
835 | cleanTest:: |
---|
836 | CleanTest:: cleanTest |
---|
837 | update:: ; $(SRC_UPDATE_CMD) |
---|
838 | checkin:: ; $(SRC_CHECKIN_CMD) |
---|
839 | Checkin:: checkin |
---|
840 | config1:: |
---|
841 | config2:: |
---|
842 | finish:: |
---|
843 | World:: config1 |
---|
844 | World:: Makefiles |
---|
845 | World:: Clean |
---|
846 | World:: config2 |
---|
847 | World:: Headers |
---|
848 | World:: Depend |
---|
849 | World:: InstallLibs |
---|
850 | World:: Install |
---|
851 | World:: finish |
---|
852 | Ship:: shipReset |
---|
853 | Ship:: shipSupport |
---|
854 | Ship:: shipFile |
---|
855 | Unship:: unshipSupport |
---|
856 | Unship:: unshipFile |
---|
857 | |
---|
858 | shipReset:: |
---|
859 | |
---|
860 | GenericCleanTarget() |
---|
861 | #ifndef BOOTSTRAP |
---|
862 | MakefileTarget() |
---|
863 | #endif |
---|
864 | |
---|
865 | _POUND_################################################## |
---|
866 | _POUND_ The following comes from the local Imakefile |
---|
867 | _POUND_################################################## |
---|
868 | #include INCLUDE_IMAKEFILE |
---|
869 | _POUND_################################################## |
---|
870 | _POUND_ Back from the local Imakefile |
---|
871 | _POUND_################################################## |
---|
872 | |
---|
873 | Makefiles:: makefile |
---|
874 | |
---|
875 | #ifdef IHaveSubdirs |
---|
876 | |
---|
877 | MakeSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) |
---|
878 | InstallSubdirs($(SUBDIRS)) |
---|
879 | MakeTestSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) |
---|
880 | dependInstallSubdirs($(SUBDIRS)) |
---|
881 | DependSubdirs($(SUBDIRS)) |
---|
882 | CleanTestSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) |
---|
883 | CleanSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) |
---|
884 | CheckinSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) |
---|
885 | MakefileSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) |
---|
886 | HeaderSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) |
---|
887 | LibSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) |
---|
888 | InstLibSubdirs($(SUBDIRS) $(EXTRASUBDIRS)) |
---|
889 | ShipSubdirs($(SUBDIRS)) |
---|
890 | UnshipSubdirs($(SUBDIRS)) |
---|
891 | |
---|
892 | #endif |
---|
893 | |
---|
894 | installLibs::afterInstallLibs |
---|
895 | |
---|
896 | afterInstallLibs:: |
---|
897 | |
---|
898 | shipFile shipSupport:: |
---|
899 | |
---|
900 | unshipFile unshipSupport:: |
---|
901 | |
---|
902 | library.ti:: |
---|
903 | touch library.ti |
---|
904 | |
---|
905 | install.he:: |
---|
906 | touch install.he |
---|
907 | |
---|
908 | install.ti:: |
---|
909 | touch install.ti |
---|
910 | |
---|
911 | listdirs: |
---|
912 | @echo ${SUBDIRS} |
---|
913 | |
---|
914 | _POUND_#### DEPENDENCY LINE - DO NOT DELETE ##### |
---|