#
# XXX: CFLAGS
#
-CFLAGS+= -imacros meta_features.h -DMACH_KERNEL_PRIVATE $(CFLAGS_INLINE_CONFIG)
+CFLAGS+= -include meta_features.h -DMACH_KERNEL_PRIVATE $(CFLAGS_INLINE_CONFIG)
#
# Directories for mig generated files
LDOBJS = $(OBJS)
-$(COMPONENT).o: $(LDOBJS) assym.s
- $(_v)for hib_file in ${HIB_FILES}; \
+$(COMPONENT).filelist: $(LDOBJS) assym.s
+ $(_v)if [ $(BUILD_MACHO_OBJ) -eq 1 ]; then \
+ for hib_file in ${HIB_FILES}; \
do \
$(SEG_HACK) __HIB $${hib_file} -o $${hib_file}__; \
mv $${hib_file}__ $${hib_file} ; \
- done;
+ done; \
+ fi
@echo LDFILELIST $(COMPONENT)
$(_v)( for obj in ${LDOBJS}; do \
echo $(TARGET)$(COMP_OBJ_DIR)/$(KERNEL_CONFIG)/$${obj}; \
- done; ) > $(COMPONENT).o
+ done; ) > $(COMPONENT).filelist
-do_all: $(COMPONENT).o
+do_all: $(COMPONENT).filelist
do_depend: do_all
$(_v)${MD} -u Makedep -f -d `ls *.d`;
# we name it genassym.o to help with the automatic
# dependency generation
-genassym.o: $(SOURCE_DIR)/$(COMPONENT)/$(ARCH_CONFIG_LC)/genassym.c
- $(_v)${KCC} ${CFLAGS} -MD ${_HOST_EXTRA_CFLAGS} -S -o ${@} -c ${INCFLAGS} $<
+GENASSYM_LOCATION = $(ARCH_CONFIG_LC)
+
+ifeq ($(ARCH_CONFIG_LC),x86_64)
+GENASSYM_LOCATION = i386
+endif
+
+genassym.o: $(SOURCE_DIR)/$(COMPONENT)/$(GENASSYM_LOCATION)/genassym.c
+ $(_v)${KCC} $(subst -flto,,${CFLAGS}) -MD ${_HOST_EXTRA_CFLAGS} -S -o ${@} -c ${INCFLAGS} $<
assym.s: genassym.o
$(_v)sed -e '/#DEFINITION#/!d' -e 's/^.*#DEFINITION#//' -e 's/\$$//' -e 'p' -e 's/#//2' -e 's/[^A-Za-z0-9_]*\([A-Za-z0-9_]*\)/ \1_NUM/2' genassym.o > ${@}