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