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 \
68 ccdigest_final_64be.o \
83 # Objects that don't want -Wsign-compare warning (15294427)
84 OBJS_NO_SIGN_COMPARE = \
85 atm_notification_user.o
87 $(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align)))
88 $(foreach file,$(OBJS_NO_SIGN_COMPARE),$(eval $(call add_perfile_cflags,$(file),-Wno-sign-compare)))
91 # Do not provide CTF symbolic these files
93 chud_glue.o_SKIP_CTFCONVERT = 1
96 # XXX: INCFLAGS to include libsa prototypes
98 INCFLAGS_MAKEFILE= -I$(SOURCE)libsa
101 # Directories for mig generated files
114 # Make sure we don't remove this by accident if interrupted at the wrong
120 # Theses macros are filled in by the config program depending on the
121 # current configuration. The MACHDEP macro is replaced by the
122 # contents of the machine dependent makefile template and the others
123 # are replaced by the corresponding symbol definitions for the
137 # Rebuild if per-file overrides change
138 ${OBJS}: $(firstword $(MAKEFILE_LIST))
140 # Rebuild if global compile flags change
143 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
144 $(CXXOBJS): .CXXFLAGS
146 $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
149 $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
151 $(COMPONENT).filelist: $(OBJS)
152 $(_v)for hib_file in ${HIB_FILES}; \
154 $(SEG_HACK) -n __HIB -o $${hib_file}__ $${hib_file} || exit 1; \
155 mv $${hib_file}__ $${hib_file} || exit 1; \
157 @echo "$(ColorL)LDFILELIST$(Color0) $(ColorLF)$(COMPONENT)$(Color0)"
158 $(_v)for obj in ${OBJS}; do \
159 echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
160 done > $(COMPONENT).filelist
162 do_all: $(COMPONENT).filelist
164 do_build_all:: do_all
166 # genassym.o actually is an assembly file,
167 # we name it genassym.o to help with the automatic
168 # dependency generation
170 GENASSYM_LOCATION = $(CURRENT_ARCH_CONFIG_LC)
172 ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64)
173 GENASSYM_LOCATION = i386
174 else ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64h)
175 GENASSYM_LOCATION = i386
179 genassym.o: .CFLAGS $(firstword $(MAKEFILE_LIST))
180 genassym.o: $(SOURCE_DIR)/$(COMPONENT)/$(GENASSYM_LOCATION)/genassym.c
181 @echo "[$(CMD_MC)] $(ColorH)GENASSYM$(Color0) $(ColorLF)$<$(Color0)"
182 $(_v)${GENASSYM_KCC} ${CFLAGS} ${CFLAGS_NOLTO_FLAG} -MD -S -o ${@} ${INCFLAGS} $<
185 $(_v)sed -e '/^[[:space:]]*DEFINITION__define__/!d;{N;s/\n//;}' -e 's/^[[:space:]]*DEFINITION__define__\([^:]*\):.*ascii.*\"[\$$]*\([-0-9\#]*\)\".*$$/#define \1 \2/' -e 'p' -e 's/#//2' -e 's/^[[:space:]]*#define \([A-Za-z0-9_]*\)[[:space:]]*[\$$#]*\([-0-9]*\).*$$/#define \1_NUM \2/' genassym.o > $@
191 include $(MakeInc_rule)
192 include $(MakeInc_dir)