]> git.saurik.com Git - apple/xnu.git/blame - osfmk/conf/Makefile.template
xnu-4570.71.2.tar.gz
[apple/xnu.git] / osfmk / conf / Makefile.template
CommitLineData
1c79356b
A
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
1c79356b
A
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#
fe8ab488 19CFLAGS+= -include meta_features.h -DMACH_KERNEL_PRIVATE -DMACH_KERNEL
5ba3f43e 20SFLAGS+= -include meta_features.h
39236c6e
A
21
22# Objects that don't want -Wcast-align warning (8474835)
23OBJS_NO_CAST_ALIGN = \
fe8ab488 24 atm_notification_user.o \
39236c6e 25 model_dep.o \
39236c6e 26 video_console.o \
39236c6e
A
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 machine_task.o \
44 mp_desc.o \
45 pcb.o \
46 pcb_native.o \
47 kdp_x86_common.o \
48 memory_object.o \
49 vm_apple_protect.o \
50 vm_map.o \
51 startup64.o \
52 affinity.o \
53 sched_grrr.o \
fe8ab488 54 sched_proto.o \
39236c6e
A
55 stack.o \
56 task_policy.o \
57 wait_queue.o \
58 bsd_kern.o \
59 pmc.o \
39236c6e
A
60 status.o \
61 machine_routines.o \
62 loose_ends.o \
fe8ab488
A
63 fips_sha1.o \
64 prng_yarrow.o \
65 sha1mod.o \
66 sleh.o \
67 ccdigest_final_64be.o \
68 ccdigest_init.o \
69 ccdigest_update.o \
70 cchmac_final.o \
71 cchmac_init.o \
72 ccsha1.o \
3e170ce0 73 ipc_object.o \
5ba3f43e
A
74 ccmode_ctr_crypt.o \
75 ccmode_factory_ctr_crypt.o \
76 ccmode_ctr_init.o \
77 ccmode_ctr_setctr.o \
3e170ce0
A
78 ipc_kmsg.o \
79 ipc_right.o \
80 bsd_vm.o \
81 vm_map_store.o \
82 vm_map_store_ll.o \
39037602
A
83 vm_map_store_rb.o \
84 vm_debug.o
fe8ab488
A
85
86# Objects that don't want -Wsign-compare warning (15294427)
39037602 87OBJS_NO_SIGN_COMPARE = \
fe8ab488 88 atm_notification_user.o
39236c6e
A
89
90$(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align)))
fe8ab488 91$(foreach file,$(OBJS_NO_SIGN_COMPARE),$(eval $(call add_perfile_cflags,$(file),-Wno-sign-compare)))
39236c6e 92
39236c6e
A
93#
94# XXX: INCFLAGS to include libsa prototypes
95#
96INCFLAGS_MAKEFILE= -I$(SOURCE)libsa
1c79356b
A
97
98#
99# Directories for mig generated files
100#
101COMP_SUBDIRS = \
fe8ab488 102 atm \
1c79356b
A
103 default_pager \
104 device \
1c79356b 105 mach \
2d21ac55
A
106 UserNotification \
107 gssd \
b0d623f7 108 kextd \
2d21ac55 109 lockd
1c79356b 110
1c79356b
A
111#
112# Make sure we don't remove this by accident if interrupted at the wrong
113# time.
114#
115.PRECIOUS: Makefile
116
1c79356b
A
117#
118# Theses macros are filled in by the config program depending on the
119# current configuration. The MACHDEP macro is replaced by the
120# contents of the machine dependent makefile template and the others
121# are replaced by the corresponding symbol definitions for the
122# configuration.
123#
124
125%OBJS
126
127%CFILES
128
fe8ab488
A
129%CXXFILES
130
1c79356b
A
131%SFILES
132
1c79356b
A
133%MACHDEP
134
fe8ab488
A
135# Rebuild if per-file overrides change
136${OBJS}: $(firstword $(MAKEFILE_LIST))
137
138# Rebuild if global compile flags change
139$(COBJS): .CFLAGS
140.CFLAGS: ALWAYS
141 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
142$(CXXOBJS): .CXXFLAGS
143.CXXFLAGS: ALWAYS
144 $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
145$(SOBJS): .SFLAGS
146.SFLAGS: ALWAYS
147 $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
148
149$(COMPONENT).filelist: $(OBJS)
39236c6e 150 $(_v)for hib_file in ${HIB_FILES}; \
91447636 151 do \
3e170ce0
A
152 $(SEG_HACK) -n __HIB -o $${hib_file}__ $${hib_file} || exit 1; \
153 mv $${hib_file}__ $${hib_file} || exit 1; \
39236c6e 154 done
39037602 155 @echo "$(ColorL)LDFILELIST$(Color0) $(ColorLF)$(COMPONENT)$(Color0)"
3e170ce0 156 $(_v)for obj in ${OBJS}; do \
39236c6e 157 echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
3e170ce0 158 done > $(COMPONENT).filelist
1c79356b 159
6d2010ae 160do_all: $(COMPONENT).filelist
1c79356b 161
39236c6e 162do_build_all:: do_all
1c79356b
A
163
164# genassym.o actually is an assembly file,
165# we name it genassym.o to help with the automatic
166# dependency generation
167
39236c6e 168GENASSYM_LOCATION = $(CURRENT_ARCH_CONFIG_LC)
6d2010ae 169
39236c6e 170ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64)
6d2010ae 171GENASSYM_LOCATION = i386
fe8ab488
A
172else ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64h)
173GENASSYM_LOCATION = i386
6d2010ae
A
174endif
175
fe8ab488
A
176-include genassym.d
177genassym.o: .CFLAGS $(firstword $(MAKEFILE_LIST))
6d2010ae 178genassym.o: $(SOURCE_DIR)/$(COMPONENT)/$(GENASSYM_LOCATION)/genassym.c
39037602 179 @echo "[$(CMD_MC)] $(ColorH)GENASSYM$(Color0) $(ColorLF)$<$(Color0)"
3e170ce0 180 $(_v)${GENASSYM_KCC} ${CFLAGS} ${CFLAGS_NOLTO_FLAG} -MD -S -o ${@} ${INCFLAGS} $<
1c79356b
A
181
182assym.s: genassym.o
3e170ce0 183 $(_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 > $@
1c79356b
A
184
185${SOBJS}: assym.s
186
1c79356b
A
187%RULES
188
1c79356b
A
189include $(MakeInc_rule)
190include $(MakeInc_dir)