ld64 with ppc
[darwin-xtools.git] / cctools / Makefile
blob73413fadea2b21c76be381c341aae448d91a01cf
1 export USE_APPLE_PB_SUPPORT = all
3 DSTROOT = /
4 RC_OS = macos
5 RC_CFLAGS =
7 INSTALLSRC_SUBDIRS = $(COMMON_SUBDIRS) $(SUBDIRS_32) ar include efitools \
8 libmacho
9 COMMON_SUBDIRS = libstuff as gprof misc man cbtlibs otool
10 APPLE_SUBDIRS = ar
11 SUBDIRS_32 = ld
12 EFITOOLS = efitools
13 SUBDIRS = $(COMMON_SUBDIRS) $(APPLE_SUBDIRS) $(EFITOOLS)
15 OLD_LIBKLD = NO
16 BUILD_DYLIBS = YES
17 LTO = -DLTO_SUPPORT
19 ifeq "macos" "$(RC_OS)"
20 TRIE := $(shell if [ "$(RC_MAJOR_RELEASE_TRAIN)" = "Tiger" ] || \
21 [ "$(RC_MAJOR_RELEASE_TRAIN)" = "Leopard" ] || \
22 [ "$(RC_PURPLE)" = "YES" ]; then \
23 echo "" ; \
24 else \
25 echo "-DTRIE_SUPPORT" ; fi; )
26 else
27 TRIE =
28 endif
30 ifneq "" "$(wildcard /bin/mkdirs)"
31 MKDIRS = /bin/mkdirs
32 else
33 MKDIRS = /bin/mkdir -p
34 endif
36 all clean: $(DSTROOT)
37 @if [ "$(SRCROOT)" != "" ] && \
38 [ "$(OBJROOT)" != "" ] && \
39 [ "$(SYMROOT)" != "" ]; \
40 then \
41 CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \
42 for i in `echo $(SUBDIRS)`; \
43 do \
44 echo =========== $(MAKE) $@ for $$i =============; \
45 (cd $$i; $(MAKE) RC_CFLAGS="$(RC_CFLAGS) $(HIDE)" \
46 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
47 VERS_STRING_FLAGS="$(VERS_STRING_FLAGS)" \
48 EFITOOLS="$(EFITOOLS)" \
49 TRIE="$(TRIE)" LTO="$(LTO)" DSTROOT=$$DSTROOT \
50 RAW_DSTROOT="$(RAW_DSTROOT)" \
51 SRCROOT=$(SRCROOT)/$$i \
52 OBJROOT=$(OBJROOT)/$$i \
53 SYMROOT=$(SYMROOT)/$$i $@) || exit 1 ; \
54 done; \
55 SED_RC_CFLAGS=`echo "$(RC_CFLAGS)" | sed 's/-arch ppc64//' \
56 | sed 's/-arch x86_64//' | sed 's/-arch armv5//' \
57 | sed 's/-arch arm64//' | sed 's/-arch x86_64h//' \
58 | sed 's/-arch armv6//' | sed 's/-arch armv7[f,k,s]*//g'`; \
59 EMPTY=`echo "$$SED_RC_CFLAGS" | sed 's/ //g' \
60 | sed 's/-pipe//'`; \
61 if [ "$$EMPTY"x != "x" ]; \
62 then \
63 for i in `echo $(SUBDIRS_32)`; \
64 do \
65 echo =========== $(MAKE) $@ for $$i =============; \
66 (cd $$i; $(MAKE) "RC_CFLAGS=$$SED_RC_CFLAGS" \
67 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
68 VERS_STRING_FLAGS="$(VERS_STRING_FLAGS)" \
69 EFITOOLS="$(EFITOOLS)" \
70 TRIE="$(TRIE)" LTO="$(LTO)" DSTROOT=$$DSTROOT \
71 RAW_DSTROOT="$(RAW_DSTROOT)" \
72 SRCROOT=$(SRCROOT)/$$i \
73 OBJROOT=$(OBJROOT)/$$i \
74 SYMROOT=$(SYMROOT)/$$i $@) || exit 1 ; \
75 done; \
76 fi \
77 else \
78 CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \
79 for i in `echo $(SUBDIRS)`; \
80 do \
81 echo =========== $(MAKE) $@ for $$i =============; \
82 (cd $$i; $(MAKE) RC_CFLAGS="$(RC_CFLAGS) $(HIDE)" \
83 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
84 EFITOOLS="$(EFITOOLS)" \
85 TRIE="$(TRIE)" LTO="$(LTO)" DSTROOT=$$DSTROOT \
86 RAW_DSTROOT="$(RAW_DSTROOT)" $@) || exit 1 ; \
87 done; \
88 SED_RC_CFLAGS=`echo "$(RC_CFLAGS)" | sed 's/-arch ppc64//' \
89 | sed 's/-arch x86_64//' | sed 's/-arch armv5//' \
90 | sed 's/-arch arm64//' | sed 's/-arch x86_64h//' \
91 | sed 's/-arch armv6//' | sed 's/-arch armv7[f,k,s]*//g'`; \
92 EMPTY=`echo "$$SED_RC_CFLAGS" | sed 's/ //g' \
93 | sed 's/-pipe//'`; \
94 if [ "$$EMPTY"x != "x" ]; \
95 then \
96 for i in `echo $(SUBDIRS_32)`; \
97 do \
98 echo =========== $(MAKE) $@ for $$i =============; \
99 (cd $$i; $(MAKE) RC_CFLAGS="$$SED_RC_CFLAGS" \
100 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
101 EFITOOLS="$(EFITOOLS)" \
102 TRIE="$(TRIE)" LTO="$(LTO)" DSTROOT=$$DSTROOT \
103 RAW_DSTROOT="$(RAW_DSTROOT)" $@) || exit 1 ; \
104 done; \
105 fi \
108 install:
109 @if [ $(SRCROOT) ]; \
110 then \
111 projName=`basename $(SRCROOT) | \
112 sed 's/-[-0-9.]*//' | sed 's/\.cvs//'`; \
113 if [ "$$projName" = cctools ]; \
114 then \
115 target=install_tools; \
116 elif [ "$$projName" = cctools_sdk ]; \
117 then \
118 target=install_tools; \
119 elif [ "$$projName" = cctoolslib ]; \
120 then \
121 target=lib_ofiles_install; \
122 else \
123 echo "Unknown project name $$projName"; \
124 exit 1; \
125 fi; \
126 CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \
127 echo =========== $(MAKE) $$target =============; \
128 $(MAKE) RC_CFLAGS="$(RC_CFLAGS)" \
129 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
130 VERS_STRING_FLAGS="$(VERS_STRING_FLAGS)" \
131 EFITOOLS="$(EFITOOLS)" TRIE="$(TRIE)" \
132 LTO="$(LTO)" DSTROOT=$$DSTROOT/$(INSTALL_LOCATION) \
133 RAW_DSTROOT=$$DSTROOT \
134 SRCROOT=$(SRCROOT) \
135 OBJROOT=$(OBJROOT) \
136 SYMROOT=$(SYMROOT) $$target; \
137 else \
138 CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \
139 echo =========== $(MAKE) install_tools =============; \
140 $(MAKE) RC_CFLAGS="$(RC_CFLAGS)" RC_ARCHS="$(RC_ARCHS)" \
141 RC_OS="$(RC_OS)" SUBDIRS="$(SUBDIRS)" \
142 SUBDIRS_32="$(SUBDIRS_32)" \
143 VERS_STRING_FLAGS="$(VERS_STRING_FLAGS)" \
144 EFITOOLS="$(EFITOOLS)" TRIE="$(TRIE)" \
145 LTO="$(LTO)" DSTROOT=$$DSTROOT install_tools \
146 RAW_DSTROOT=$$DSTROOT \
147 lib_ofiles_install; \
150 install_tools: installhdrs
151 @if [ $(SRCROOT) ]; \
152 then \
153 CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \
154 for i in `echo $(SUBDIRS)`; \
155 do \
156 echo ======== $(MAKE) install for $$i ============; \
157 (cd $$i; $(MAKE) RC_CFLAGS="$(RC_CFLAGS) $(HIDE)" \
158 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
159 VERS_STRING_FLAGS="$(VERS_STRING_FLAGS)" \
160 EFITOOLS="$(EFITOOLS)" \
161 TRIE="$(TRIE)" LTO="$(LTO)" DSTROOT=$$DSTROOT \
162 RAW_DSTROOT="$(RAW_DSTROOT)" \
163 SRCROOT=$(SRCROOT)/$$i \
164 OBJROOT=$(OBJROOT)/$$i \
165 SYMROOT=$(SYMROOT)/$$i install) || exit 1; \
166 done; \
167 SED_RC_CFLAGS=`echo "$(RC_CFLAGS)" | sed 's/-arch ppc64//' \
168 | sed 's/-arch x86_64//' | sed 's/-arch armv5//' \
169 | sed 's/-arch arm64//' | sed 's/-arch x86_64h//' \
170 | sed 's/-arch armv6//' | sed 's/-arch armv7[f,k,s]*//g'`; \
171 EMPTY=`echo "$$SED_RC_CFLAGS" | sed 's/ //g' \
172 | sed 's/-pipe//'`; \
173 if [ "$$EMPTY"x != "x" ]; \
174 then \
175 for i in `echo $(SUBDIRS_32)`; \
176 do \
177 echo ======== $(MAKE) install for $$i ============; \
178 (cd $$i; $(MAKE) RC_CFLAGS="$$SED_RC_CFLAGS $(HIDE)" \
179 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
180 VERS_STRING_FLAGS="$(VERS_STRING_FLAGS)" \
181 EFITOOLS="$(EFITOOLS)" \
182 TRIE="$(TRIE)" LTO="$(LTO)" DSTROOT=$$DSTROOT \
183 RAW_DSTROOT="$(RAW_DSTROOT)" \
184 SRCROOT=$(SRCROOT)/$$i \
185 OBJROOT=$(OBJROOT)/$$i \
186 SYMROOT=$(SYMROOT)/$$i install) || exit 1; \
187 done; \
188 fi \
189 else \
190 CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \
191 for i in `echo $(SUBDIRS)`; \
192 do \
193 echo ========= $(MAKE) install for $$i ===========; \
194 (cd $$i; $(MAKE) RC_CFLAGS="$(RC_CFLAGS) $(HIDE)" \
195 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
196 VERS_STRING_FLAGS="$(VERS_STRING_FLAGS)" \
197 EFITOOLS="$(EFITOOLS)" \
198 TRIE="$(TRIE)" LTO="$(LTO)" DSTROOT=$$DSTROOT \
199 RAW_DSTROOT="$(RAW_DSTROOT)" \
200 install) || exit 1; \
201 done; \
202 SED_RC_CFLAGS=`echo "$(RC_CFLAGS)" | sed 's/-arch ppc64//' \
203 | sed 's/-arch x86_64//' | sed 's/-arch armv5//' \
204 | sed 's/-arch arm64//' | sed 's/-arch x86_64h//' \
205 | sed 's/-arch armv6//' | sed 's/-arch armv7[f,k,s]*//g'`; \
206 EMPTY=`echo "$$SED_RC_CFLAGS" | sed 's/ //g' \
207 | sed 's/-pipe//'`; \
208 if [ "$$EMPTY"x != "x" ]; \
209 then \
210 for i in `echo $(SUBDIRS_32)`; \
211 do \
212 echo ========= $(MAKE) install for $$i ===========; \
213 (cd $$i; $(MAKE) RC_CFLAGS="$$SED_RC_CFLAGS $(HIDE)" \
214 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
215 VERS_STRING_FLAGS="$(VERS_STRING_FLAGS)" \
216 EFITOOLS="$(EFITOOLS)" \
217 TRIE="$(TRIE)" LTO="$(LTO)" DSTROOT=$$DSTROOT \
218 RAW_DSTROOT="$(RAW_DSTROOT)" \
219 install) || exit 1; \
220 done; \
221 fi \
224 ofiles_install:
225 @ export RC_FORCEHDRS=YES; \
226 $(MAKE) RC_CFLAGS="$(RC_CFLAGS) $(HIDE)" \
227 RC_ARCHS="$(RC_ARCHS)" \
228 RC_OS="$(RC_OS)" \
229 DSTROOT=$$DSTROOT/$(INSTALL_LOCATION) \
230 RAW_DSTROOT="$(RAW_DSTROOT)" \
231 SRCROOT=$(SRCROOT) \
232 OBJROOT=$(OBJROOT) \
233 SYMROOT=$(SYMROOT) \
234 EFITOOLS="$(EFITOOLS)" TRIE="$(TRIE)" \
235 LTO="$(LTO)" lib_ofiles_install
237 lib_ofiles lib_ofiles_install: installhdrs
238 @if [ $(SRCROOT) ]; \
239 then \
240 CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \
241 SED_RC_CFLAGS=`echo "$(RC_CFLAGS)" | sed 's/-arch ppc64//' \
242 | sed 's/-arch arm64//' \
243 | sed 's/-arch x86_64h//' \
244 | sed 's/-arch x86_64//'`; \
245 echo =========== $(MAKE) $@ for libstuff =============; \
246 (cd libstuff; $(MAKE) "RC_CFLAGS=$(RC_CFLAGS) $(HIDE)" \
247 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
248 DSTROOT=$$DSTROOT \
249 RAW_DSTROOT="$(RAW_DSTROOT)" \
250 SRCROOT=$(SRCROOT)/libstuff \
251 OBJROOT=$(OBJROOT)/libstuff \
252 SYMROOT=$(SYMROOT)/libstuff $@) || exit 1; \
253 echo ====== $(MAKE) lib_static_ofiles for libstuff =======; \
254 (cd libstuff; $(MAKE) "RC_CFLAGS=$$SED_RC_CFLAGS $(HIDE)" \
255 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
256 OLD_LIBKLD="$(OLD_LIBKLD)" \
257 DSTROOT=$$DSTROOT \
258 RAW_DSTROOT="$(RAW_DSTROOT)" \
259 SRCROOT=$(SRCROOT)/libstuff \
260 OBJROOT=$(OBJROOT)/libstuff \
261 SYMROOT=$(SYMROOT)/libstuff lib_static_ofiles) || exit 1; \
262 if [ $(BUILD_DYLIBS) = "YES" ]; \
263 then \
264 echo =========== $(MAKE) $@ for libmacho =============; \
265 (cd libmacho; $(MAKE) RC_CFLAGS="$(RC_CFLAGS) $(HIDE)" \
266 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
267 RC_ProjectName="$(RC_ProjectName)" \
268 OLD_LIBKLD="$(OLD_LIBKLD)" \
269 DSTROOT=$$DSTROOT \
270 RAW_DSTROOT="$(RAW_DSTROOT)" \
271 SRCROOT=$(SRCROOT)/libmacho \
272 OBJROOT=$(OBJROOT)/libmacho \
273 SYMROOT=$(SYMROOT)/libmacho $@) || exit 1; \
274 fi; \
275 echo =========== $(MAKE) $@ for ld =============; \
276 (cd ld; $(MAKE) "RC_CFLAGS=$$SED_RC_CFLAGS $(HIDE)" \
277 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
278 OLD_LIBKLD="$(OLD_LIBKLD)" \
279 DSTROOT=$$DSTROOT \
280 RAW_DSTROOT="$(RAW_DSTROOT)" \
281 SRCROOT=$(SRCROOT)/ld \
282 OBJROOT=$(OBJROOT)/ld \
283 SYMROOT=$(SYMROOT)/ld $@) || exit 1; \
284 echo =========== $(MAKE) $@ for misc =============; \
285 (cd misc; $(MAKE) "RC_CFLAGS=$(RC_CFLAGS) $(HIDE)" \
286 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
287 TRIE="$(TRIE)" LTO="$(LTO)" \
288 DSTROOT=$$DSTROOT \
289 RAW_DSTROOT="$(RAW_DSTROOT)" \
290 SRCROOT=$(SRCROOT)/misc \
291 OBJROOT=$(OBJROOT)/misc \
292 SYMROOT=$(SYMROOT)/misc $@) || exit 1; \
293 echo =========== $(MAKE) $@ for cbtlibs =============; \
294 (cd cbtlibs; $(MAKE) "RC_CFLAGS=$(RC_CFLAGS) $(HIDE)" \
295 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
296 DSTROOT=$$DSTROOT \
297 RAW_DSTROOT="$(RAW_DSTROOT)" \
298 SRCROOT=$(SRCROOT)/cbtlibs \
299 OBJROOT=$(OBJROOT)/cbtlibs \
300 SYMROOT=$(SYMROOT)/cbtlibs $@) || exit 1; \
301 else \
302 CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \
303 SED_RC_CFLAGS=`echo "$(RC_CFLAGS)" | sed 's/-arch ppc64//' \
304 | sed 's/-arch arm64//' \
305 | sed 's/-arch x86_64h//' \
306 | sed 's/-arch x86_64//'`; \
307 echo =========== $(MAKE) $@ for libstuff =============; \
308 (cd libstuff; $(MAKE) "RC_CFLAGS=$(RC_CFLAGS) $(HIDE)" \
309 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
310 DSTROOT=$$DSTROOT RAW_DSTROOT="$(RAW_DSTROOT)" $@) || exit 1; \
311 echo ====== $(MAKE) lib_static_ofiles for libstuff =======; \
312 (cd libstuff; $(MAKE) "RC_CFLAGS=$$SED_RC_CFLAGS $(HIDE)" \
313 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
314 DSTROOT=$$DSTROOT RAW_DSTROOT="$(RAW_DSTROOT)" \
315 lib_static_ofiles) || exit 1; \
316 if [ $(BUILD_DYLIBS) = "YES" ]; \
317 then \
318 echo =========== $(MAKE) $@ for libmacho =============; \
319 (cd libmacho; $(MAKE) RC_CFLAGS="$(RC_CFLAGS) $(HIDE)" \
320 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
321 RC_ProjectName="$(RC_ProjectName)" \
322 DSTROOT=$$DSTROOT RAW_DSTROOT="$(RAW_DSTROOT)" $@) || exit 1; \
323 fi; \
324 echo =========== $(MAKE) $@ for ld =============; \
325 (cd ld; $(MAKE) "RC_CFLAGS=$$SED_RC_CFLAGS $(HIDE)" \
326 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
327 OLD_LIBKLD="$(OLD_LIBKLD)" \
328 DSTROOT=$$DSTROOT RAW_DSTROOT="$(RAW_DSTROOT)" $@) || exit 1; \
329 echo =========== $(MAKE) $@ for misc =============; \
330 (cd misc; $(MAKE) "RC_CFLAGS=$(RC_CFLAGS) $(HIDE)" \
331 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
332 TRIE="$(TRIE)" LTO="$(LTO)" \
333 DSTROOT=$$DSTROOT RAW_DSTROOT="$(RAW_DSTROOT)" $@) || exit 1; \
334 (cd cbtlibs; $(MAKE) "RC_CFLAGS=$(RC_CFLAGS) $(HIDE)" \
335 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
336 DSTROOT=$$DSTROOT RAW_DSTROOT="$(RAW_DSTROOT)" $@) || exit 1; \
339 install_dev_tools:
340 @ export RC_FORCEHDRS=YES; \
341 $(MAKE) RC_CFLAGS="$(RC_CFLAGS)" \
342 RC_ARCHS="$(RC_ARCHS)" \
343 RC_OS="$(RC_OS)" \
344 INSTALL_LOCATION=$(INSTALL_LOCATION) \
345 DSTROOT=$(DSTROOT) \
346 SRCROOT=$(SRCROOT) \
347 OBJROOT=$(OBJROOT) \
348 SYMROOT=$(SYMROOT) \
349 EFITOOLS="$(EFITOOLS)" TRIE="$(TRIE)" \
350 LTO="$(LTO)" install
352 install_os_tools: installhdrs
353 @if [ $(SRCROOT) ]; \
354 then \
355 CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \
356 echo =========== $(MAKE) all for libstuff =============; \
357 (cd libstuff; $(MAKE) "RC_CFLAGS=$(RC_CFLAGS) $(HIDE)" \
358 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
359 OLD_LIBKLD="$(OLD_LIBKLD)" \
360 DSTROOT=$$DSTROOT \
361 RAW_DSTROOT="$(RAW_DSTROOT)" \
362 SRCROOT=$(SRCROOT)/libstuff \
363 OBJROOT=$(OBJROOT)/libstuff \
364 SYMROOT=$(SYMROOT)/libstuff all) || exit 1; \
365 echo =========== $(MAKE) $@ for misc =============; \
366 (cd misc; $(MAKE) "RC_CFLAGS=$(RC_CFLAGS) $(HIDE)" \
367 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
368 TRIE="$(TRIE)" LTO="$(LTO)" \
369 DSTROOT=$$DSTROOT \
370 RAW_DSTROOT="$(RAW_DSTROOT)" \
371 SRCROOT=$(SRCROOT)/misc \
372 OBJROOT=$(OBJROOT)/misc \
373 SYMROOT=$(SYMROOT)/misc $@) || exit 1; \
374 echo =========== $(MAKE) $@ for man =============; \
375 (cd man; $(MAKE) "RC_CFLAGS=$(RC_CFLAGS) $(HIDE)" \
376 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
377 DSTROOT=$$DSTROOT \
378 RAW_DSTROOT="$(RAW_DSTROOT)" \
379 SRCROOT=$(SRCROOT)/man \
380 OBJROOT=$(OBJROOT)/man \
381 SYMROOT=$(SYMROOT)/man $@) || exit 1; \
382 else \
383 CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \
384 echo =========== $(MAKE) all for libstuff =============; \
385 (cd libstuff; $(MAKE) "RC_CFLAGS=$(RC_CFLAGS) $(HIDE)" \
386 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
387 DSTROOT=$$DSTROOT RAW_DSTROOT="$(RAW_DSTROOT)" all) || exit 1; \
388 echo =========== $(MAKE) $@ for misc =============; \
389 (cd misc; $(MAKE) "RC_CFLAGS=$(RC_CFLAGS) $(HIDE)" \
390 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
391 TRIE="$(TRIE)" LTO="$(LTO)" \
392 DSTROOT=$$DSTROOT RAW_DSTROOT="$(RAW_DSTROOT)" $@) || exit 1; \
393 echo =========== $(MAKE) $@ for man =============; \
394 (cd man; $(MAKE) "RC_CFLAGS=$(RC_CFLAGS) $(HIDE)" \
395 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
396 DSTROOT=$$DSTROOT RAW_DSTROOT="$(RAW_DSTROOT)" $@) || exit 1; \
399 installsrc: SRCROOT
400 $(MKDIRS) $(SRCROOT)
401 cp Makefile APPLE_LICENSE PB.project EXPORT.APPLE $(SRCROOT)
402 for i in `echo $(INSTALLSRC_SUBDIRS)`; \
403 do \
404 echo =========== $(MAKE) $@ for $$i =============; \
405 (cd $$i; $(MAKE) SRCROOT=$$SRCROOT/$$i \
406 EFITOOLS="$(EFITOOLS)" $@) || exit 1; \
407 done
409 installGASsrc: SRCROOT
410 $(MKDIRS) $(SRCROOT)
411 cp Makefile $(SRCROOT)
412 @for i in as libstuff include ; \
413 do \
414 echo =========== $(MAKE) $@ for $$i =============; \
415 (cd $$i; $(MAKE) SRCROOT=$$SRCROOT/$$i $@) || exit 1; \
416 done
418 fromGASsrc:
419 @CWD=`pwd`; cd "$(DSTROOT)"; DSTROOT=`pwd`; cd "$$CWD"; \
420 echo =========== $(MAKE) fromGASsrc for libstuff =============; \
421 (cd libstuff; $(MAKE) RC_CFLAGS="$(RC_CFLAGS)" \
422 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
423 DSTROOT=$$DSTROOT RAW_DSTROOT="$(RAW_DSTROOT)" fromGASsrc) || exit 1; \
424 echo =========== $(MAKE) appc_build for as =============; \
425 (cd as; $(MAKE) RC_CFLAGS="$(RC_CFLAGS)" \
426 RC_ARCHS="$(RC_ARCHS)" RC_OS="$(RC_OS)" \
427 DSTROOT=$$DSTROOT RAW_DSTROOT="$(RAW_DSTROOT)" appc_build) || exit 1; \
429 installhdrs: $(DSTROOT)
430 @if [ $(SRCROOT) ]; \
431 then \
432 projName=`basename $(SRCROOT) | sed 's/-[0-9.]*//'`; \
433 if [ "$$projName" = cctools -a $(RC_OS) = macos ] && \
434 [ "$(RC_ProjectName)" != "cctools_ofiles_Sim" ] && \
435 [ "$(RC_FORCEHDRS)" != "YES" ]; \
436 then \
437 echo === cctools does not install headers for macos ===;\
438 else \
439 (cd include; $(MAKE) DSTROOT=$(DSTROOT) \
440 RC_OS="$(RC_OS)" install) || exit 1; \
441 fi; \
442 else \
443 (cd include; $(MAKE) DSTROOT=$(DSTROOT) RC_OS=$(RC_OS) \
444 install) || exit 1; \
447 $(DSTROOT):
448 $(MKDIRS) $@
450 SRCROOT:
451 @if [ -n "${$@}" ]; \
452 then \
453 exit 0; \
454 else \
455 echo Must define $@; \
456 exit 1; \