2 # Mach Operating System
3 # Copyright (c) 1986 Carnegie-Mellon University
4 # All rights reserved. The CMU software License Agreement specifies
5 # the terms and conditions for use and redistribution.
8 export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
9 export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
10 export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
11 export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
13 include $(MakeInc_cmd)
14 include $(MakeInc_def)
19 CFLAGS+= -include meta_features.h -DMACH_KERNEL_PRIVATE -DMACH_KERNEL
21 # Objects that don't want -Wcast-align warning (8474835)
22 OBJS_NO_CAST_ALIGN = \
23 atm_notification_user.o \
70 ccdigest_final_64be.o \
78 # Objects that don't want -Wsign-compare warning (15294427)
79 OBJS_NO_SIGN_COMPARE = \
80 atm_notification_user.o
82 $(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align)))
83 $(foreach file,$(OBJS_NO_SIGN_COMPARE),$(eval $(call add_perfile_cflags,$(file),-Wno-sign-compare)))
86 # Do not provide CTF symbolic these files
88 chud_glue.o_SKIP_CTFCONVERT = 1
91 # XXX: INCFLAGS to include libsa prototypes
93 INCFLAGS_MAKEFILE= -I$(SOURCE)libsa
96 # Directories for mig generated files
109 # Make sure we don't remove this by accident if interrupted at the wrong
115 # Theses macros are filled in by the config program depending on the
116 # current configuration. The MACHDEP macro is replaced by the
117 # contents of the machine dependent makefile template and the others
118 # are replaced by the corresponding symbol definitions for the
132 # Rebuild if per-file overrides change
133 ${OBJS}: $(firstword $(MAKEFILE_LIST))
135 # Rebuild if global compile flags change
138 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
139 $(CXXOBJS): .CXXFLAGS
141 $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
144 $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
146 $(COMPONENT).filelist: $(OBJS)
147 $(_v)for hib_file in ${HIB_FILES}; \
149 $(SEG_HACK) -n __HIB -o $${hib_file}__ $${hib_file} ; \
150 mv $${hib_file}__ $${hib_file} ; \
152 @echo LDFILELIST $(COMPONENT)
153 $(_v)( for obj in ${OBJS}; do \
154 echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
155 done; ) > $(COMPONENT).filelist
157 do_all: $(COMPONENT).filelist
159 do_build_all:: do_all
161 # genassym.o actually is an assembly file,
162 # we name it genassym.o to help with the automatic
163 # dependency generation
165 GENASSYM_LOCATION = $(CURRENT_ARCH_CONFIG_LC)
167 ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64)
168 GENASSYM_LOCATION = i386
169 else ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64h)
170 GENASSYM_LOCATION = i386
174 genassym.o: .CFLAGS $(firstword $(MAKEFILE_LIST))
175 genassym.o: $(SOURCE_DIR)/$(COMPONENT)/$(GENASSYM_LOCATION)/genassym.c
177 $(_v)${KCC} ${CFLAGS} ${CFLAGS_NOLTO_FLAG} -MD -S -o ${@} ${INCFLAGS} $<
180 $(_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 > $@
186 include $(MakeInc_rule)
187 include $(MakeInc_dir)