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
20 SFLAGS+= -include meta_features.h
22 # Objects that don't want -Wcast-align warning (8474835)
23 OBJS_NO_CAST_ALIGN = \
24 atm_notification_user.o \
62 ccdigest_final_64be.o \
72 # Objects that don't want -Wsign-compare warning (15294427)
73 OBJS_NO_SIGN_COMPARE = \
74 atm_notification_user.o
76 $(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align)))
77 $(foreach file,$(OBJS_NO_SIGN_COMPARE),$(eval $(call add_perfile_cflags,$(file),-Wno-sign-compare)))
80 # XXX: INCFLAGS to include libsa prototypes
82 INCFLAGS_MAKEFILE= -I$(SOURCE)libsa
85 # Directories for mig generated files
98 # Make sure we don't remove this by accident if interrupted at the wrong
104 # Theses macros are filled in by the config program depending on the
105 # current configuration. The MACHDEP macro is replaced by the
106 # contents of the machine dependent makefile template and the others
107 # are replaced by the corresponding symbol definitions for the
121 # Rebuild if per-file overrides change
122 ${OBJS}: $(firstword $(MAKEFILE_LIST))
124 # Rebuild if global compile flags change
127 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
128 $(CXXOBJS): .CXXFLAGS
130 $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
133 $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
135 $(COMPONENT).filelist: $(OBJS)
136 $(_v)for hib_file in ${HIB_FILES}; \
138 $(SEG_HACK) -n __HIB -o $${hib_file}__ $${hib_file} || exit 1; \
139 mv $${hib_file}__ $${hib_file} || exit 1; \
141 @echo "$(ColorL)LDFILELIST$(Color0) $(ColorLF)$(COMPONENT)$(Color0)"
142 $(_v)for obj in ${OBJS}; do \
143 echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
144 done > $(COMPONENT).filelist
146 do_all: $(COMPONENT).filelist
148 do_build_all:: do_all
150 # genassym.o actually is an assembly file,
151 # we name it genassym.o to help with the automatic
152 # dependency generation
154 GENASSYM_LOCATION = $(CURRENT_ARCH_CONFIG_LC)
156 ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64)
157 GENASSYM_LOCATION = i386
158 else ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64h)
159 GENASSYM_LOCATION = i386
163 genassym.o: .CFLAGS $(firstword $(MAKEFILE_LIST))
164 genassym.o: $(SOURCE_DIR)/$(COMPONENT)/$(GENASSYM_LOCATION)/genassym.c
165 @echo "[$(CMD_MC)] $(ColorH)GENASSYM$(Color0) $(ColorLF)$<$(Color0)"
166 $(_v)${GENASSYM_KCC} ${CFLAGS} ${CFLAGS_NOLTO_FLAG} -MD -S -o ${@} ${INCFLAGS} $<
169 $(_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 > $@
175 include $(MakeInc_rule)
176 include $(MakeInc_dir)