]> git.saurik.com Git - apple/xnu.git/blame_incremental - osfmk/conf/Makefile.template
xnu-6153.41.3.tar.gz
[apple/xnu.git] / osfmk / conf / Makefile.template
... / ...
CommitLineData
1#
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.
6#
7
8export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
9export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
10export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
11export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
12
13include $(MakeInc_cmd)
14include $(MakeInc_def)
15
16#
17# XXX: CFLAGS
18#
19CFLAGS+= -include meta_features.h -DMACH_KERNEL_PRIVATE -DMACH_KERNEL
20SFLAGS+= -include meta_features.h
21
22# Objects that don't want -Wcast-align warning (8474835)
23OBJS_NO_CAST_ALIGN = \
24 atm_notification_user.o \
25 model_dep.o \
26 video_console.o \
27 kdp_udp.o \
28 kdp_machdep.o \
29 host.o \
30 processor.o \
31 sched_prim.o \
32 task.o \
33 thread.o \
34 threadinfo.o \
35 gssd_mach.o \
36 UNDRequest.o \
37 panic_dialog.o \
38 bsd_i386.o \
39 commpage.o \
40 cpu_threads.o \
41 cpuid.o \
42 locks_i386.o \
43 locks_i386_opt.o \
44 machine_task.o \
45 mp_desc.o \
46 pcb.o \
47 pcb_native.o \
48 kdp_x86_common.o \
49 startup64.o \
50 affinity.o \
51 sched_grrr.o \
52 sched_proto.o \
53 stack.o \
54 task_policy.o \
55 wait_queue.o \
56 bsd_kern.o \
57 pmc.o \
58 status.o \
59 machine_routines.o \
60 loose_ends.o \
61 sleh.o \
62 ccdigest_final_64be.o \
63 ccdigest_init.o \
64 ccdigest_update.o \
65 cchmac_final.o \
66 cchmac_init.o \
67 ccsha1.o \
68 ipc_object.o \
69 ipc_kmsg.o \
70 ipc_right.o
71
72# Objects that don't want -Wsign-compare warning (15294427)
73OBJS_NO_SIGN_COMPARE = \
74 atm_notification_user.o
75
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)))
78
79ifeq ($(KSANCOV),1)
80# Don't instrument functions called by the ksancov runtime. SanitizeCoverage does
81# not support blacklists, so exclude the whole file.
82machine_routines.o_CFLAGS_RM = $(KSANCOV_CFLAGS)
83machine_routines_common.o_CFLAGS_RM = $(KSANCOV_CFLAGS)
84pcb_native.o_CFLAGS_RM = $(KSANCOV_CFLAGS)
85endif
86
87#
88# XXX: INCFLAGS to include libsa prototypes
89#
90INCFLAGS_MAKEFILE= -I$(SOURCE)libsa
91
92#
93# Directories for mig generated files
94#
95COMP_SUBDIRS = \
96 atm \
97 default_pager \
98 device \
99 mach \
100 UserNotification \
101 gssd \
102 kextd \
103 lockd
104
105#
106# Make sure we don't remove this by accident if interrupted at the wrong
107# time.
108#
109.PRECIOUS: Makefile
110
111#
112# Theses macros are filled in by the config program depending on the
113# current configuration. The MACHDEP macro is replaced by the
114# contents of the machine dependent makefile template and the others
115# are replaced by the corresponding symbol definitions for the
116# configuration.
117#
118
119%OBJS
120
121%CFILES
122
123%CXXFILES
124
125%SFILES
126
127%MACHDEP
128
129# Rebuild if per-file overrides change
130${OBJS}: $(firstword $(MAKEFILE_LIST))
131
132# Rebuild if global compile flags change
133$(COBJS): .CFLAGS
134.CFLAGS: ALWAYS
135 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
136$(CXXOBJS): .CXXFLAGS
137.CXXFLAGS: ALWAYS
138 $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
139$(SOBJS): .SFLAGS
140.SFLAGS: ALWAYS
141 $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
142
143$(COMPONENT).filelist: $(OBJS)
144 $(_v)for hib_file in ${HIB_FILES}; \
145 do \
146 $(SEG_HACK) -n __HIB -o $${hib_file}__ $${hib_file} || exit 1; \
147 mv $${hib_file}__ $${hib_file} || exit 1; \
148 done
149 $(call makelog,$(ColorL)LDFILELIST$(Color0) $(ColorLF)$(COMPONENT)$(Color0))
150 $(_v)for obj in ${OBJS}; do \
151 $(ECHO) $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
152 done > $(COMPONENT).filelist
153
154do_all: $(COMPONENT).filelist
155
156do_build_all:: do_all
157
158# genassym.o actually is an assembly file,
159# we name it genassym.o to help with the automatic
160# dependency generation
161
162GENASSYM_LOCATION = $(CURRENT_ARCH_CONFIG_LC)
163
164ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64)
165GENASSYM_LOCATION = i386
166else ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64h)
167GENASSYM_LOCATION = i386
168endif
169
170-include genassym.d
171genassym.o: .CFLAGS $(firstword $(MAKEFILE_LIST))
172genassym.o: $(SOURCE_DIR)/$(COMPONENT)/$(GENASSYM_LOCATION)/genassym.c
173 $(call makelog,[$(CMD_MC)] $(ColorH)GENASSYM$(Color0) $(ColorLF)$<$(Color0))
174 $(_v)${GENASSYM_KCC} ${CFLAGS} ${CFLAGS_NOLTO_FLAG} -MD -S -o ${@} ${INCFLAGS} $<
175
176assym.s: genassym.o
177 $(_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 > $@
178
179${SOBJS}: assym.s
180
181%RULES
182
183include $(MakeInc_rule)
184include $(MakeInc_dir)