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