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