]> git.saurik.com Git - apple/xnu.git/blame - osfmk/conf/Makefile.template
xnu-2782.40.9.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 \
26 chud_thread_arm.o \
27 video_console.o \
fe8ab488 28 kern_stackshot.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 \
62 default_freezer.o \
63 status.o \
64 machine_routines.o \
65 loose_ends.o \
fe8ab488
A
66 fips_sha1.o \
67 prng_yarrow.o \
68 sha1mod.o \
69 sleh.o \
70 ccdigest_final_64be.o \
71 ccdigest_init.o \
72 ccdigest_update.o \
73 cchmac_final.o \
74 cchmac_init.o \
75 ccsha1.o \
76
77
78# Objects that don't want -Wsign-compare warning (15294427)
79OBJS_NO_SIGN_COMPARE = \
80 atm_notification_user.o
39236c6e
A
81
82$(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align)))
fe8ab488 83$(foreach file,$(OBJS_NO_SIGN_COMPARE),$(eval $(call add_perfile_cflags,$(file),-Wno-sign-compare)))
39236c6e
A
84
85#
86# Do not provide CTF symbolic these files
87#
88chud_glue.o_SKIP_CTFCONVERT = 1
89
90#
91# XXX: INCFLAGS to include libsa prototypes
92#
93INCFLAGS_MAKEFILE= -I$(SOURCE)libsa
1c79356b
A
94
95#
96# Directories for mig generated files
97#
98COMP_SUBDIRS = \
fe8ab488 99 atm \
1c79356b
A
100 default_pager \
101 device \
1c79356b 102 mach \
2d21ac55
A
103 UserNotification \
104 gssd \
b0d623f7 105 kextd \
2d21ac55 106 lockd
1c79356b 107
1c79356b
A
108#
109# Make sure we don't remove this by accident if interrupted at the wrong
110# time.
111#
112.PRECIOUS: Makefile
113
1c79356b
A
114#
115# Theses macros are filled in by the config program depending on the
116# current configuration. The MACHDEP macro is replaced by the
117# contents of the machine dependent makefile template and the others
118# are replaced by the corresponding symbol definitions for the
119# configuration.
120#
121
122%OBJS
123
124%CFILES
125
fe8ab488
A
126%CXXFILES
127
1c79356b
A
128%SFILES
129
1c79356b
A
130%MACHDEP
131
fe8ab488
A
132# Rebuild if per-file overrides change
133${OBJS}: $(firstword $(MAKEFILE_LIST))
134
135# Rebuild if global compile flags change
136$(COBJS): .CFLAGS
137.CFLAGS: ALWAYS
138 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
139$(CXXOBJS): .CXXFLAGS
140.CXXFLAGS: ALWAYS
141 $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
142$(SOBJS): .SFLAGS
143.SFLAGS: ALWAYS
144 $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
145
146$(COMPONENT).filelist: $(OBJS)
39236c6e 147 $(_v)for hib_file in ${HIB_FILES}; \
91447636 148 do \
39236c6e 149 $(SEG_HACK) -n __HIB -o $${hib_file}__ $${hib_file} ; \
91447636 150 mv $${hib_file}__ $${hib_file} ; \
39236c6e 151 done
b0d623f7 152 @echo LDFILELIST $(COMPONENT)
fe8ab488 153 $(_v)( for obj in ${OBJS}; do \
39236c6e 154 echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
6d2010ae 155 done; ) > $(COMPONENT).filelist
1c79356b 156
6d2010ae 157do_all: $(COMPONENT).filelist
1c79356b 158
39236c6e 159do_build_all:: do_all
1c79356b
A
160
161# genassym.o actually is an assembly file,
162# we name it genassym.o to help with the automatic
163# dependency generation
164
39236c6e 165GENASSYM_LOCATION = $(CURRENT_ARCH_CONFIG_LC)
6d2010ae 166
39236c6e 167ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64)
6d2010ae 168GENASSYM_LOCATION = i386
fe8ab488
A
169else ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64h)
170GENASSYM_LOCATION = i386
6d2010ae
A
171endif
172
fe8ab488
A
173-include genassym.d
174genassym.o: .CFLAGS $(firstword $(MAKEFILE_LIST))
6d2010ae 175genassym.o: $(SOURCE_DIR)/$(COMPONENT)/$(GENASSYM_LOCATION)/genassym.c
39236c6e 176 @echo GENASSYM $<
fe8ab488 177 $(_v)${KCC} ${CFLAGS} ${CFLAGS_NOLTO_FLAG} -MD -S -o ${@} ${INCFLAGS} $<
1c79356b
A
178
179assym.s: genassym.o
39236c6e 180 $(_v)sed -e '/#DEFINITION#/!d' -e 's/^.*#DEFINITION#//' -e 's/\$$//' -e 'p' -e 's/#//2' -e 's/[^A-Za-z0-9_]*\([A-Za-z0-9_]*\)/ \1_NUM/2' genassym.o > $@
1c79356b
A
181
182${SOBJS}: assym.s
183
1c79356b
A
184%RULES
185
1c79356b
A
186include $(MakeInc_rule)
187include $(MakeInc_dir)