]> git.saurik.com Git - apple/xnu.git/blame - libkern/conf/Makefile.template
xnu-7195.81.3.tar.gz
[apple/xnu.git] / libkern / 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#
b0d623f7 17# CFLAGS
1c79356b 18#
39236c6e 19CFLAGS+= -include meta_features.h -DLIBKERN_KERNEL_PRIVATE -DOSALLOCDEBUG=1
5ba3f43e 20SFLAGS+= -include meta_features.h
39236c6e 21
316670eb
A
22# Runtime support functions don't interact well with LTO (9294679)
23stack_protector.o_CFLAGS_ADD += $(CFLAGS_NOLTO_FLAG)
24
1c79356b
A
25#
26# Directories for mig generated files
27#
39037602 28COMP_SUBDIRS =
1c79356b
A
29
30#
31# Make sure we don't remove this by accident if interrupted at the wrong
32# time.
33#
34.PRECIOUS: Makefile
35
1c79356b
A
36#
37# Theses macros are filled in by the config program depending on the
38# current configuration. The MACHDEP macro is replaced by the
39# contents of the machine dependent makefile template and the others
40# are replaced by the corresponding symbol definitions for the
41# configuration.
42#
43
44%OBJS
45
a991bd8d
A
46%LIBOBJS
47
1c79356b
A
48%CFILES
49
fe8ab488
A
50%CXXFILES
51
1c79356b
A
52%SFILES
53
1c79356b
A
54%MACHDEP
55
f427ee49
A
56#
57# Machine-independent per-file flags
58#
59
60#
61# Diagnostic opt-outs. We need to make this list empty.
62#
63# DO NOT ADD MORE HERE.
64#
65# -Wno-cast-align
66OSKext.cpo_CXXWARNFLAGS_ADD += -Wno-cast-align
67OSKextLib.cpo_CXXWARNFLAGS_ADD += -Wno-cast-align
68OSMetaClass.cpo_CXXWARNFLAGS_ADD += -Wno-cast-align
69OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-cast-align
70corecrypto_md5.o_CFLAGS_ADD += -Wno-cast-align
71corecrypto_sha1.o_CFLAGS_ADD += -Wno-cast-align
72# -Wno-cast-qual
73OSKext.cpo_CXXWARNFLAGS_ADD += -Wno-cast-qual
74compress.o_CFLAGS_ADD += -Wno-cast-qual
75deflate.o_CFLAGS_ADD += -Wno-cast-qual
76runtime.cpo_CXXWARNFLAGS_ADD += -Wno-cast-qual
77trees.o_CFLAGS_ADD += -Wno-cast-qual
78uncompr.o_CFLAGS_ADD += -Wno-cast-qual
79# -Wno-implicit-int-conversion
80OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-implicit-int-conversion
81OSUnserializeXML.cpo_CXXWARNFLAGS_ADD += -Wno-implicit-int-conversion
82kxld_sym.o_CFLAGS_ADD += -Wno-implicit-int-conversion
83log.o_CFLAGS_ADD += -Wno-implicit-int-conversion
84scanf.o_CFLAGS_ADD += -Wno-implicit-int-conversion
85# -Wno-missing-prototypes
86OSRuntime.cpo_CXXWARNFLAGS_ADD += -Wno-missing-prototypes
87# -Wno-shorten-64-to-32
88OSKext.cpo_CXXWARNFLAGS_ADD += -Wno-shorten-64-to-32
89OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-shorten-64-to-32
90OSUnserializeXML.cpo_CXXWARNFLAGS_ADD += -Wno-shorten-64-to-32
91log.o_CFLAGS_ADD += -Wno-shorten-64-to-32
92scanf.o_CFLAGS_ADD += -Wno-shorten-64-to-32
93# -Wno-sign-conversion
94OSCollection.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
95OSData.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
96OSDebug.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
97OSKext.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
98OSKextVersion.o_CFLAGS_ADD += -Wno-sign-conversion
99OSMetaClass.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
100OSNumber.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
101OSObject.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
102OSRuntime.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
103OSSerializeBinary.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
104OSSet.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
105OSString.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
106OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
107OSUnserializeXML.cpo_CXXWARNFLAGS_ADD += -Wno-sign-conversion
108adler32.o_CFLAGS_ADD += -Wno-sign-conversion
109corecrypto_aes.o_CFLAGS_ADD += -Wno-sign-conversion
110corecrypto_aesxts.o_CFLAGS_ADD += -Wno-sign-conversion
111deflate.o_CFLAGS_ADD += -Wno-sign-conversion
112inet_aton.o_CFLAGS_ADD += -Wno-sign-conversion
113infback.o_CFLAGS_ADD += -Wno-sign-conversion
114inflate.o_CFLAGS_ADD += -Wno-sign-conversion
115kxld_array.o_CFLAGS_ADD += -Wno-sign-conversion
116kxld_copyright.o_CFLAGS_ADD += -Wno-sign-conversion
117kxld_dict.o_CFLAGS_ADD += -Wno-sign-conversion
118kxld_object.o_CFLAGS_ADD += -Wno-sign-conversion
119kxld_reloc.o_CFLAGS_ADD += -Wno-sign-conversion
120kxld_sym.o_CFLAGS_ADD += -Wno-sign-conversion
121kxld_symtab.o_CFLAGS_ADD += -Wno-sign-conversion
122kxld_util.o_CFLAGS_ADD += -Wno-sign-conversion
123log.o_CFLAGS_ADD += -Wno-sign-conversion
124refcnt.o_CFLAGS_ADD += -Wno-sign-conversion
125scanf.o_CFLAGS_ADD += -Wno-sign-conversion
126trees.o_CFLAGS_ADD += -Wno-sign-conversion
127uuid.o_CFLAGS_ADD += -Wno-sign-conversion
128# -Wno-unreachable-code
129OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-unreachable-code
130OSUnserializeXML.cpo_CXXWARNFLAGS_ADD += -Wno-unreachable-code
131OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-unreachable-code-break
132OSUnserializeXML.cpo_CXXWARNFLAGS_ADD += -Wno-unreachable-code-break
133# -Wno-zero-as-null-pointer-constant
134OSUnserialize.cpo_CXXWARNFLAGS_ADD += -Wno-zero-as-null-pointer-constant
135OSUnserializeXML.cpo_CXXWARNFLAGS_ADD += -Wno-zero-as-null-pointer-constant
136
fe8ab488
A
137# Rebuild if per-file overrides change
138${OBJS}: $(firstword $(MAKEFILE_LIST))
139
140# Rebuild if global compile flags change
141$(COBJS): .CFLAGS
142.CFLAGS: ALWAYS
143 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
144$(CXXOBJS): .CXXFLAGS
145.CXXFLAGS: ALWAYS
146 $(_v)$(REPLACECONTENTS) $@ $(KC++) $(CXXFLAGS) $(INCFLAGS)
147$(SOBJS): .SFLAGS
148.SFLAGS: ALWAYS
149 $(_v)$(REPLACECONTENTS) $@ $(S_KCC) $(SFLAGS) $(INCFLAGS)
150
151$(COMPONENT).filelist: $(OBJS)
39236c6e 152 $(_v)for hib_file in ${HIB_FILES}; \
6d2010ae 153 do \
3e170ce0
A
154 $(SEG_HACK) -n __HIB -o $${hib_file}__ $${hib_file} || exit 1; \
155 mv $${hib_file}__ $${hib_file} || exit 1; \
39236c6e 156 done
f427ee49 157 @$(LOG_LDFILELIST) "$(COMPONENT)"
3e170ce0 158 $(_v)for obj in ${OBJS}; do \
cb323159 159 $(ECHO) $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
3e170ce0 160 done > $(COMPONENT).filelist
1c79356b 161
a991bd8d
A
162$(COMPONENT).libfilelist: $(LIBOBJS)
163 @$(LOG_LDFILELIST) "lib$(COMPONENT)"
164 $(_v)for obj in ${LIBOBJS}; do \
165 $(ECHO) $(TARGET)/$(CURRENT_KERNEL_CONFIG)/$${obj}; \
166 done > $(COMPONENT).libfilelist
167
168ifeq ($(RC_ProjectName),xnu_libraries)
169do_all: $(COMPONENT).libfilelist
170else
6d2010ae 171do_all: $(COMPONENT).filelist
a991bd8d 172endif
1c79356b 173
39236c6e 174do_build_all:: do_all
1c79356b
A
175
176%RULES
177
1c79356b 178include $(MakeInc_rule)
1c79356b 179include $(MakeInc_dir)