]>
Commit | Line | Data |
---|---|---|
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 |
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 | # | |
fe8ab488 | 19 | CFLAGS+= -include meta_features.h -DMACH_KERNEL_PRIVATE -DMACH_KERNEL |
39236c6e A |
20 | |
21 | # Objects that don't want -Wcast-align warning (8474835) | |
22 | OBJS_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 \ | |
61 | default_freezer.o \ | |
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 A |
75 | dp_memory_object.o \ |
76 | ipc_object.o \ | |
77 | ipc_kmsg.o \ | |
78 | ipc_right.o \ | |
79 | bsd_vm.o \ | |
80 | vm_map_store.o \ | |
81 | vm_map_store_ll.o \ | |
82 | vm_map_store_rb.o | |
fe8ab488 A |
83 | |
84 | # Objects that don't want -Wsign-compare warning (15294427) | |
85 | OBJS_NO_SIGN_COMPARE = \ | |
86 | atm_notification_user.o | |
39236c6e A |
87 | |
88 | $(foreach file,$(OBJS_NO_CAST_ALIGN),$(eval $(call add_perfile_cflags,$(file),-Wno-cast-align))) | |
fe8ab488 | 89 | $(foreach file,$(OBJS_NO_SIGN_COMPARE),$(eval $(call add_perfile_cflags,$(file),-Wno-sign-compare))) |
39236c6e A |
90 | |
91 | # | |
92 | # Do not provide CTF symbolic these files | |
93 | # | |
94 | chud_glue.o_SKIP_CTFCONVERT = 1 | |
95 | ||
96 | # | |
97 | # XXX: INCFLAGS to include libsa prototypes | |
98 | # | |
99 | INCFLAGS_MAKEFILE= -I$(SOURCE)libsa | |
1c79356b A |
100 | |
101 | # | |
102 | # Directories for mig generated files | |
103 | # | |
104 | COMP_SUBDIRS = \ | |
fe8ab488 | 105 | atm \ |
1c79356b A |
106 | default_pager \ |
107 | device \ | |
1c79356b | 108 | mach \ |
2d21ac55 A |
109 | UserNotification \ |
110 | gssd \ | |
b0d623f7 | 111 | kextd \ |
2d21ac55 | 112 | lockd |
1c79356b | 113 | |
1c79356b A |
114 | # |
115 | # Make sure we don't remove this by accident if interrupted at the wrong | |
116 | # time. | |
117 | # | |
118 | .PRECIOUS: Makefile | |
119 | ||
1c79356b A |
120 | # |
121 | # Theses macros are filled in by the config program depending on the | |
122 | # current configuration. The MACHDEP macro is replaced by the | |
123 | # contents of the machine dependent makefile template and the others | |
124 | # are replaced by the corresponding symbol definitions for the | |
125 | # configuration. | |
126 | # | |
127 | ||
128 | %OBJS | |
129 | ||
130 | %CFILES | |
131 | ||
fe8ab488 A |
132 | %CXXFILES |
133 | ||
1c79356b A |
134 | %SFILES |
135 | ||
1c79356b A |
136 | %MACHDEP |
137 | ||
fe8ab488 A |
138 | # Rebuild if per-file overrides change |
139 | ${OBJS}: $(firstword $(MAKEFILE_LIST)) | |
140 | ||
141 | # Rebuild if global compile flags change | |
142 | $(COBJS): .CFLAGS | |
143 | .CFLAGS: ALWAYS | |
144 | $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS) | |
145 | $(CXXOBJS): .CXXFLAGS | |
146 | .CXXFLAGS: ALWAYS | |
147 | $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS) | |
148 | $(SOBJS): .SFLAGS | |
149 | .SFLAGS: ALWAYS | |
150 | $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS) | |
151 | ||
152 | $(COMPONENT).filelist: $(OBJS) | |
39236c6e | 153 | $(_v)for hib_file in ${HIB_FILES}; \ |
91447636 | 154 | do \ |
3e170ce0 A |
155 | $(SEG_HACK) -n __HIB -o $${hib_file}__ $${hib_file} || exit 1; \ |
156 | mv $${hib_file}__ $${hib_file} || exit 1; \ | |
39236c6e | 157 | done |
b0d623f7 | 158 | @echo LDFILELIST $(COMPONENT) |
3e170ce0 | 159 | $(_v)for obj in ${OBJS}; do \ |
39236c6e | 160 | echo $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \ |
3e170ce0 | 161 | done > $(COMPONENT).filelist |
1c79356b | 162 | |
6d2010ae | 163 | do_all: $(COMPONENT).filelist |
1c79356b | 164 | |
39236c6e | 165 | do_build_all:: do_all |
1c79356b A |
166 | |
167 | # genassym.o actually is an assembly file, | |
168 | # we name it genassym.o to help with the automatic | |
169 | # dependency generation | |
170 | ||
39236c6e | 171 | GENASSYM_LOCATION = $(CURRENT_ARCH_CONFIG_LC) |
6d2010ae | 172 | |
39236c6e | 173 | ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64) |
6d2010ae | 174 | GENASSYM_LOCATION = i386 |
fe8ab488 A |
175 | else ifeq ($(CURRENT_ARCH_CONFIG_LC),x86_64h) |
176 | GENASSYM_LOCATION = i386 | |
6d2010ae A |
177 | endif |
178 | ||
fe8ab488 A |
179 | -include genassym.d |
180 | genassym.o: .CFLAGS $(firstword $(MAKEFILE_LIST)) | |
6d2010ae | 181 | genassym.o: $(SOURCE_DIR)/$(COMPONENT)/$(GENASSYM_LOCATION)/genassym.c |
39236c6e | 182 | @echo GENASSYM $< |
3e170ce0 | 183 | $(_v)${GENASSYM_KCC} ${CFLAGS} ${CFLAGS_NOLTO_FLAG} -MD -S -o ${@} ${INCFLAGS} $< |
1c79356b A |
184 | |
185 | assym.s: genassym.o | |
3e170ce0 | 186 | $(_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 |
187 | |
188 | ${SOBJS}: assym.s | |
189 | ||
1c79356b A |
190 | %RULES |
191 | ||
1c79356b A |
192 | include $(MakeInc_rule) |
193 | include $(MakeInc_dir) |