]> git.saurik.com Git - apple/xnu.git/blame - osfmk/conf/Makefile.template
xnu-2422.1.72.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#
39236c6e
A
19CFLAGS+= -include meta_features.h -DMACH_KERNEL_PRIVATE
20
21# Objects that don't want -Wcast-align warning (8474835)
22OBJS_NO_CAST_ALIGN = \
23 model_dep.o \
24 chud_thread.o \
25 chud_thread_arm.o \
26 video_console.o \
27 kdp.o \
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 \
55 sched_fixedpriority.o \
56 stack.o \
57 task_policy.o \
58 wait_queue.o \
59 bsd_kern.o \
60 pmc.o \
61 default_freezer.o \
62 status.o \
63 machine_routines.o \
64 loose_ends.o \
65 sleh.o
66
67
68$(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align)))
69
70#
71# Do not provide CTF symbolic these files
72#
73chud_glue.o_SKIP_CTFCONVERT = 1
74
75#
76# XXX: INCFLAGS to include libsa prototypes
77#
78INCFLAGS_MAKEFILE= -I$(SOURCE)libsa
1c79356b
A
79
80#
81# Directories for mig generated files
82#
83COMP_SUBDIRS = \
84 default_pager \
85 device \
1c79356b 86 mach \
2d21ac55
A
87 UserNotification \
88 gssd \
b0d623f7 89 kextd \
2d21ac55 90 lockd
1c79356b 91
1c79356b
A
92#
93# Make sure we don't remove this by accident if interrupted at the wrong
94# time.
95#
96.PRECIOUS: Makefile
97
1c79356b
A
98#
99# Theses macros are filled in by the config program depending on the
100# current configuration. The MACHDEP macro is replaced by the
101# contents of the machine dependent makefile template and the others
102# are replaced by the corresponding symbol definitions for the
103# configuration.
104#
105
106%OBJS
107
108%CFILES
109
1c79356b
A
110%SFILES
111
1c79356b
A
112%MACHDEP
113
114#
115# OBJSDEPS is the set of files (defined in the machine dependent
116# template if necessary) which all objects depend on (such as an
117# in-line assembler expansion filter)
118#
119${OBJS}: ${OBJSDEPS}
120
1c79356b
A
121LDOBJS = $(OBJS)
122
6d2010ae 123$(COMPONENT).filelist: $(LDOBJS) assym.s
39236c6e 124 $(_v)for hib_file in ${HIB_FILES}; \
91447636 125 do \
39236c6e 126 $(SEG_HACK) -n __HIB -o $${hib_file}__ $${hib_file} ; \
91447636 127 mv $${hib_file}__ $${hib_file} ; \
39236c6e 128 done
b0d623f7
A
129 @echo LDFILELIST $(COMPONENT)
130 $(_v)( for obj in ${LDOBJS}; do \
39236c6e 131 echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
6d2010ae 132 done; ) > $(COMPONENT).filelist
1c79356b 133
6d2010ae 134do_all: $(COMPONENT).filelist
1c79356b 135
39236c6e 136do_build_all:: do_all
1c79356b
A
137
138# genassym.o actually is an assembly file,
139# we name it genassym.o to help with the automatic
140# dependency generation
141
39236c6e 142GENASSYM_LOCATION = $(CURRENT_ARCH_CONFIG_LC)
6d2010ae 143
39236c6e 144ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64)
6d2010ae
A
145GENASSYM_LOCATION = i386
146endif
147
148genassym.o: $(SOURCE_DIR)/$(COMPONENT)/$(GENASSYM_LOCATION)/genassym.c
39236c6e
A
149 @echo GENASSYM $<
150 $(_v)${KCC} $(subst -flto,,${CFLAGS}) -MD -S -o ${@} ${INCFLAGS} $<
1c79356b
A
151
152assym.s: genassym.o
39236c6e 153 $(_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
154
155${SOBJS}: assym.s
156
1c79356b
A
157%RULES
158
1c79356b
A
159include $(MakeInc_rule)
160include $(MakeInc_dir)