2 # Generic Install rules
5 ifndef INSTALL_MI_LCL_LIST
6 INSTALL_MI_LCL_LIST = $(INSTALL_MI_LIST)
9 ifndef INSTALL_MI_LCL_GEN_LIST
10 INSTALL_MI_LCL_GEN_LIST = $(INSTALL_MI_GEN_LIST)
13 ifndef INSTALL_MD_LCL_LIST
14 INSTALL_MD_LCL_LIST = $(INSTALL_MD_LIST)
17 ifndef INSTALL_MD_LCL_GEN_LIST
18 INSTALL_MD_LCL_GEN_LIST = $(INSTALL_MD_GEN_LIST)
21 ifndef INSTALL_KF_MI_LCL_LIST
22 INSTALL_KF_MI_LCL_LIST = $(EXPORT_MI_LIST)
25 ifndef INSTALL_KF_MI_LCL_GEN_LIST
26 INSTALL_KF_MI_LCL_GEN_LIST = $(EXPORT_MI_GEN_LIST)
29 ifndef INSTALL_KF_MD_LCL_LIST
30 INSTALL_KF_MD_LCL_LIST = $(EXPORT_MD_LIST)
33 ifndef INSTALL_KF_MD_LCL_GEN_LIST
34 INSTALL_KF_MD_LCL_GEN_LIST = $(EXPORT_MD_GEN_LIST)
37 ifndef INSTALL_KF_MI_LIST
38 INSTALL_KF_MI_LIST = $(EXPORT_MI_LIST)
41 ifndef INSTALL_KF_MI_GEN_LIST
42 INSTALL_KF_MI_GEN_LIST = $(EXPORT_MI_GEN_LIST)
45 ifndef INSTALL_KF_MD_LIST
46 INSTALL_KF_MD_LIST = $(EXPORT_MD_LIST)
49 ifndef INSTALL_KF_MD_GEN_LIST
50 INSTALL_KF_MD_GEN_LIST = $(EXPORT_MD_GEN_LIST)
53 ifneq ($(MACHINE_CONFIG), DEFAULT)
54 OBJPATH = $(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)_$(MACHINE_CONFIG)
56 OBJPATH = $(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)
59 INSTALL_MI_GEN_FILES = $(addprefix $(DSTROOT)/$(INCDIR)/$(INSTALL_MI_DIR)/, $(INSTALL_MI_GEN_LIST))
61 $(INSTALL_MI_GEN_FILES): $(DSTROOT)/$(INCDIR)/$(INSTALL_MI_DIR)/% : %
62 @true echo Installing $< in $(dir $@)
63 $(_v)[ -d $(DSTROOT)/$(INCDIR)/$(INSTALL_MI_DIR) ] ||$(MKDIR) $(DSTROOT)/$(INCDIR)/$(INSTALL_MI_DIR); \
64 filename=`$(BASENAME) $<`; \
65 filename_strip=$(addsuffix .strip,$${filename}); \
66 $(RM) $(RMFLAGS) $@; \
67 [ -d ./incmidir ] || $(MKDIR) ./incmidir; \
68 echo garbage > ./incmidir/$${filename_strip}; \
69 $(UNIFDEF) $(SINCFRAME_UNIFDEF) \
70 $< > ./incmidir/$${filename} || \
71 $(DECOMMENT) ./incmidir/$${filename} r > \
72 ./incmidir/$${filename_strip}; \
73 if [ -s ./incmidir/$${filename_strip} ]; \
75 $(INSTALL) $(INSTALL_FLAGS) ./incmidir/$${filename} $(dir $@);\
78 echo Header file $< not exported; \
81 INSTALL_KF_MI_GEN_FILES = $(addprefix $(DSTROOT)/$(KINCDIR)/$(EXPORT_MI_DIR)/, $(INSTALL_KF_MI_GEN_LIST))
83 $(INSTALL_KF_MI_GEN_FILES): $(DSTROOT)/$(KINCDIR)/$(EXPORT_MI_DIR)/% : %
84 @true echo Installing $< in $(midir $@)
85 $(_v)[ -d $(DSTROOT)/$(KINCDIR)/$(EXPORT_MI_DIR) ] ||$(MKDIR) $(DSTROOT)/$(KINCDIR)/$(EXPORT_MI_DIR); \
86 filename=`$(BASENAME) $<`; \
87 filename_strip=$(addsuffix .strip,$${filename}); \
88 $(RM) $(RMFLAGS) $@; \
89 [ -d ./kincmidir ] || $(MKDIR) ./kincmidir; \
90 echo garbage > ./kincmidir/$${filename_strip}; \
91 $(UNIFDEF) $(KINCFRAME_UNIFDEF) \
92 $< > ./kincmidir/$${filename} || \
93 $(DECOMMENT) ./kincmidir/$${filename} r > \
94 ./kincmidir/$${filename_strip}; \
95 if [ -s ./kincmidir/$${filename_strip} ]; \
97 $(INSTALL) $(INSTALL_FLAGS) ./kincmidir/$${filename} $(dir $@);\
100 echo Header file $< not exported; \
103 INSTALL_MI_GEN_LCL_FILES = $(addprefix $(DSTROOT)/$(LCLDIR)/$(INSTALL_MI_DIR)/, $(INSTALL_MI_LCL_GEN_LIST))
105 $(INSTALL_MI_GEN_LCL_FILES): $(DSTROOT)/$(LCLDIR)/$(INSTALL_MI_DIR)/% : %
106 @true echo Installing $< in $(dir $@)
107 $(_v)[ -d $(DSTROOT)/$(LCLDIR)/$(INSTALL_MI_DIR) ] ||$(MKDIR) $(DSTROOT)/$(LCLDIR)/$(INSTALL_MI_DIR); \
108 filename=`$(BASENAME) $<`; \
109 filename_strip=$(addsuffix .strip,$${filename}); \
110 $(RM) $(RMFLAGS) $@; \
111 [ -d ./pincmidir ] || $(MKDIR) ./pincmidir; \
112 echo garbage > ./pincmidir/$${filename_strip}; \
113 $(UNIFDEF) $(SPINCFRAME_UNIFDEF) \
114 $< > ./pincmidir/$${filename} || \
115 $(DECOMMENT) ./pincmidir/$${filename} r > \
116 ./pincmidir/$${filename_strip}; \
117 if [ -s ./pincmidir/$${filename_strip} ]; \
119 $(INSTALL) $(INSTALL_FLAGS) ./pincmidir/$${filename} $(dir $@);\
122 echo Header file $< not exported; \
125 INSTALL_KF_MI_LCL_GEN_FILES = $(addprefix $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MI_DIR)/, $(INSTALL_KF_MI_LCL_GEN_LIST))
127 $(INSTALL_KF_MI_LCL_GEN_FILES): $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MI_DIR)/% : %
128 @true echo Installing $< in $(dir $@)
129 $(_v)[ -d $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MI_DIR) ] ||$(MKDIR) $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MI_DIR); \
130 filename=`$(BASENAME) $<`; \
131 filename_strip=$(addsuffix .strip,$${filename}); \
132 $(RM) $(RMFLAGS) $@; \
133 [ -d ./kpincmidir ] || $(MKDIR) ./kpincmidir; \
134 echo garbage > ./kpincmidir/$${filename_strip}; \
135 $(UNIFDEF) $(KPINCFRAME_UNIFDEF) \
136 $< > ./kpincmidir/$${filename} || \
137 $(DECOMMENT) ./kpincmidir/$${filename} r > \
138 ./kpincmidir/$${filename_strip}; \
139 if [ -s ./kpincmidir/$${filename_strip} ]; \
141 $(INSTALL) $(INSTALL_FLAGS) ./kpincmidir/$${filename} $(dir $@);\
144 echo Header file $< not exported; \
147 INSTALL_MD_GEN_INC_FILES = $(addprefix $(DSTROOT)/$(INCDIR)/$(INSTALL_MD_DIR)/, $(INSTALL_MD_GEN_LIST))
149 $(INSTALL_MD_GEN_INC_FILES): $(DSTROOT)/$(INCDIR)/$(INSTALL_MD_DIR)/% : %
150 @true echo Installing $< in $(dir $@)
151 $(_v)[ -d $(DSTROOT)/$(INCDIR)/$(INSTALL_MD_DIR) ] ||$(MKDIR) $(DSTROOT)/$(INCDIR)/$(INSTALL_MD_DIR); \
152 filename=`$(BASENAME) $<`; \
153 filename_strip=$(addsuffix .strip,$${filename}); \
154 $(RM) $(RMFLAGS) $@; \
155 [ -d ./incdir ] || $(MKDIR) ./incdir; \
156 echo garbage > ./incdir/$${filename_strip}; \
157 $(UNIFDEF) $(SINCFRAME_UNIFDEF) \
158 $< > ./incdir/$${filename} || \
159 $(DECOMMENT) ./incdir/$${filename} r > \
160 ./incdir/$${filename_strip}; \
161 if [ -s ./incdir/$${filename_strip} ]; \
163 $(INSTALL) $(INSTALL_FLAGS) ./incdir/$${filename} $(dir $@);\
166 echo Header file $< not exported; \
169 INSTALL_KF_MD_GEN_FILES = $(addprefix $(DSTROOT)/$(KINCDIR)/$(EXPORT_MD_DIR)/, $(INSTALL_KF_MD_GEN_LIST))
171 $(INSTALL_KF_MD_GEN_FILES): $(DSTROOT)/$(KINCDIR)/$(EXPORT_MD_DIR)/% : %
172 @true echo Installing $< in $(dir $@)
173 $(_v)[ -d $(DSTROOT)/$(KINCDIR)/$(EXPORT_MD_DIR) ] ||$(MKDIR) $(DSTROOT)/$(KINCDIR)/$(EXPORT_MD_DIR); \
174 filename=`$(BASENAME) $<`; \
175 filename_strip=$(addsuffix .strip,$${filename}); \
176 $(RM) $(RMFLAGS) $@; \
177 [ -d ./kincdir ] || $(MKDIR) ./kincdir; \
178 echo garbage > ./kincdir/$${filename_strip}; \
179 $(UNIFDEF) $(KINCFRAME_UNIFDEF) \
180 $< > ./kincdir/$${filename} || \
181 $(DECOMMENT) ./kincdir/$${filename} r > \
182 ./kincdir/$${filename_strip}; \
183 if [ -s ./kincdir/$${filename_strip} ]; \
185 $(INSTALL) $(INSTALL_FLAGS) ./kincdir/$${filename} $(dir $@);\
188 echo Header file $< not exported; \
191 INSTALL_MD_LCL_FILES = $(addprefix $(SOURCE), $(INSTALL_MD_LCL_LIST))
192 INSTALL_MD_GEN_LCL_FILES = $(addprefix $(DSTROOT)/$(LCLDIR)/$(INSTALL_MD_DIR)/, $(INSTALL_MD_LCL_GEN_LIST))
194 $(INSTALL_MD_GEN_LCL_FILES): $(DSTROOT)/$(LCLDIR)/$(INSTALL_MD_DIR)/% : %
195 @true echo Installing $< in $(dir $@)
196 $(_v)[ -d $(DSTROOT)/$(LCLDIR)/$(INSTALL_MD_DIR) ] ||$(MKDIR) $(DSTROOT)/$(LCLDIR)/$(INSTALL_MD_DIR); \
197 filename=`$(BASENAME) $<`; \
198 filename_strip=$(addsuffix .strip,$${filename}); \
199 $(RM) $(RMFLAGS) $@; \
200 [ -d ./pincdir ] || $(MKDIR) ./pincdir; \
201 echo garbage > ./pincdir/$${filename_strip}; \
202 $(UNIFDEF) $(SPINCFRAME_UNIFDEF) \
203 $< > ./pincdir/$${filename} || \
204 $(DECOMMENT) ./pincdir/$${filename} r > \
205 ./pincdir/$${filename_strip}; \
206 if [ -s ./pincdir/$${filename_strip} ]; \
208 $(INSTALL) $(INSTALL_FLAGS) ./pincdir/$${filename} $(dir $@);\
211 echo Header file $< not exported; \
214 INSTALL_KF_MD_LCL_FILES = $(addprefix $(SOURCE), $(INSTALL_KF_MD_LCL_LIST))
215 INSTALL_KF_MD_LCL_GEN_FILES = $(addprefix $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MD_DIR)/, $(INSTALL_KF_MD_LCL_GEN_LIST))
217 $(INSTALL_KF_MD_LCL_GEN_FILES): $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MD_DIR)/% : %
218 @true echo Installing $< in $(dir $@)
219 $(_v)[ -d $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MD_DIR) ] ||$(MKDIR) $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MD_DIR); \
220 filename=`$(BASENAME) $<`; \
221 filename_strip=$(addsuffix .strip,$${filename}); \
222 $(RM) $(RMFLAGS) $@; \
223 [ -d ./kpincdir ] || $(MKDIR) ./kpincdir; \
224 echo garbage > ./kpincdir/$${filename_strip}; \
225 $(UNIFDEF) $(KPINCFRAME_UNIFDEF) \
226 $< > ./kpincdir/$${filename} || \
227 $(DECOMMENT) ./kpincdir/$${filename} r > \
228 ./kpincdir/$${filename_strip}; \
229 if [ -s ./kpincdir/$${filename_strip} ]; \
231 $(INSTALL) $(INSTALL_FLAGS) ./kpincdir/$${filename} $(dir $@);\
234 echo Header file $< not exported; \
237 setup_installhdrs_mi:
239 do_installhdrs_mi: $(INSTALL_MI_GEN_FILES) $(INSTALL_MI_GEN_LCL_FILES) $(INSTALL_KF_MI_GEN_FILES) $(INSTALL_KF_MI_LCL_GEN_FILES)
240 @true echo "[ $(SOURCE) ] make do_installhdrs_mi $(KERNEL_CONFIG) $(ARCH_CONFIG) $(TARGET)"
241 $(_v)$(MKDIR) ./incmidir ./pincmidir ./kincmidir ./kpincmidir; \
242 if [ -n "$(strip $(INSTALL_MI_LIST))" ]; then \
243 if [ -d $(DSTROOT)/$(INCDIR)/$(INSTALL_MI_DIR) ]; then \
244 (cd $(DSTROOT)/$(INCDIR)/$(INSTALL_MI_DIR);$(RM) $(RMFLAGS) $(INSTALL_MI_LIST) ); \
246 $(MKDIR) $(DSTROOT)/$(INCDIR)/$(INSTALL_MI_DIR); \
248 for j in $(INSTALL_MI_LIST); \
250 echo garbage > ./incmidir/$$j.strip; \
251 $(UNIFDEF) $(SINCFRAME_UNIFDEF) \
252 $(SOURCE)/$$j > ./incmidir/$$j || \
253 $(DECOMMENT) ./incmidir/$$j r > \
254 ./incmidir/$$j.strip; \
255 if [ -s ./incmidir/$$j.strip ]; \
257 $(INSTALL) $(INSTALL_FLAGS) ./incmidir/$$j $(DSTROOT)/$(INCDIR)/$(INSTALL_MI_DIR); \
260 echo Header file $$j not exported; \
264 if [ -n "$(strip $(INSTALL_MI_LCL_LIST))" ]; then \
265 if [ -d $(DSTROOT)/$(LCLDIR)/$(INSTALL_MI_DIR) ]; then \
266 (cd $(DSTROOT)/$(LCLDIR)/$(INSTALL_MI_DIR);$(RM) $(RMFLAGS) $(INSTALL_MI_LCL_LIST) ); \
268 $(MKDIR) $(DSTROOT)/$(LCLDIR)/$(INSTALL_MI_DIR); \
270 for j in $(INSTALL_MI_LCL_LIST); \
272 echo garbage > ./pincmidir/$$j.strip; \
273 $(UNIFDEF) $(SPINCFRAME_UNIFDEF) \
274 $(SOURCE)/$$j > ./pincmidir/$$j || \
275 $(DECOMMENT) ./pincmidir/$$j r > \
276 ./pincmidir/$$j.strip; \
277 if [ -s ./pincmidir/$$j.strip ]; \
279 $(INSTALL) $(INSTALL_FLAGS) ./pincmidir/$$j $(DSTROOT)/$(LCLDIR)/$(INSTALL_MI_DIR); \
282 echo Header file $$j not exported; \
286 if [ -n "$(strip $(INSTALL_KF_MI_LIST))" ]; then \
287 if [ -d $(DSTROOT)/$(KINCDIR)/$(EXPORT_MI_DIR) ]; then \
288 (cd $(DSTROOT)/$(KINCDIR)/$(EXPORT_MI_DIR);$(RM) $(RMFLAGS) $(INSTALL_KF_MI_LIST) ); \
290 $(MKDIR) $(DSTROOT)/$(KINCDIR)/$(EXPORT_MI_DIR); \
292 for j in $(INSTALL_KF_MI_LIST); \
294 echo garbage > ./kincmidir/$$j.strip; \
295 $(UNIFDEF) $(KINCFRAME_UNIFDEF) \
296 $(SOURCE)/$$j > ./kincmidir/$$j || \
297 $(DECOMMENT) ./kincmidir/$$j r > \
298 ./kincmidir/$$j.strip; \
299 if [ -s ./kincmidir/$$j.strip ]; \
301 $(INSTALL) $(INSTALL_FLAGS) ./kincmidir/$$j $(DSTROOT)/$(KINCDIR)/$(EXPORT_MI_DIR); \
304 echo Header file $$j not exported; \
308 if [ -n "$(strip $(INSTALL_KF_MI_LCL_LIST))" ]; then \
309 if [ -d $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MI_DIR) ]; then \
310 (cd $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MI_DIR);$(RM) $(RMFLAGS) $(INSTALL_KF_MI_LCL_LIST) ); \
312 $(MKDIR) $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MI_DIR); \
314 for j in $(INSTALL_KF_MI_LCL_LIST); \
316 echo garbage > ./kpincmidir/$$j.strip; \
317 $(UNIFDEF) $(KPINCFRAME_UNIFDEF) \
318 $(SOURCE)/$$j > ./kpincmidir/$$j || \
319 $(DECOMMENT) ./kpincmidir/$$j r > \
320 ./kpincmidir/$$j.strip; \
321 if [ -s ./kpincmidir/$$j.strip ]; \
323 $(INSTALL) $(INSTALL_FLAGS) ./kpincmidir/$$j $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MI_DIR); \
326 echo Header file $$j not exported; \
330 $(RM) -rf ./incmidir ./pincmidir ./kincmidir ./kpincmidir;
332 setup_installhdrs_md:
334 do_installhdrs_md: $(INSTALL_MD_GEN_INC_FILES) $(INSTALL_MD_GEN_LCL_FILES) $(INSTALL_KF_MD_GEN_FILES) $(INSTALL_KF_MD_LCL_GEN_FILES)
335 @true echo "[ $(SOURCE) ] make do_installhdrs_md $(KERNEL_CONFIG) $(ARCH_CONFIG) $(TARGET)"
336 $(_v)$(MKDIR) ./incdir ./pincdir ./kincdir ./kpincdir; \
337 if [ -n "$(strip $(INSTALL_MD_LIST))" ]; then \
338 if [ -d $(DSTROOT)/$(INCDIR)/$(INSTALL_MD_DIR) ]; then \
339 (cd $(DSTROOT)/$(INCDIR)/$(INSTALL_MD_DIR);$(RM) $(RMFLAGS) $(INSTALL_MD_LIST) ); \
341 $(MKDIR) $(DSTROOT)/$(INCDIR)/$(INSTALL_MD_DIR); \
343 for j in $(INSTALL_MD_LIST); \
345 echo garbage > ./incdir/$$j.strip; \
346 $(UNIFDEF) $(SINCFRAME_UNIFDEF) \
347 $(SOURCE)/$$j > ./incdir/$$j || \
348 $(DECOMMENT) ./incdir/$$j r > \
349 ./incdir/$$j.strip; \
350 if [ -s ./incdir/$$j.strip ]; \
352 $(INSTALL) $(INSTALL_FLAGS) ./incdir/$$j $(DSTROOT)/$(INCDIR)/$(INSTALL_MD_DIR); \
355 echo Header file $$j not exported; \
359 if [ -n "$(strip $(INSTALL_MD_LCL_LIST))" ]; then \
360 if [ -d $(DSTROOT)/$(LCLDIR)/$(INSTALL_MD_DIR) ]; then \
361 (cd $(DSTROOT)/$(LCLDIR)/$(INSTALL_MD_DIR);$(RM) $(RMFLAGS) $(INSTALL_MD_LCL_LIST) ); \
363 $(MKDIR) $(DSTROOT)/$(LCLDIR)/$(INSTALL_MD_DIR); \
365 for j in $(INSTALL_MD_LCL_LIST); \
367 echo garbage > ./pincdir/$$j.strip; \
368 $(UNIFDEF) $(SPINCFRAME_UNIFDEF) \
369 $(SOURCE)/$$j > ./pincdir/$$j || \
370 $(DECOMMENT) ./pincdir/$$j r > \
371 ./pincdir/$$j.strip; \
372 if [ -s ./pincdir/$$j.strip ]; \
374 $(INSTALL) $(INSTALL_FLAGS) ./pincdir/$$j $(DSTROOT)/$(LCLDIR)/$(INSTALL_MD_DIR); \
377 echo Header file $$j not exported; \
381 if [ -n "$(strip $(INSTALL_KF_MD_LIST))" ]; then \
382 if [ -d $(DSTROOT)/$(KINCDIR)/$(EXPORT_MD_DIR) ]; then \
383 (cd $(DSTROOT)/$(KINCDIR)/$(EXPORT_MD_DIR);$(RM) $(RMFLAGS) $(INSTALL_KF_MD_LIST) ); \
385 $(MKDIR) $(DSTROOT)/$(KINCDIR)/$(EXPORT_MD_DIR); \
387 for j in $(INSTALL_KF_MD_LIST); \
389 echo garbage > ./kincdir/$$j.strip; \
390 $(UNIFDEF) $(KINCFRAME_UNIFDEF) \
391 $(SOURCE)/$$j > ./kincdir/$$j || \
392 $(DECOMMENT) ./kincdir/$$j r > \
393 ./kincdir/$$j.strip; \
394 if [ -s ./kincdir/$$j.strip ]; \
396 $(INSTALL) $(INSTALL_FLAGS) ./kincdir/$$j $(DSTROOT)/$(KINCDIR)/$(EXPORT_MD_DIR); \
399 echo Header file $$j not exported; \
403 if [ -n "$(strip $(INSTALL_KF_MD_LCL_LIST))" ]; then \
404 if [ -d $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MD_DIR) ]; then \
405 (cd $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MD_DIR);$(RM) $(RMFLAGS) $(INSTALL_KF_MD_LCL_LIST) ); \
407 $(MKDIR) $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MD_DIR); \
409 for j in $(INSTALL_KF_MD_LCL_LIST); \
411 echo garbage > ./kpincdir/$$j.strip; \
412 $(UNIFDEF) $(KPINCFRAME_UNIFDEF) \
413 $(SOURCE)/$$j > ./kpincdir/$$j || \
414 $(DECOMMENT) ./kpincdir/$$j r > \
415 ./kpincdir/$$j.strip; \
416 if [ -s ./kpincdir/$$j.strip ]; \
418 $(INSTALL) $(INSTALL_FLAGS) ./kpincdir/$$j $(DSTROOT)/$(KPINCDIR)/$(EXPORT_MD_DIR); \
421 echo Header file $$j not exported; \
425 $(RM) -rf ./incdir ./pincdir ./kincdir ./kpincdir;
429 # Generic Export rules
431 ifeq ($(INCR_EXPORTHDRS), TRUE)
433 EXPORT_MI_INC_FILES = $(addprefix $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR)/, $(EXPORT_MI_LIST))
434 EXPORT_MI_GEN_INC_FILES = $(addprefix $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR)/, $(EXPORT_MI_GEN_LIST))
436 $(EXPORT_MI_INC_FILES) $(EXPORT_MI_GEN_INC_FILES): $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR)/% : %
437 @true echo Exporting $< in $(dir $@)
438 $(_v)[ -d $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR) ] ||$(MKDIR) $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR); \
439 ${CP} -p $< $(dir $@); \
442 EXPORT_MD_INC_FILES = $(addprefix $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR)/, $(EXPORT_MD_LIST))
443 EXPORT_MD_GEN_INC_FILES = $(addprefix $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR)/, $(EXPORT_MD_GEN_LIST))
445 $(EXPORT_MD_INC_FILES) $(EXPORT_MD_GEN_INC_FILES): $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR)/% : %
446 @true echo Exporting $< in $(dir $@)
447 $(_v)[ -d $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR) ] ||$(MKDIR) $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR); \
448 ${CP} -p $< $(dir $@); \
452 do_exporthdrs_mi: $(EXPORT_MI_INC_FILES) $(EXPORT_MI_GEN_INC_FILES)
453 @true echo "[ $(SOURCE) ] make do_exporthdrs_mi $(KERNEL_CONFIG) $(ARCH_CONFIG) $(TARGET)"
457 do_exporthdrs_md: $(EXPORT_MD_INC_FILES) $(EXPORT_MD_GEN_INC_FILES)
458 @true echo "[ $(SOURCE) ] make do_exporthdrs_md $(KERNEL_CONFIG) $(ARCH_CONFIG) $(TARGET)"
462 EXPORT_MI_INC_FILES = $(addprefix $(SOURCE), $(EXPORT_MI_LIST))
463 EXPORT_MI_GEN_INC_FILES = $(addprefix $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR)/, $(EXPORT_MI_GEN_LIST))
465 $(EXPORT_MI_GEN_INC_FILES): $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR)/% : %
466 @true echo Exporting $< in $(dir $@)
467 $(_v)[ -d $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR) ] ||$(MKDIR) $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR); \
468 ${CP} -p $< $(dir $@); \
471 EXPORT_MD_INC_FILES = $(addprefix $(SOURCE), $(EXPORT_MD_LIST))
472 EXPORT_MD_GEN_INC_FILES = $(addprefix $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR)/, $(EXPORT_MD_GEN_LIST))
474 $(EXPORT_MD_GEN_INC_FILES): $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR)/% : %
475 @true echo Exporting $< in $(dir $@)
476 $(_v)[ -d $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR) ] ||$(MKDIR) $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR); \
477 ${CP} -p $< $(dir $@); \
481 do_exporthdrs_mi: $(EXPORT_MI_GEN_INC_FILES)
482 @true echo "[ $(SOURCE) ] make do_exporthdrs_mi $(KERNEL_CONFIG) $(ARCH_CONFIG) $(TARGET)"
483 $(_v)if [ -n "$(strip $(EXPORT_MI_LIST))" ]; then \
484 if [ -d $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR) ]; then \
485 (cd $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR);$(RM) $(RMFLAGS) $(EXPORT_MI_LIST) ); \
487 $(MKDIR) $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR); \
489 ${CP} -p $(EXPORT_MI_INC_FILES) $(OBJROOT)/$(EXPDIR)/$(EXPORT_MI_DIR); \
494 do_exporthdrs_md: $(EXPORT_MD_GEN_INC_FILES)
495 @true echo "[ $(SOURCE) ] make do_exporthdrs_md $(KERNEL_CONFIG) $(ARCH_CONFIG) $(TARGET)"
496 $(_v)if [ -n "$(strip $(EXPORT_MD_LIST))" ]; then \
497 if [ -d $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR) ]; then \
498 (cd $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR);$(RM) $(RMFLAGS) $(EXPORT_MD_LIST) ); \
500 $(MKDIR) $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR); \
502 ${CP} -p $(EXPORT_MD_INC_FILES) $(OBJROOT)/$(EXPDIR)/$(EXPORT_MD_DIR); \
509 # Generic Compilation rules
513 # Compilation rules to generate .o from .s
516 COMP_SOBJ_FILES = $(addprefix $(TARGET)$(COMP_OBJ_DIR), $(COMP_SOBJ_LIST))
518 $(COMP_SOBJ_FILES): $(TARGET)$(COMP_OBJ_DIR)%.o : %.s
519 ${S_KCC} -E -MD ${SFLAGS} -DASSEMBLER $(INCFLAGS) $< > $(patsubst %.o, %.pp, ${@});
520 sed '/^\#/d' $(patsubst %.o, %.pp, ${@}) > $(patsubst %.o, %.s, ${@});
521 ${S_KCC} ${SFLAGS} ${_HOST_AS_FLAGS} -c $(patsubst %.o, %.s, ${@});
522 ${RM} ${_RMFLAGS_} $(patsubst %.o, %.pp, ${@}) $(patsubst %.o,%.s,${@});
525 S_RULE_1B= ${patsubst %.o,%.s,${@}} > /dev/null
526 S_RULE_2=$(_v)${S_KCC} -E -MD ${SFLAGS} -DASSEMBLER $(INCFLAGS) $< \
527 > $(patsubst %.o, %.pp, ${@}); \
528 sed '/^\#/d' $(patsubst %.o, %.pp, ${@}) > $(patsubst %.o, %.s, ${@});
529 ifeq ($(BUILD_STABS),1)
530 S_RULE_3=$(_v)${S_KCC} ${SFLAGS} ${_HOST_AS_FLAGS} -c $(patsubst %.o, %.s, ${@});\
531 ${RM} ${_RMFLAGS_} $(patsubst %.o, %.pp, ${@}) $(patsubst %.o,%.s,${@});
533 S_RULE_3=$(_v)${S_KCC} ${SFLAGS} ${_HOST_AS_FLAGS} -c $(patsubst %.o, %.s, ${@});\
534 ${RM} ${_RMFLAGS_} $(patsubst %.o, %.pp, ${@}) $(patsubst %.o,%.s,${@});\
535 ${CTFCONVERT} -l xnu -v -o $(TARGET)$(COMP_OBJ_DIR)/$(KERNEL_CONFIG)/$@.ctf $@ > /dev/null && $(CTFSCRUB) `cat $(SRCROOT)/config/DtraceIgnored.symbols` $(TARGET)$(COMP_OBJ_DIR)/$(KERNEL_CONFIG)/$@.ctf || true;
536 S_RULE_4=@echo ASM $@
540 # Compilation rules to generate .o from .c for normal files
541 C_RULE_1A=$(_v)${KCC} -c ${filter-out ${${join $@,_CFLAGS_RM}}, ${CFLAGS} ${CWARNFLAGS}} -MD ${${join $@,_CFLAGS_ADD}} ${INCFLAGS} ${${join $@,_INCFLAGS}}
544 ifeq ($(BUILD_STABS),1)
547 C_RULE_3=$(_v)${CTFCONVERT} -l xnu -v -o $(TARGET)$(COMP_OBJ_DIR)/$(KERNEL_CONFIG)/$@.ctf $@ > /dev/null && $(CTFSCRUB) `cat $(SRCROOT)/config/DtraceIgnored.symbols` $(TARGET)$(COMP_OBJ_DIR)/$(KERNEL_CONFIG)/$@.ctf || true;
552 # Compilation rules to generate .o from .c for driver files
554 C_RULE_1A_D=${C_RULE_1A}
555 C_RULE_1B_D=${C_RULE_1B}
556 C_RULE_2_D=${C_RULE_2}
557 C_RULE_3_D=${C_RULE_3}
558 C_RULE_4_D=${C_RULE_4}
561 # Compilation rules to generate .o from .m
563 M_RULE_1A=$(_v)${KCC} -c ${filter-out ${${join $@,_CFLAGS_RM}}, ${CFLAGS} ${MWARNFLAGS}} -MD ${${join $@,_CFLAGS_ADD}} ${INCFLAGS} ${${join $@,_INCFLAGS}}
570 # Compilation rules to generate .co from .cp or .cpo from .cpp
571 # The config tool slickly changes the last source filename char to 'o'
572 # for the object filename.
573 P_RULE_1A=$(_v)${KC++} -o $@ -c ${CXXFLAGS} ${filter-out ${${join $@,_CFLAGS_RM}}, ${CFLAGS} ${CXXWARNFLAGS}} -MD ${${join $@,_CFLAGS_ADD}} ${INCFLAGS} ${${join $@,_INCFLAGS}}
575 P_RULE_2=$(_v)sed 's/.c.o: /.cpo: /' $(@:.cpo=.d) > $(@:.cpo=.d~) && mv $(@:.cpo=.d~) $(@:.cpo=.d)
576 P_RULE_3=@echo C++ $@
577 ifeq ($(BUILD_STABS),1)
580 P_RULE_4=$(_v)${CTFCONVERT} -l xnu -v -o $(TARGET)$(COMP_OBJ_DIR)/$(KERNEL_CONFIG)/$@.ctf $@ > /dev/null && $(CTFSCRUB) `cat $(SRCROOT)/config/DtraceIgnored.symbols` $(TARGET)$(COMP_OBJ_DIR)/$(KERNEL_CONFIG)/$@.ctf || true;
585 # Linker rule to generate a component
587 LD_COMPONENT_OBJ_FILES = $(addprefix $(TARGET)$(COMP_OBJ_DIR), $(LD_COMPONENT_OBJ_LIST))
589 COMPONENT_IMAGE_FILE = $(addprefix $(TARGET), $(COMPONENT_IMAGE))
591 $(COMPONENT_IMAGE_FILE): $(LD_COMPONENT_OBJ_FILES)
593 $(_v)$(LD) $(LDFLAGS_COMPONENT) -o $(COMPONENT_IMAGE_FILE) ${LD_COMPONENT_OBJ_FILES};
594 $(_v)(cd $(TARGET)$(COMP_OBJ_DIR); ${MD} -u Makedep -f -d `ls *.d`);
598 do_build_all: $(COMP_FILES) $(COMP_COBJ_FILES) $(COMP_SOBJ_FILES) $(COMPONENT_IMAGE_FILE)
600 ifeq ($(COMPONENT), .)
601 do_build_all: do_build_mach_kernel
605 # mach_kernel building rules
607 do_build_mach_kernel: $(OBJPATH)/kgmacros
608 $(_v)$(INSTALL) $(DATA_INSTALL_FLAGS) $(SRCROOT)/config/version.c $(OBJPATH)/version.c;
609 $(_v)$(SRCROOT)/config/newvers.pl $(OBJPATH)/version.c > /dev/null;
611 $(_v)${KCC} -c ${filter-out ${${join $@,_CFLAGS_RM}}, ${CFLAGS}} ${${join $@,_CFLAGS_ADD}} ${INCFLAGS} ${${join $@,_INCFLAGS}} $(OBJPATH)/version.c -o $(OBJPATH)/version.o
612 @echo LD mach_kernel.sys
613 $(_v)$(LD) $(LDFLAGS_KERNEL) $(addprefix $(TARGET)/,$(foreach component,$(COMPONENT_LIST), $(addprefix $(component)/$(firstword $($(addsuffix _KERNEL_CONFIG, $(shell printf $(component) | tr a-z A-Z))) $(KERNEL_CONFIG))/, $(addsuffix .o, $(component))))) $(OBJPATH)/version.o -o $(TARGET)/mach_kernel.sys $(LD_KERNEL_LIBS)
614 @echo DSYMUTIL mach_kernel.sys
615 $(_v)if [ $(BUILD_DWARF) -eq 1 ]; then \
616 $(DSYMUTIL) $(DSYMUTIL_FLAGS) $(TARGET)/mach_kernel.sys -o $(TARGET)/mach_kernel.sys.dSYM > /dev/null; \
618 @echo STRIP mach_kernel
619 $(_v)$(STRIP) $(STRIP_FLAGS) $(TARGET)/mach_kernel.sys -o $(TARGET)/mach_kernel
621 $(OBJPATH)/kgmacros: $(SRCROOT)/kgmacros
622 $(_v)$(INSTALL) $(INSTALL_FLAGS) $? $@
624 # Special rules to install machine configuration variants
626 $(DSTROOT)$(INSTALL_FILE_DIR)mach.$(KERNEL_CONFIG_LC).$(MACHINE_CONFIG_LC): $(TARGET)/mach_kernel force_file_install
627 @echo Installing $< in $@;
628 $(_v)if [ ! -e $(DSTROOT)$(INSTALL_FILE_DIR) ]; then \
629 $(MKDIR) $(DSTROOT)$(INSTALL_FILE_DIR); \
631 if [ "`echo $(INSTALL_ARCHS_LC) | wc -w`" -eq 1 ]; then \
632 $(RM) $(RMFLAGS) $@; \
633 $(INSTALL) $(FILE_INSTALL_FLAGS) $< $@; \
635 if [ ! -e $@ ]; then \
636 echo >empty_file_$(notdir $@); \
637 lipo_arg="$(subst _empty_file, empty_file_$(notdir $@),$(foreach lipo_arch,$(INSTALL_ARCHS_LC), $(addprefix -arch , $(addsuffix _empty_file, $(lipo_arch)))))"; \
638 $(LIPO) $${lipo_arg} -create -output $@; \
639 $(RM) $(RMFLAGS) empty_file_$(notdir $@); \
641 $(LIPO) $@ -replace $(ARCH_CONFIG_LC) $< -o $@; \
643 if [ $(BUILD_DWARF) -eq 1 ]; then \
644 if [ "`echo $(INSTALL_ARCHS_LC) | wc -w`" -eq 1 ]; then \
645 $(CP) -f $< $<.ctfsys; \
646 $(FIND) $(OBJPATH)/ -name \*.ctf -size 0 \
647 -exec $(RM) -rf {} \; ; \
648 $(CTFMERGE) -l xnu -o $<.ctfsys \
649 $(OBJPATH)/*/$(KERNEL_CONFIG)/*.*o.ctf || true; \
650 $(INSTALL) $(FILE_INSTALL_FLAGS) $<.ctfsys $@.ctfsys; \
652 if [ ! -e $@.ctfsys ]; then \
653 echo >empty_file_$(notdir $@); \
654 lipo_arg="$(subst _empty_file, empty_file_$(notdir $@),$(foreach lipo_arch,$(INSTALL_ARCHS_LC), $(addprefix -arch , $(addsuffix _empty_file, $(lipo_arch)))))"; \
655 $(LIPO) $${lipo_arg} -create -output $@.ctfsys;\
656 $(RM) $(RMFLAGS) empty_file_$(notdir $@);\
658 $(FIND) $(OBJPATH)/ -name \*.ctf -size 0 \
659 -exec $(RM) -rf {} \; ; \
660 $(CP) -f $< $<.ctfsys; \
661 $(CTFMERGE) -l xnu -o $<.ctfsys \
662 $(OBJPATH)/*/$(KERNEL_CONFIG)/*.*o.ctf || true; \
663 $(LIPO) $@.ctfsys -replace $(ARCH_CONFIG_LC) \
664 $<.ctfsys -o $@.ctfsys; \
668 $(SYMROOT)$(INSTALL_FILE_DIR)mach.$(KERNEL_CONFIG_LC).$(MACHINE_CONFIG_LC): $(TARGET)/mach_kernel.sys force_file_install
669 @echo Installing $< in $@;
670 $(_v)if [ ! -e $(SYMROOT)$(INSTALL_FILE_DIR) ]; then \
671 $(MKDIR) $(SYMROOT)$(INSTALL_FILE_DIR); \
673 if [ "`echo $(INSTALL_ARCHS_LC) | wc -w`" -eq 1 ]; then \
674 $(RM) $(RMFLAGS) $@; \
675 $(INSTALL) $(FILE_INSTALL_FLAGS) $< $@; \
676 if [ $(BUILD_DWARF) -eq 1 ]; then \
678 $(MKDIR) -p -m 0755 $@.dSYM/$(DSYMBUILDDIR); \
679 $(INSTALL) $(INSTALL_FLAGS) \
680 $<.dSYM/$(DSYMBUILDDIR)/$(notdir $<) \
681 $@.dSYM/$(DSYMBUILDDIR)/$(notdir $@); \
684 if [ ! -e $@ ]; then \
685 echo >empty_file_$(notdir $@); \
686 lipo_arg="$(subst _empty_file, empty_file_$(notdir $@),$(foreach lipo_arch,$(INSTALL_ARCHS_LC), $(addprefix -arch , $(addsuffix _empty_file, $(lipo_arch)))))"; \
687 $(LIPO) $${lipo_arg} -create -output $@; \
688 $(RM) $(RMFLAGS) empty_file_$(notdir $@); \
690 $(LIPO) $@ -replace $(ARCH_CONFIG_LC) $< -o $@; \
695 # Generic Install rules
697 INSTALL_FILE_FILES = $(addprefix $(DSTROOT)$(INSTALL_FILE_DIR), $(INSTALL_FILE_LIST))
698 INSTALL_FILE_FILES_GENERIC = $(filter-out $(DSTROOT)$(INSTALL_FILE_DIR)mach.$(KERNEL_CONFIG_LC).$(MACHINE_CONFIG_LC), $(INSTALL_FILE_FILES))
702 $(INSTALL_FILE_FILES_GENERIC): $(DSTROOT)$(INSTALL_FILE_DIR)% : $(TARGET)/% force_file_install
703 @echo Installing $< in $@;
704 $(_v)if [ ! -e $(DSTROOT)$(INSTALL_FILE_DIR) ]; then \
705 $(MKDIR) $(DSTROOT)$(INSTALL_FILE_DIR); \
707 if [ "`echo $(INSTALL_ARCHS_LC) | wc -w`" -eq 1 ]; then \
708 $(RM) $(RMFLAGS) $@; \
709 if [ $(MACHINE_CONFIG) = DEFAULT ]; then \
710 $(INSTALL) $(FILE_INSTALL_FLAGS) $< $@; \
713 if [ ! -e $@ ]; then \
714 echo >empty_file_$(notdir $@); \
715 lipo_arg="$(subst _empty_file, empty_file_$(notdir $@),$(foreach lipo_arch,$(INSTALL_ARCHS_LC), $(addprefix -arch , $(addsuffix _empty_file, $(lipo_arch)))))"; \
716 $(LIPO) $${lipo_arg} -create -output $@; \
717 $(RM) $(RMFLAGS) empty_file_$(notdir $@); \
719 $(LIPO) $@ -replace $(ARCH_CONFIG_LC) $< -o $@; \
721 if [ $(BUILD_DWARF) -eq 1 ]; then \
722 if [ "`echo $(INSTALL_ARCHS_LC) | wc -w`" -eq 1 ]; then \
723 $(CP) -f $< $<.ctfsys; \
724 $(FIND) $(OBJPATH)/ -name \*.ctf -size 0 \
725 -exec $(RM) -rf {} \; ; \
726 $(CTFMERGE) -l xnu -o $<.ctfsys \
727 $(OBJPATH)/*/$(KERNEL_CONFIG)/*.*o.ctf || true; \
728 if [ $(MACHINE_CONFIG) = DEFAULT ]; then \
729 $(INSTALL) $(FILE_INSTALL_FLAGS) $<.ctfsys $(dir $@); \
732 if [ ! -e $@.ctfsys ]; then \
733 echo >empty_file_$(notdir $@); \
734 lipo_arg="$(subst _empty_file, empty_file_$(notdir $@),$(foreach lipo_arch,$(INSTALL_ARCHS_LC), $(addprefix -arch , $(addsuffix _empty_file, $(lipo_arch)))))"; \
735 $(LIPO) $${lipo_arg} -create -output $@.ctfsys;\
736 $(RM) $(RMFLAGS) empty_file_$(notdir $@);\
738 $(FIND) $(OBJPATH)/ -name \*.ctf -size 0 \
739 -exec $(RM) -rf {} \; ; \
740 $(CP) -f $< $<.ctfsys; \
741 $(CTFMERGE) -l xnu -o $<.ctfsys \
742 $(OBJPATH)/*/$(KERNEL_CONFIG)/*.*o.ctf || true; \
743 $(LIPO) $@.ctfsys -replace $(ARCH_CONFIG_LC) \
744 $<.ctfsys -o $@.ctfsys; \
748 INSTALL_FILESYS_FILES = $(addprefix $(SYMROOT)$(INSTALL_FILE_DIR), $(INSTALL_FILE_LIST))
749 INSTALL_FILESYS_FILES_GENERIC = $(filter-out $(SYMROOT)$(INSTALL_FILE_DIR)mach.$(KERNEL_CONFIG_LC).$(MACHINE_CONFIG_LC), $(INSTALL_FILESYS_FILES))
751 force_filesys_install:
753 $(INSTALL_FILESYS_FILES_GENERIC): $(SYMROOT)$(INSTALL_FILE_DIR)% : $(TARGET)/%.sys force_filesys_install
754 @echo Installing $< in $@;
755 $(_v)if [ ! -e $(SYMROOT)$(INSTALL_FILE_DIR) ]; then \
756 $(MKDIR) $(SYMROOT)$(INSTALL_FILE_DIR); \
758 if [ "`echo $(INSTALL_ARCHS_LC) | wc -w`" -eq 1 ]; then \
759 $(RM) $(RMFLAGS) $@; \
760 $(INSTALL) $(INSTALL_FLAGS) $< $@; \
761 if [ $(BUILD_DWARF) -eq 1 ]; then \
762 $(DSYMUTIL) $(DSYMUTIL_FLAGS) \
763 $(TARGET)/mach_kernel.sys \
764 -o $(TARGET)/mach_kernel.sys.dSYM; \
766 $(MKDIR) -p -m 0755 $@.dSYM/$(DSYMBUILDDIR); \
767 $(INSTALL) $(INSTALL_FLAGS) \
768 $<.dSYM/$(DSYMBUILDDIR)/$(notdir $<) \
769 $@.dSYM/$(DSYMBUILDDIR)/$(notdir $@); \
772 if [ ! -e $@ ]; then \
773 echo >empty_filesys_$(notdir $@); \
774 lipo_arg="$(subst _empty_file, empty_filesys_$(notdir $@),$(foreach lipo_arch,$(INSTALL_ARCHS_LC), $(addprefix -arch , $(addsuffix _empty_file, $(lipo_arch)))))"; \
775 $(LIPO) $${lipo_arg} -create -output $@; \
776 $(RM) $(RMFLAGS) empty_filesys_$(notdir $@); \
778 $(LIPO) $@ -replace $(ARCH_CONFIG_LC) $< -o $@; \
780 if [ $(BUILD_DWARF) -eq 1 ]; then \
781 if [ ! -e $@.dSYM/$(DSYMBUILDDIR)/$(notdir $@) ]; then \
782 echo >empty_filesys_$(notdir $@); \
783 lipo_arg="$(subst _empty_file, empty_filesys_$(notdir $@),$(foreach lipo_arch,$(INSTALL_ARCHS_LC), $(addprefix -arch , $(addsuffix _empty_file, $(lipo_arch)))))"; \
784 $(MKDIR) -p -m 0755 $@.dSYM/$(DSYMBUILDDIR); \
785 $(LIPO) $${lipo_arg} -create \
787 $@.dSYM/$(DSYMBUILDDIR)/$(notdir $@); \
788 $(RM) $(RMFLAGS) empty_filesys_$(notdir $@); \
790 $(DSYMUTIL) $(DSYMUTIL_FLAGS) \
791 $(TARGET)/mach_kernel.sys \
792 -o $(TARGET)/mach_kernel.sys.dSYM; \
793 $(LIPO) $@.dSYM/$(DSYMBUILDDIR)/$(notdir $@) \
794 -replace $(ARCH_CONFIG_LC) \
795 $<.dSYM/$(DSYMBUILDDIR)/$(notdir $<) \
796 -o $@.dSYM/$(DSYMBUILDDIR)/$(notdir $@); \
799 $(INSTALL) $(INSTALL_FLAGS) $(SOURCE)kgmacros $(SYMROOT)$(INSTALL_FILE_DIR)
801 INSTALL_DATA_FILES = $(addprefix $(DSTROOT)$(INSTALL_DATA_DIR), $(INSTALL_DATA_LIST))
803 $(INSTALL_DATA_FILES): $(DSTROOT)$(INSTALL_DATA_DIR)% : $(SOURCE)/%
804 @echo Installing $< in $@;
805 $(_v)[ -d $(dir $@) ] ||$(MKDIR) $(dir $@); \
806 $(RM) $(RMFLAGS) $@; \
807 $(INSTALL) $(DATA_INSTALL_FLAGS) $< $(dir $@);
810 @echo "[ $(SOURCE) ] make setup_build_install $(KERNEL_CONFIG) $(ARCH_CONFIG) $(TARGET)"
812 do_build_install: $(INSTALL_FILESYS_FILES) $(INSTALL_FILE_FILES) $(INSTALL_DATA_FILES)
813 @echo "[ $(SOURCE) ] make do_build_install $(KERNEL_CONFIG) $(ARCH_CONFIG) $(TARGET)"
815 INSTALL_MAN_FILES = $(addprefix $(DSTROOT)/$(MANDIR)/$(INSTALL_MAN_DIR)/, $(INSTALL_MAN_LIST))
817 do_installman: $(INSTALL_MAN_FILES)
818 @echo "[ $(SOURCE) ] make do_installman"
819 $(_v)if [ -n "$(strip $(INSTALL_MAN_LIST))" ]; then \
820 man_dir=$(DSTROOT)/$(MANDIR)/$(INSTALL_MAN_DIR); \
821 if [ -d $$man_dir ]; then \
823 $(RM) $(RMFLAGS) $(INSTALL_MAN_LIST) $(INSTALL_MAN_LINKS)); \
825 $(MKDIR) $$man_dir; \
827 echo Installing $(INSTALL_MAN_LIST) in $$man_dir; \
828 $(INSTALL) $(INSTALL_FLAGS) $(INSTALL_MAN_LIST) $$man_dir; \
829 if [ -n "$(strip $(INSTALL_MAN_LINKS))" ]; then \
830 set `echo ${INSTALL_MAN_LINKS}`; \
834 1) echo "warn: empty INSTALL_MAN_LINKS: $$1"; break;; \
836 link_src=$$1; shift; link_dst=$$1; shift; \
837 echo "hard linking $${link_src} to $${link_dst}"; \
838 ln -f $${man_dir}/$${link_src} $${man_dir}/$${link_dst} ; \
843 $(INSTALL_MAN_FILES): $(DSTROOT)/$(MANDIR)/$(INSTALL_MAN_DIR)/% : %
844 @true echo Installing $< in $(dir $@)
845 $(_v)$(MKDIR) $(DSTROOT)/$(MANDIR)/$(INSTALL_MAN_DIR); \
846 $(RM) $(RMFLAGS) $@; \
847 $(INSTALL) $(INSTALL_FLAGS) $< $(dir $@);
849 ifeq ($(INCL_MAKEDEP), TRUE)