]>
Commit | Line | Data |
---|---|---|
5b2abdfb A |
1 | # This is a replacement for bsd.lib.mk for the libc project to get it |
2 | # doing the Right Thing in XBS, which is substantially different than | |
3 | # the BSD build system. | |
4 | # | |
5 | # The main problems arise when libc.a isn't meant to be static, but | |
6 | # libc_static.a is. We also build a debug version of the library | |
7 | # in addition to shared, static, and profile. Also, we build all | |
8 | # versions of libc with debugging enabled, unstripped. The BSD style | |
9 | # is to strip every object file after it is built but here, libc.a | |
10 | # will get merged into the larger libSystem.dylib, which will eventually | |
11 | # be stripped. We also don't build a libc.dylib, since it will be | |
12 | # munged into libSystem.dylib. | |
13 | # | |
14 | # And another difference, B&I wishes to build the 4 incarnations of Libc | |
15 | # in parallel on different machines. To do this, we must look at the | |
16 | # RC_ProjectName variable (which B&I sets) to determine which of the 4 | |
17 | # versions of Libc we will be building. Remember that the installhdrs | |
18 | # pass should only be invoked on one of the 4 versions, and man pages | |
19 | # should only be installed once as well. Both of these get done when | |
20 | # we're invoked as "Libc". | |
21 | ||
8e029c65 A |
22 | BSDMAKE = bsdmake -f Makefile |
23 | ||
5b2abdfb A |
24 | .PATH: . |
25 | .MAIN: all | |
26 | all: libc.a libc_static.a libc_debug.a libc_profile.a | |
27 | install: installhdrs install_libc.a install_libc_static.a \ | |
59e0d9fe | 28 | install_libc_profile.a install_libc_debug.a autopatchman maninstall |
5b2abdfb A |
29 | |
30 | .SUFFIXES: | |
3d9156a7 A |
31 | .SUFFIXES: .o .po .So .do |
32 | .SUFFIXES: .S .s .c .cc .cpp .cxx .m .C | |
33 | .SUFFIXES: -fbsd.c -nbsd.c -obsd.c -uuid.c .3-uuid.in .3 | |
59e0d9fe | 34 | .SUFFIXES: .f .y .l .defs .h |
9385eb3d A |
35 | .SUFFIXES: User.c User.o User.po User.So User.do |
36 | .SUFFIXES: Server.c Server.o Server.po Server.So Server.do | |
5b2abdfb A |
37 | |
38 | OBJS+= ${SRCS:N*.h:R:S/$/.o/g} | |
3d9156a7 | 39 | DOBJS+= ${OBJS:.o=.do} |
5b2abdfb A |
40 | POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po} |
41 | SOBJS+= ${OBJS:.o=.So} | |
59e0d9fe | 42 | |
3d9156a7 A |
43 | #### 128-bit Long Double libc-ldbl128 for Panther #################### |
44 | .if (${MACHINE_ARCH} == ppc) | |
45 | LIB128= ${LIB}-ldbl128 | |
46 | LDBL_128_SRCS= _hdtoa.c _ldbl_util.c _ldtoa.c asprintf.c err.c fprintf.c \ | |
47 | fscanf.c fwprintf.c fwscanf.c gdtoa-strtopdd.c machdep_ldisdd.c \ | |
48 | printf.c scanf.c snprintf.c sprintf.c sscanf.c swprintf.c swscanf.c \ | |
49 | vasprintf.c vfprintf.c vfscanf.c vfwprintf.c vfwscanf.c vprintf.c \ | |
50 | vscanf.c vsnprintf.c vsprintf.c vsscanf.c vswprintf.c vswscanf.c \ | |
51 | vwprintf.c vwscanf.c wcstold.c wprintf.c wscanf.c \ | |
52 | oldldbl64.s oldsyslog.c LDBL/oldsyslog-LDBL.c \ | |
53 | LDBL/err-LDBL.c LDBL/vfprintf-LDBL.c LDBL/vfwprintf-LDBL.c | |
54 | LDBL_128_OBJS= ${LDBL_128_SRCS:R:S/$/.o/g} | |
55 | LDBL_128_DOBJS= ${LDBL_128_OBJS:.o=.do} | |
56 | LDBL_128_POBJS= ${LDBL_128_OBJS:.o=.po} | |
57 | LDBL_128_SOBJS= ${LDBL_128_OBJS:.o=.So} | |
58 | ||
59 | LDBLSRCS2+= oldsyslog.c | |
60 | SRCS2+= oldldbl64.s oldsyslog.c | |
61 | OBJS2+= ${SRCS2:N*.h:R:S/$/.o/g} | |
62 | DOBJS2+= ${OBJS2:.o=.do} | |
63 | POBJS2+= ${OBJS2:.o=.po} | |
64 | SOBJS2+= ${OBJS2:.o=.So} | |
65 | .endif | |
66 | ||
67 | #### Variant Rules #################################################### | |
68 | # The following magic is used for variants to avoid the exponental explosion | |
69 | # of suffix rules. To add a variant, select a name (typically all-caps). | |
70 | # Add that name to the VARIANTS variable. Create a CFLAGS_XXX variable | |
71 | # (XXX is the variant name) that contains the extra flags to pass to the | |
72 | # compiler (currently, no slashes are permitted in the flags). Then, just | |
73 | # define a XXXSRCS variable with the names of the files to recompile with the | |
74 | # additional flags. For auto-patched files, don't use the auto-patched file | |
75 | # name. Just use the original file name. | |
76 | # | |
77 | # Note that this magic also deals with combinations of variants; e.g., | |
78 | # for two variants XXX and YYY, there are three variant combinations, | |
79 | # XXX, XXX-YYY and YYY. In this example, you can use XXX-YYYSRCS to | |
80 | # specify sources that will build with both the CFLAGS_XXX and CFLAGS_YYY | |
81 | # flags set. The variants are always in alphabetic order. | |
82 | # | |
83 | VARIANTS= | |
84 | # Append the 64-bit long double sources (ppc only) | |
85 | .if (${MACHINE_ARCH} == ppc) | |
86 | VARIANTS+= LDBL | |
87 | MDSRCS += ldbl64.s | |
88 | .endif | |
8e029c65 A |
89 | # build UNIX03 variant except on LP64 |
90 | .ifndef LP64 | |
3d9156a7 A |
91 | VARIANTS+= UNIX03 |
92 | .endif | |
93 | CFLAGS+= ${VARIANTCFLAGS} | |
94 | ||
95 | CFLAGS_UNIX03= -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=1 | |
96 | CFLAGS_LDBL= -mlong-double-64 -DLDBL_COMPAT | |
97 | ||
98 | .for _v in ${VARIANTS} | |
99 | COMBOARGS+= ${_v}/${CFLAGS_${_v}} | |
100 | .endfor | |
101 | .ifdef COMBOARGS | |
102 | # makeCombos is a perl script that creates all the variant combinations | |
103 | # and all the combinations of flags | |
104 | VARIANTCOMBOCFLAGS != ${.CURDIR}/makeCombos ${COMBOARGS} | |
105 | .endif | |
106 | # For each of the variant combinations as target (and possibly suffixed with | |
107 | # _D, _P, and _S for the four kinds on compile styles, we create a subdirectory | |
8e029c65 | 108 | # to do the compiling in, and then call $(BSDMAKE) with the new directory, and |
3d9156a7 A |
109 | # setting VARIANTCFLAGS, which are the extra flags to be added to CFLAGS. |
110 | .for _v in ${VARIANTCOMBOCFLAGS} | |
111 | VARIANTCOMBOS+= ${_v:H:S,/,,} | |
112 | ${_v:H:S,/,,}: | |
113 | .ifdef ${_v:H:S,/,,}SRCS | |
114 | mkdir -p ${MAKEOBJDIR}/${_v:H:S,/,,}; \ | |
8e029c65 | 115 | MAKEOBJDIR="$(MAKEOBJDIR)/${_v:H:S,/,,}" VARIANTCFLAGS="-DBUILDING_VARIANT ${_v:T:S/@/ /g}" $(BSDMAKE) -C "${.CURDIR}" build_${_v:H:S,/,,} |
3d9156a7 A |
116 | .endif |
117 | ${_v:H:S,/,,}_D: | |
118 | .ifdef ${_v:H:S,/,,}SRCS | |
119 | mkdir -p ${MAKEOBJDIR}/${_v:H:S,/,,}; \ | |
8e029c65 | 120 | MAKEOBJDIR="$(MAKEOBJDIR)/${_v:H:S,/,,}" VARIANTCFLAGS="-DBUILDING_VARIANT ${_v:T:S/@/ /g}" $(BSDMAKE) -C "${.CURDIR}" build_${_v:H:S,/,,}_D |
3d9156a7 A |
121 | .endif |
122 | ${_v:H:S,/,,}_P: | |
123 | .ifdef ${_v:H:S,/,,}SRCS | |
124 | mkdir -p ${MAKEOBJDIR}/${_v:H:S,/,,}; \ | |
8e029c65 | 125 | MAKEOBJDIR="$(MAKEOBJDIR)/${_v:H:S,/,,}" VARIANTCFLAGS="-DBUILDING_VARIANT ${_v:T:S/@/ /g}" $(BSDMAKE) -C "${.CURDIR}" build_${_v:H:S,/,,}_P |
3d9156a7 A |
126 | .endif |
127 | ${_v:H:S,/,,}_S: | |
128 | .ifdef ${_v:H:S,/,,}SRCS | |
129 | mkdir -p ${MAKEOBJDIR}/${_v:H:S,/,,}; \ | |
8e029c65 | 130 | MAKEOBJDIR="$(MAKEOBJDIR)/${_v:H:S,/,,}" VARIANTCFLAGS="-DBUILDING_VARIANT ${_v:T:S/@/ /g}" $(BSDMAKE) -C "${.CURDIR}" build_${_v:H:S,/,,}_S |
3d9156a7 A |
131 | .endif |
132 | .endfor | |
133 | ||
134 | .for _v in ${VARIANTCOMBOS} | |
135 | # Variant suffix rules so the filenames are unique and Libsystem won't complain | |
136 | # because of ambiguities with -sectorder | |
137 | .SUFFIXES: -${_v}.o -${_v}.do -${_v}.po -${_v}.So | |
138 | .o-${_v}.o .do-${_v}.do .po-${_v}.po .So-${_v}.So: | |
139 | mv ${.IMPSRC} ${.TARGET} | |
140 | ||
8e029c65 | 141 | # These are the build targets of the above $(BSDMAKE) calls, which just builds |
3d9156a7 A |
142 | # using the standard rules, but with the additional flags. |
143 | VARIANTOBJS+= ${${_v}SRCS:N*.h:R:S/$/-${_v}.o/g:S,^,${_v}/,g} | |
144 | build_${_v}: ${${_v}SRCS:N*.h:R:S/$/-${_v}.o/g} | |
145 | build_${_v}_D: ${${_v}SRCS:N*.h:R:S/$/-${_v}.do/g} ${${_v}SRCS2:N*.h:R:S/$/-${_v}.do/g} | |
146 | build_${_v}_P: ${${_v}SRCS:N*.h:R:S/$/-${_v}.po/g} ${${_v}SRCS2:N*.h:R:S/$/-${_v}.po/g} | |
147 | build_${_v}_S: ${${_v}SRCS:N*.h:R:S/$/-${_v}.So/g} ${${_v}SRCS2:N*.h:R:S/$/-${_v}.So/g} | |
148 | .endfor | |
149 | # These variables, plus VARIANTOBJS above, are the extra binaries that get | |
150 | # added to the .a files. Note that these objects are in subdirectories | |
151 | # of the main build directory. | |
152 | VARIANTDOBJS+= ${VARIANTOBJS:.o=.do} | |
153 | VARIANTPOBJS+= ${VARIANTOBJS:.o=.po} | |
154 | VARIANTSOBJS+= ${VARIANTOBJS:.o=.So} | |
59e0d9fe | 155 | #### FreeBSD Rules ################################################## |
9385eb3d | 156 | FBSDFLAGS= -I${.CURDIR}/fbsdcompat -include _fbsd_compat_.h |
5b2abdfb | 157 | |
9385eb3d | 158 | -fbsd.c.o: |
59e0d9fe | 159 | ${CC} -static ${FBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ |
3d9156a7 | 160 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} |
9385eb3d | 161 | -fbsd.c.po: |
59e0d9fe | 162 | ${CC} -pg -DPROFILE ${FBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ |
3d9156a7 | 163 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} |
9385eb3d | 164 | -fbsd.c.So: |
59e0d9fe | 165 | ${CC} ${FBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ |
3d9156a7 | 166 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} |
9385eb3d | 167 | -fbsd.c.do: |
59e0d9fe A |
168 | ${CC} -g -DDEBUG ${FBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ |
169 | -c ${.IMPSRC} -o ${.TARGET} | |
170 | ||
3d9156a7 A |
171 | #### NetBSD Rules ################################################## |
172 | NBSDFLAGS= -I${.CURDIR}/nbsdcompat -include _nbsd_compat_.h | |
173 | ||
174 | -nbsd.c.o: | |
175 | ${CC} -static ${NBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
176 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
177 | -nbsd.c.po: | |
178 | ${CC} -pg -DPROFILE ${NBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
179 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
180 | -nbsd.c.So: | |
181 | ${CC} ${NBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
182 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
183 | -nbsd.c.do: | |
184 | ${CC} -g -DDEBUG ${NBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
185 | -c ${.IMPSRC} -o ${.TARGET} | |
186 | ||
187 | #### OpenBSD Rules ################################################## | |
188 | OBSDFLAGS= | |
189 | ||
190 | -obsd.c.o: | |
191 | ${CC} -static ${OBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
192 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
193 | -obsd.c.po: | |
194 | ${CC} -pg -DPROFILE ${OBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
195 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
196 | -obsd.c.So: | |
197 | ${CC} ${OBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
198 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} | |
199 | -obsd.c.do: | |
200 | ${CC} -g -DDEBUG ${OBSDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
201 | -c ${.IMPSRC} -o ${.TARGET} | |
202 | ||
59e0d9fe A |
203 | #### UUID Rules ###################################################### |
204 | UUIDFLAGS= -I${.CURDIR}/uuid -include uuid-config.h | |
205 | ||
206 | -uuid.c.o: | |
207 | ${CC} -static ${UUIDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
3d9156a7 | 208 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} |
59e0d9fe A |
209 | -uuid.c.po: |
210 | ${CC} -pg -DPROFILE ${UUIDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
3d9156a7 | 211 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} |
59e0d9fe A |
212 | -uuid.c.So: |
213 | ${CC} ${UUIDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
3d9156a7 | 214 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} |
59e0d9fe A |
215 | -uuid.c.do: |
216 | ${CC} -g -DDEBUG ${UUIDFLAGS} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
217 | -c ${.IMPSRC} -o ${.TARGET} | |
218 | .3-uuid.in.3: | |
219 | sed -f ${.CURDIR}/uuid/uuidman.sed ${.IMPSRC} > ${.TARGET} | |
220 | ||
221 | #### Standard C Rules ################################################# | |
222 | .c.o User.cUser.o Server.cServer.o: | |
223 | ${CC} -static ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
3d9156a7 | 224 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} |
59e0d9fe A |
225 | .c.po User.cUser.po Server.cServer.po: |
226 | ${CC} -pg -DPROFILE ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
3d9156a7 | 227 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} |
59e0d9fe A |
228 | .c.So User.cUser.So Server.cServer.So: |
229 | ${CC} ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ | |
3d9156a7 | 230 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} |
9385eb3d | 231 | .c.do User.cUser.do Server.cServer.do: |
59e0d9fe A |
232 | ${CC} -g -DDEBUG ${CFLAGS} ${CFLAGS-${.IMPSRC:T}} \ |
233 | -c ${.IMPSRC} -o ${.TARGET} | |
234 | ||
235 | #### Standard Assembler Rules ######################################### | |
5b2abdfb | 236 | .s.o: |
59e0d9fe A |
237 | ${CC} -static -x assembler-with-cpp ${CFLAGS:M-[BIDF]*} \ |
238 | ${CFLAGS-${.IMPSRC:T}:M-[BIDF]*} ${AINC} \ | |
3d9156a7 | 239 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} |
5b2abdfb | 240 | .s.po: |
59e0d9fe A |
241 | ${CC} -pg -DPROFILE -x assembler-with-cpp ${CFLAGS:M-[BIDF]*} \ |
242 | ${CFLAGS-${.IMPSRC:T}:M-[BIDF]*} ${AINC} \ | |
3d9156a7 | 243 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} |
5b2abdfb | 244 | .s.So: |
59e0d9fe A |
245 | ${CC} -x assembler-with-cpp ${CFLAGS:M-[BIDF]*} \ |
246 | ${CFLAGS-${.IMPSRC:T}:M-[BIDF]*} ${AINC} \ | |
3d9156a7 | 247 | -Os ${OPTIMIZE-${.IMPSRC:T}} -c ${.IMPSRC} -o ${.TARGET} |
5b2abdfb | 248 | .s.do: |
59e0d9fe A |
249 | ${CC} -g -DDEBUG -x assembler-with-cpp ${CFLAGS:M-[BIDF]*} \ |
250 | ${CFLAGS-${.IMPSRC:T}:M-[BIDF]*} ${AINC} \ | |
251 | -c ${.IMPSRC} -o ${.TARGET} | |
252 | ||
253 | #### mig Rules ######################################################## | |
9385eb3d | 254 | .defs.h .defsUser.c .defsServer.c: |
3d9156a7 | 255 | mig -arch ${MACHINE_ARCH} -cc ${CC} -user ${.PREFIX}User.c -server ${.PREFIX}Server.c -header ${.PREFIX}.h ${.IMPSRC} |
5b2abdfb | 256 | |
9385eb3d A |
257 | gen_mig_defs: ${SRVMIGHDRS} ${MIGHDRS} |
258 | gen_md_mig_defs: ${MD_MIGHDRS} | |
259 | ||
3d9156a7 A |
260 | #### Library Rules #################################################### |
261 | lib${LIB}_static.a:: ${VARIANTCOMBOS} ${OBJS} ${STATICOBJS} | |
5b2abdfb A |
262 | @${ECHO} building static ${LIB} library |
263 | @rm -f lib${LIB}_static.a | |
3d9156a7 | 264 | @${AR} cq lib${LIB}_static.a `lorder ${OBJS} ${STATICOBJS} ${VARIANTOBJS} | tsort -q` ${ARADD} |
5b2abdfb A |
265 | ${RANLIB} lib${LIB}_static.a |
266 | ||
3d9156a7 | 267 | lib${LIB}_profile.a:: ${VARIANTCOMBOS:S/$/_P/g} ${POBJS} ${POBJS2} |
5b2abdfb A |
268 | @${ECHO} building profiled ${LIB} library |
269 | @rm -f lib${LIB}_profile.a | |
3d9156a7 | 270 | @${AR} cq lib${LIB}_profile.a `lorder ${POBJS} ${VARIANTPOBJS} | tsort -q` ${ARADD} |
5b2abdfb | 271 | ${RANLIB} lib${LIB}_profile.a |
3d9156a7 A |
272 | .if (${MACHINE_ARCH} == ppc) |
273 | @${ECHO} building profiled ${LIB128} library | |
274 | @rm -f lib${LIB128}_profile.a | |
275 | @${AR} cq lib${LIB128}_profile.a ${LDBL_128_POBJS} | |
276 | .endif | |
5b2abdfb | 277 | |
3d9156a7 | 278 | lib${LIB}_debug.a:: ${VARIANTCOMBOS:S/$/_D/g} ${DOBJS} ${DOBJS2} |
5b2abdfb A |
279 | @${ECHO} building debug ${LIB} library |
280 | @rm -f lib${LIB}_debug.a | |
3d9156a7 | 281 | @${AR} cq lib${LIB}_debug.a `lorder ${DOBJS} ${VARIANTDOBJS} | tsort -q` ${ARADD} |
5b2abdfb | 282 | ${RANLIB} lib${LIB}_debug.a |
3d9156a7 A |
283 | .if (${MACHINE_ARCH} == ppc) |
284 | @${ECHO} building debug ${LIB128} library | |
285 | @rm -f lib${LIB128}_debug.a | |
286 | @${AR} cq lib${LIB128}_debug.a ${LDBL_128_DOBJS} | |
287 | .endif | |
5b2abdfb | 288 | |
3d9156a7 | 289 | lib${LIB}.a:: ${VARIANTCOMBOS:S/$/_S/g} ${SOBJS} ${SOBJS2} |
5b2abdfb A |
290 | @${ECHO} building standard ${LIB} library |
291 | @rm -f lib${LIB}.a | |
3d9156a7 | 292 | @${AR} cq lib${LIB}.a `lorder ${SOBJS} ${VARIANTSOBJS} | tsort -q` ${ARADD} |
5b2abdfb | 293 | ${RANLIB} lib${LIB}.a |
3d9156a7 A |
294 | .if (${MACHINE_ARCH} == ppc) |
295 | @${ECHO} building standard ${LIB128} library | |
296 | @rm -f lib${LIB128}.a | |
297 | @${AR} cq lib${LIB128}.a ${LDBL_128_SOBJS} | |
298 | .endif | |
5b2abdfb A |
299 | |
300 | CLEANFILES += ${DOBJS} libc_static.a libc_profile.a libc_debug.a | |
301 | ||
9385eb3d A |
302 | INCDIR = ${DESTDIR}/usr/include |
303 | LOCINCDIR = ${DESTDIR}/usr/local/include | |
304 | SYSTEMFRAMEWORK = ${DESTDIR}/System/Library/Frameworks/System.framework | |
305 | PRIVHDRS = ${SYSTEMFRAMEWORK}/Versions/B/PrivateHeaders | |
3d9156a7 A |
306 | KERNELFRAMEWORK = ${DESTDIR}/System/Library/Frameworks/Kernel.framework |
307 | PRIVKERNELHDRS = ${KERNELFRAMEWORK}/Versions/A/PrivateHeaders | |
9385eb3d A |
308 | |
309 | installhdrs-md: gen_md_mig_defs | |
310 | mkdir -p ${INCDIR}/mach/${MACHINE_ARCH} | |
311 | ${INSTALL} -c -m 444 ${MD_MIGHDRS} ${INCDIR}/mach/${MACHINE_ARCH} | |
312 | ||
59e0d9fe | 313 | installhdrs: autopatchhdrs gen_mig_defs |
9385eb3d | 314 | mkdir -p ${INCDIR}/arpa |
59e0d9fe | 315 | mkdir -p ${INCDIR}/libkern |
9385eb3d | 316 | mkdir -p ${INCDIR}/mach |
3d9156a7 | 317 | mkdir -p ${INCDIR}/machine |
9385eb3d A |
318 | mkdir -p ${INCDIR}/malloc |
319 | mkdir -p ${INCDIR}/objc | |
320 | mkdir -p ${INCDIR}/protocols | |
321 | mkdir -p ${INCDIR}/servers | |
59e0d9fe | 322 | mkdir -p ${INCDIR}/sys |
3d9156a7 | 323 | mkdir -p ${INCDIR}/xlocale |
9385eb3d A |
324 | ${INSTALL} -c -m 444 ${INSTHDRS} ${INCDIR} |
325 | ${INSTALL} -c -m 444 ${ARPA_INSTHDRS} ${INCDIR}/arpa | |
59e0d9fe | 326 | ${INSTALL} -c -m 444 ${LIBKERN_INSTHDRS} ${INCDIR}/libkern |
9385eb3d | 327 | ${INSTALL} -c -m 444 ${MACH_INSTHDRS} ${INCDIR}/mach |
3d9156a7 | 328 | ${INSTALL} -c -m 444 ${MACHINE_INSTHDRS} ${INCDIR}/machine |
9385eb3d A |
329 | ${INSTALL} -c -m 444 ${MALLOC_INSTHDRS} ${INCDIR}/malloc |
330 | ${INSTALL} -c -m 444 ${OBJC_INSTHDRS} ${INCDIR}/objc | |
331 | ${INSTALL} -c -m 444 ${PROTO_INSTHDRS} ${INCDIR}/protocols | |
332 | ${INSTALL} -c -m 444 ${SRVHDRS} ${INCDIR}/servers | |
59e0d9fe | 333 | ${INSTALL} -c -m 444 ${SYS_INSTHDRS} ${INCDIR}/sys |
3d9156a7 | 334 | ${INSTALL} -c -m 444 ${XLOCALE_INSTHDRS} ${INCDIR}/xlocale |
9385eb3d A |
335 | mkdir -p ${LOCINCDIR} |
336 | ${INSTALL} -c -m 444 ${LOCALHDRS} ${LOCINCDIR} | |
337 | mkdir -p ${PRIVHDRS}/architecture/ppc | |
338 | mkdir -p ${PRIVHDRS}/btree | |
339 | mkdir -p ${PRIVHDRS}/machine | |
340 | mkdir -p ${PRIVHDRS}/objc | |
3d9156a7 | 341 | mkdir -p ${PRIVHDRS}/uuid |
59e0d9fe | 342 | mkdir -p ${PRIVHDRS}/sys |
3d9156a7 A |
343 | mkdir -p ${PRIVKERNELHDRS}/uuid |
344 | ${INSTALL} -c -m 444 ${PRIV_INSTHDRS} ${PRIVHDRS} | |
9385eb3d | 345 | ${INSTALL} -c -m 444 ${SRCROOT}/ppc/sys/processor_facilities.h ${PRIVHDRS}/architecture/ppc |
59e0d9fe A |
346 | ${INSTALL} -c -m 444 ${SYMROOT}/btree.h ${PRIVHDRS}/btree |
347 | ${INSTALL} -c -m 444 ${SYMROOT}/bt_extern.h ${PRIVHDRS}/btree | |
9385eb3d | 348 | ${INSTALL} -c -m 444 ${SRCROOT}/internat/NXCType.h ${PRIVHDRS}/objc |
9385eb3d A |
349 | mv ${DESTDIR}/usr/include/asm.h ${PRIVHDRS}/machine |
350 | mv ${INCDIR}/servers/srvbootstrap.h ${INCDIR}/servers/bootstrap.h | |
59e0d9fe A |
351 | @for i in `find ${DESTDIR}/usr/include/mach ${DESTDIR}/usr/include/servers -name \*.h`; do \ |
352 | x=`fgrep '<mach/mig.h>' $$i | uniq -d`; \ | |
353 | if [ -n "$$x" ]; then \ | |
354 | echo patching $$i; \ | |
355 | ed - $$i < ${SRCROOT}/fixdups.ed; \ | |
356 | fi; \ | |
357 | done | |
358 | ${INSTALL} -c -m 444 ${SYS_INSTHDRS} ${PRIVHDRS}/sys | |
3d9156a7 A |
359 | ${INSTALL} -c -m 444 ${PRIVUUID_INSTHDRS} ${PRIVHDRS}/uuid |
360 | ${INSTALL} -c -m 444 ${PRIVUUID_INSTHDRS} ${PRIVKERNELHDRS}/uuid | |
361 | ${INSTALL} -c -m 444 ${INSTHDRS_AUTOPATCH:S,^,${SYMROOT}/,} ${INCDIR} | |
362 | .for _h in ${STRIP_HDRS} | |
363 | chmod u+w ${INCDIR}/${_h} | |
364 | ed - ${INCDIR}/${_h} < ${.CURDIR}/strip-header.ed | |
365 | chmod u-w ${INCDIR}/${_h} | |
366 | .endfor | |
5b2abdfb A |
367 | |
368 | install_lib${LIB}_static.a: | |
369 | ${INSTALL} -c -m 444 lib${LIB}_static.a ${DESTDIR}/usr/local/lib/system/ | |
370 | install_lib${LIB}_profile.a: | |
371 | ${INSTALL} -c -m 444 lib${LIB}_profile.a ${DESTDIR}/usr/local/lib/system | |
372 | install_lib${LIB}_debug.a: | |
373 | ${INSTALL} -c -m 444 lib${LIB}_debug.a ${DESTDIR}/usr/local/lib/system/ | |
374 | install_lib${LIB}.a: | |
375 | ${INSTALL} -c -m 444 lib${LIB}.a ${DESTDIR}/usr/local/lib/system/ | |
376 | ||
59e0d9fe A |
377 | autopatch: autopatchhdrs ${AUTOPATCHSRCS} |
378 | autopatchhdrs: ${AUTOPATCHHDRS} | |
379 | autopatchman: ${AUTOPATCHMAN} | |
9385eb3d | 380 | |
5b2abdfb A |
381 | clean: |
382 | rm -f ${OBJS} ${POBJS} ${DOBJS} ${SOBJS} ${CLEANFILES} | |
383 | rm -f lib${LIB}.a lib${LIB}_static.a lib${LIB}_profile.a \ | |
384 | lib${LIB}_debug.a |