]> git.saurik.com Git - apple/xnu.git/blob - osfmk/conf/Makefile.template
xnu-2422.1.72.tar.gz
[apple/xnu.git] / osfmk / conf / Makefile.template
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
8 export MakeInc_cmd=${SRCROOT}/makedefs/MakeInc.cmd
9 export MakeInc_def=${SRCROOT}/makedefs/MakeInc.def
10 export MakeInc_rule=${SRCROOT}/makedefs/MakeInc.rule
11 export MakeInc_dir=${SRCROOT}/makedefs/MakeInc.dir
12
13 include $(MakeInc_cmd)
14 include $(MakeInc_def)
15
16 #
17 # XXX: CFLAGS
18 #
19 CFLAGS+= -include meta_features.h -DMACH_KERNEL_PRIVATE
20
21 # Objects that don't want -Wcast-align warning (8474835)
22 OBJS_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 #
73 chud_glue.o_SKIP_CTFCONVERT = 1
74
75 #
76 # XXX: INCFLAGS to include libsa prototypes
77 #
78 INCFLAGS_MAKEFILE= -I$(SOURCE)libsa
79
80 #
81 # Directories for mig generated files
82 #
83 COMP_SUBDIRS = \
84 default_pager \
85 device \
86 mach \
87 UserNotification \
88 gssd \
89 kextd \
90 lockd
91
92 #
93 # Make sure we don't remove this by accident if interrupted at the wrong
94 # time.
95 #
96 .PRECIOUS: Makefile
97
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
110 %SFILES
111
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
121 LDOBJS = $(OBJS)
122
123 $(COMPONENT).filelist: $(LDOBJS) assym.s
124 $(_v)for hib_file in ${HIB_FILES}; \
125 do \
126 $(SEG_HACK) -n __HIB -o $${hib_file}__ $${hib_file} ; \
127 mv $${hib_file}__ $${hib_file} ; \
128 done
129 @echo LDFILELIST $(COMPONENT)
130 $(_v)( for obj in ${LDOBJS}; do \
131 echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
132 done; ) > $(COMPONENT).filelist
133
134 do_all: $(COMPONENT).filelist
135
136 do_build_all:: do_all
137
138 # genassym.o actually is an assembly file,
139 # we name it genassym.o to help with the automatic
140 # dependency generation
141
142 GENASSYM_LOCATION = $(CURRENT_ARCH_CONFIG_LC)
143
144 ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64)
145 GENASSYM_LOCATION = i386
146 endif
147
148 genassym.o: $(SOURCE_DIR)/$(COMPONENT)/$(GENASSYM_LOCATION)/genassym.c
149 @echo GENASSYM $<
150 $(_v)${KCC} $(subst -flto,,${CFLAGS}) -MD -S -o ${@} ${INCFLAGS} $<
151
152 assym.s: genassym.o
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 > $@
154
155 ${SOBJS}: assym.s
156
157 %RULES
158
159 include $(MakeInc_rule)
160 include $(MakeInc_dir)