bsd.lib.mk revision 1.305 1 1.305 darran # $NetBSD: bsd.lib.mk,v 1.305 2010/03/02 20:49:18 darran Exp $
2 1.92 mikel # @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
3 1.1 cgd
4 1.188 tv .include <bsd.init.mk>
5 1.207 thorpej .include <bsd.shlib.mk>
6 1.219 thorpej .include <bsd.gcc.mk>
7 1.227 lukem # Pull in <bsd.sys.mk> here so we can override its .c.o rule
8 1.227 lukem .include <bsd.sys.mk>
9 1.97 mycroft
10 1.282 lukem LIBISMODULE?= no
11 1.281 lukem LIBISPRIVATE?= no
12 1.291 mrg LIBISCXX?= no
13 1.281 lukem
14 1.282 lukem _LIB_PREFIX= lib
15 1.282 lukem
16 1.282 lukem .if ${LIBISMODULE} != "no"
17 1.282 lukem _LIB_PREFIX= # empty
18 1.282 lukem MKDEBUGLIB:= no
19 1.282 lukem MKLINT:= no
20 1.282 lukem MKPICINSTALL:= no
21 1.282 lukem MKPROFILE:= no
22 1.282 lukem MKSTATICLIB:= no
23 1.282 lukem .endif
24 1.282 lukem
25 1.281 lukem .if ${LIBISPRIVATE} != "no"
26 1.280 lukem MKDEBUGLIB:= no
27 1.280 lukem MKLINT:= no
28 1.290 cube MKPICINSTALL:= no
29 1.290 cube . if defined(NOSTATICLIB) && ${MKPICLIB} != "no"
30 1.290 cube MKSTATICLIB:= no
31 1.290 cube . else
32 1.280 lukem MKPIC:= no
33 1.290 cube . endif
34 1.280 lukem MKPROFILE:= no
35 1.280 lukem .endif
36 1.280 lukem
37 1.188 tv ##### Basic targets
38 1.246 lukem .PHONY: checkver libinstall
39 1.143 erh realinstall: checkver libinstall
40 1.183 tv clean: cleanlib
41 1.232 erh
42 1.232 erh ##### LIB specific flags.
43 1.287 christos # XXX: This is needed for programs that link with .a libraries
44 1.287 christos # Perhaps a more correct solution is to always generate _pic.a
45 1.287 christos # files or always have a shared library.
46 1.287 christos .if defined(MKPIE) && (${MKPIE} != "no")
47 1.287 christos CFLAGS+= ${PIE_CFLAGS}
48 1.288 christos AFLAGS+= ${PIE_AFLAGS}
49 1.287 christos .endif
50 1.1 cgd
51 1.256 lukem ##### Libraries that this may depend upon.
52 1.256 lukem .if defined(LIBDPLIBS) && ${MKPIC} != "no" # {
53 1.256 lukem .for _lib _dir in ${LIBDPLIBS}
54 1.256 lukem .if !defined(LIBDO.${_lib})
55 1.303 christos LIBDO.${_lib}!= cd "${_dir}" && ${PRINTOBJDIR}
56 1.256 lukem .MAKEOVERRIDES+=LIBDO.${_lib}
57 1.256 lukem .endif
58 1.256 lukem LDADD+= -L${LIBDO.${_lib}} -l${_lib}
59 1.256 lukem DPADD+= ${LIBDO.${_lib}}/lib${_lib}.so
60 1.256 lukem .endfor
61 1.256 lukem .endif # }
62 1.256 lukem
63 1.188 tv ##### Build and install rules
64 1.304 njoly MKDEP_SUFFIXES?= .o .po .pico .go .ln
65 1.292 pooka
66 1.292 pooka # Use purely kernel private headers in rump builds
67 1.292 pooka .if !defined(RUMPKERNEL)
68 1.299 tsutsui .if empty(CPPFLAGS:M-nostdinc)
69 1.192 thorpej CPPFLAGS+= ${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
70 1.299 tsutsui .endif
71 1.299 tsutsui .if empty(CXXFLAGS:M-nostdinc++)
72 1.225 mrg CXXFLAGS+= ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}
73 1.292 pooka .endif
74 1.299 tsutsui .endif
75 1.190 tv
76 1.252 lukem .if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE}) # {
77 1.154 simonb SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
78 1.154 simonb SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
79 1.171 christos SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
80 1.143 erh
81 1.295 he DPADD+= ${SHLIB_VERSION_FILE}
82 1.295 he
83 1.143 erh # Check for higher installed library versions.
84 1.145 erh .if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
85 1.201 lukem exists(${NETBSDSRCDIR}/lib/checkver)
86 1.143 erh checkver:
87 1.303 christos @(cd "${.CURDIR}" && \
88 1.289 apb HOST_SH=${HOST_SH:Q} AWK=${TOOL_AWK:Q} \
89 1.239 lukem ${HOST_SH} ${NETBSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
90 1.195 lukem -d ${DESTDIR}${_LIBSODIR} ${LIB})
91 1.173 christos .endif
92 1.252 lukem .endif # }
93 1.173 christos
94 1.173 christos .if !target(checkver)
95 1.143 erh checkver:
96 1.143 erh .endif
97 1.173 christos
98 1.169 thorpej print-shlib-major:
99 1.185 tv .if defined(SHLIB_MAJOR) && ${MKPIC} != "no"
100 1.169 thorpej @echo ${SHLIB_MAJOR}
101 1.173 christos .else
102 1.173 christos @false
103 1.173 christos .endif
104 1.169 thorpej
105 1.169 thorpej print-shlib-minor:
106 1.185 tv .if defined(SHLIB_MINOR) && ${MKPIC} != "no"
107 1.169 thorpej @echo ${SHLIB_MINOR}
108 1.173 christos .else
109 1.173 christos @false
110 1.173 christos .endif
111 1.171 christos
112 1.171 christos print-shlib-teeny:
113 1.185 tv .if defined(SHLIB_TEENY) && ${MKPIC} != "no"
114 1.171 christos @echo ${SHLIB_TEENY}
115 1.143 erh .else
116 1.169 thorpej @false
117 1.173 christos .endif
118 1.169 thorpej
119 1.252 lukem .if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR) # {
120 1.173 christos .if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
121 1.173 christos .if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
122 1.173 christos SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
123 1.173 christos .else
124 1.173 christos SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
125 1.173 christos .endif
126 1.173 christos .else
127 1.173 christos SHLIB_FULLVERSION=${SHLIB_MAJOR}
128 1.173 christos .endif
129 1.252 lukem .endif # }
130 1.1 cgd
131 1.101 mycroft # add additional suffixes not exported.
132 1.101 mycroft # .po is used for profiling object files.
133 1.304 njoly # .pico is used for PIC object files.
134 1.304 njoly .SUFFIXES: .out .a .ln .pico .po .go .o .s .S .c .cc .cpp .cxx .C .m .F .f .r .y .l .cl .p .h
135 1.118 lukem .SUFFIXES: .sh .m4 .m
136 1.82 mikel
137 1.86 jonathan
138 1.86 jonathan # Set PICFLAGS to cc flags for producing position-independent code,
139 1.86 jonathan # if not already set. Includes -DPIC, if required.
140 1.86 jonathan
141 1.164 simonb # Data-driven table using make variables to control how shared libraries
142 1.86 jonathan # are built for different platforms and object formats.
143 1.125 jonathan # OBJECT_FMT: currently either "ELF" or "a.out", from <bsd.own.mk>
144 1.302 abs # SHLIB_MAJOR, SHLIB_MINOR, SHLIB_TEENY: Major, minor, and teeny version
145 1.302 abs # numbers of shared library
146 1.164 simonb # SHLIB_SOVERSION: version number to be compiled into a shared library
147 1.164 simonb # via -soname. Usualy ${SHLIB_MAJOR} on ELF.
148 1.173 christos # NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
149 1.173 christos # [.${SHLIB_TEENY}]]
150 1.164 simonb # SHLIB_SHFLAGS: Flags to tell ${LD} to emit shared library.
151 1.123 jonathan # with ELF, also set shared-lib version for ld.so.
152 1.123 jonathan # SHLIB_LDSTARTFILE: support .o file, call C++ file-level constructors
153 1.123 jonathan # SHLIB_LDENDFILE: support .o file, call C++ file-level destructors
154 1.304 njoly # FPICFLAGS: flags for ${FC} to compile .[fF] files to .pico objects.
155 1.271 tsutsui # CPPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS}
156 1.205 yamt # CPICFLAGS: flags for ${CC} to compile .[cC] files to pic objects.
157 1.304 njoly # CSHLIBFLAGS: flags for ${CC} to compile .[cC] files to .pico objects.
158 1.205 yamt # (usually includes ${CPICFLAGS})
159 1.205 yamt # CAPICFLAGS: flags for ${CC} to compiling .[Ss] files
160 1.107 jonathan # (usually just ${CPPPICFLAGS} ${CPICFLAGS})
161 1.304 njoly # APICFLAGS: flags for ${AS} to assemble .[sS] to .pico objects.
162 1.86 jonathan
163 1.252 lukem .if ${MACHINE_ARCH} == "alpha" # {
164 1.209 thorpej
165 1.179 dmcmahil FPICFLAGS ?= -fPIC
166 1.165 dmcmahil CPICFLAGS ?= -fPIC -DPIC
167 1.222 lukem CPPPICFLAGS?= -DPIC
168 1.107 jonathan CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
169 1.107 jonathan APICFLAGS ?=
170 1.209 thorpej
171 1.175 mrg .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
172 1.252 lukem ${OBJECT_FMT} == "ELF" # } {
173 1.209 thorpej
174 1.222 lukem # If you use -fPIC you need to define BIGPIC to turn on 32-bit
175 1.202 eeh # relocations in asm code
176 1.179 dmcmahil FPICFLAGS ?= -fPIC
177 1.165 dmcmahil CPICFLAGS ?= -fPIC -DPIC
178 1.202 eeh CPPPICFLAGS?= -DPIC -DBIGPIC
179 1.150 christos CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
180 1.203 eeh APICFLAGS ?= -KPIC
181 1.204 fredette
182 1.252 lukem .else # } {
183 1.86 jonathan
184 1.244 skrll # Platform-independent flags for NetBSD shared libraries
185 1.171 christos SHLIB_SOVERSION=${SHLIB_FULLVERSION}
186 1.125 jonathan SHLIB_SHFLAGS=
187 1.179 dmcmahil FPICFLAGS ?= -fPIC
188 1.165 dmcmahil CPICFLAGS?= -fPIC -DPIC
189 1.222 lukem CPPPICFLAGS?= -DPIC
190 1.107 jonathan CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
191 1.107 jonathan APICFLAGS?= -k
192 1.86 jonathan
193 1.252 lukem .endif # }
194 1.160 simonb
195 1.205 yamt .if ${MKPICLIB} != "no"
196 1.205 yamt CSHLIBFLAGS+= ${CPICFLAGS}
197 1.205 yamt .endif
198 1.205 yamt
199 1.205 yamt .if defined(CSHLIBFLAGS) && !empty(CSHLIBFLAGS)
200 1.205 yamt MKSHLIBOBJS= yes
201 1.205 yamt .else
202 1.205 yamt MKSHLIBOBJS= no
203 1.205 yamt .endif
204 1.205 yamt
205 1.123 jonathan # Platform-independent linker flags for ELF shared libraries
206 1.148 lukem .if ${OBJECT_FMT} == "ELF"
207 1.182 mrg SHLIB_SOVERSION= ${SHLIB_MAJOR}
208 1.282 lukem SHLIB_SHFLAGS= -Wl,-soname,${_LIB_PREFIX}${LIB}.so.${SHLIB_SOVERSION}
209 1.272 christos SHLIB_SHFLAGS+= -Wl,--warn-shared-textrel
210 1.301 mrg SHLIB_LDSTARTFILE?= ${_GCC_CRTDIR}/crti.o ${_GCC_CRTBEGINS}
211 1.301 mrg SHLIB_LDENDFILE?= ${_GCC_CRTENDS} ${_GCC_CRTDIR}/crtn.o
212 1.123 jonathan .endif
213 1.86 jonathan
214 1.82 mikel CFLAGS+= ${COPTS}
215 1.267 mrg OBJCFLAGS+= ${OBJCOPTS}
216 1.257 simonb AFLAGS+= ${COPTS}
217 1.179 dmcmahil FFLAGS+= ${FOPTS}
218 1.1 cgd
219 1.305 darran .if defined(CTFCONVERT)
220 1.305 darran .if defined(CFLAGS) && !empty(CFLAGS:M*-g*)
221 1.305 darran CTFFLAGS+= -g
222 1.305 darran .endif
223 1.305 darran .endif
224 1.305 darran
225 1.1 cgd .c.o:
226 1.238 lukem ${_MKTARGET_COMPILE}
227 1.263 dsl ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
228 1.305 darran .if defined(CTFCONVERT)
229 1.305 darran ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
230 1.305 darran .endif
231 1.270 martin .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
232 1.263 dsl ${OBJCOPY} -x ${.TARGET}
233 1.153 christos .endif
234 1.1 cgd
235 1.1 cgd .c.po:
236 1.238 lukem ${_MKTARGET_COMPILE}
237 1.263 dsl ${COMPILE.c} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.IMPSRC} -o ${.TARGET}
238 1.305 darran .if defined(CTFCONVERT)
239 1.305 darran ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
240 1.305 darran .endif
241 1.270 martin .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
242 1.263 dsl ${OBJCOPY} -X ${.TARGET}
243 1.153 christos .endif
244 1.17 mycroft
245 1.266 christos .c.go:
246 1.266 christos ${_MKTARGET_COMPILE}
247 1.266 christos ${COMPILE.c} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -g ${.IMPSRC} -o ${.TARGET}
248 1.266 christos
249 1.304 njoly .c.pico:
250 1.238 lukem ${_MKTARGET_COMPILE}
251 1.263 dsl ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
252 1.270 martin .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
253 1.263 dsl ${OBJCOPY} -x ${.TARGET}
254 1.153 christos .endif
255 1.27 pk
256 1.223 lukem .cc.o .cpp.o .cxx.o .C.o:
257 1.238 lukem ${_MKTARGET_COMPILE}
258 1.263 dsl ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
259 1.270 martin .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
260 1.263 dsl ${OBJCOPY} -x ${.TARGET}
261 1.153 christos .endif
262 1.17 mycroft
263 1.266 christos .cc.po .cpp.po .cxx.po .C.po:
264 1.238 lukem ${_MKTARGET_COMPILE}
265 1.263 dsl ${COMPILE.cc} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.IMPSRC} -o ${.TARGET}
266 1.270 martin .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
267 1.263 dsl ${OBJCOPY} -X ${.TARGET}
268 1.153 christos .endif
269 1.28 cgd
270 1.266 christos .cc.go .cpp.go .cxx.go .C.go:
271 1.266 christos ${_MKTARGET_COMPILE}
272 1.266 christos ${COMPILE.cc} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -g ${.IMPSRC} -o ${.TARGET}
273 1.266 christos
274 1.304 njoly .cc.pico .cpp.pico .cxx.pico .C.pico:
275 1.238 lukem ${_MKTARGET_COMPILE}
276 1.263 dsl ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
277 1.270 martin .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
278 1.263 dsl ${OBJCOPY} -x ${.TARGET}
279 1.153 christos .endif
280 1.118 lukem
281 1.179 dmcmahil .f.o:
282 1.238 lukem ${_MKTARGET_COMPILE}
283 1.263 dsl ${COMPILE.f} ${.IMPSRC} -o ${.TARGET}
284 1.305 darran .if defined(CTFCONVERT)
285 1.305 darran ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
286 1.305 darran .endif
287 1.263 dsl .if !defined(FOPTS) || empty(FOPTS:M*-g*)
288 1.263 dsl ${OBJCOPY} -x ${.TARGET}
289 1.179 dmcmahil .endif
290 1.179 dmcmahil
291 1.179 dmcmahil .f.po:
292 1.238 lukem ${_MKTARGET_COMPILE}
293 1.263 dsl ${COMPILE.f} ${PROFFLAGS} -pg ${.IMPSRC} -o ${.TARGET}
294 1.305 darran .if defined(CTFCONVERT)
295 1.305 darran ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
296 1.305 darran .endif
297 1.263 dsl .if !defined(FOPTS) || empty(FOPTS:M*-g*)
298 1.263 dsl ${OBJCOPY} -X ${.TARGET}
299 1.179 dmcmahil .endif
300 1.179 dmcmahil
301 1.266 christos .f.go:
302 1.266 christos ${_MKTARGET_COMPILE}
303 1.266 christos ${COMPILE.f} ${DEBUGFLAGS} -g ${.IMPSRC} -o ${.TARGET}
304 1.266 christos
305 1.304 njoly .f.pico:
306 1.238 lukem ${_MKTARGET_COMPILE}
307 1.263 dsl ${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
308 1.263 dsl .if !defined(FOPTS) || empty(FOPTS:M*-g*)
309 1.263 dsl ${OBJCOPY} -x ${.TARGET}
310 1.179 dmcmahil .endif
311 1.179 dmcmahil
312 1.179 dmcmahil .f.ln:
313 1.238 lukem ${_MKTARGET_COMPILE}
314 1.217 wiz @echo Skipping lint for Fortran libraries.
315 1.179 dmcmahil
316 1.118 lukem .m.o:
317 1.238 lukem ${_MKTARGET_COMPILE}
318 1.267 mrg ${COMPILE.m} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
319 1.305 darran .if defined(CTFCONVERT)
320 1.305 darran ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
321 1.305 darran .endif
322 1.263 dsl .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
323 1.263 dsl ${OBJCOPY} -x ${.TARGET}
324 1.153 christos .endif
325 1.118 lukem
326 1.118 lukem .m.po:
327 1.238 lukem ${_MKTARGET_COMPILE}
328 1.267 mrg ${COMPILE.m} ${PROFFLAGS} -pg ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
329 1.305 darran .if defined(CTFCONVERT)
330 1.305 darran ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
331 1.305 darran .endif
332 1.263 dsl .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
333 1.263 dsl ${OBJCOPY} -X ${.TARGET}
334 1.153 christos .endif
335 1.118 lukem
336 1.266 christos .m.go:
337 1.266 christos ${_MKTARGET_COMPILE}
338 1.267 mrg ${COMPILE.m} ${DEBUGFLAGS} -g ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
339 1.266 christos .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
340 1.266 christos ${OBJCOPY} -X ${.TARGET}
341 1.266 christos .endif
342 1.266 christos
343 1.304 njoly .m.pico:
344 1.238 lukem ${_MKTARGET_COMPILE}
345 1.267 mrg ${COMPILE.m} ${CSHLIBFLAGS} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
346 1.263 dsl .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
347 1.263 dsl ${OBJCOPY} -x ${.TARGET}
348 1.153 christos .endif
349 1.1 cgd
350 1.251 lukem .s.o:
351 1.238 lukem ${_MKTARGET_COMPILE}
352 1.263 dsl ${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
353 1.305 darran .if defined(CTFCONVERT)
354 1.305 darran ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
355 1.305 darran .endif
356 1.263 dsl ${OBJCOPY} -x ${.TARGET}
357 1.1 cgd
358 1.251 lukem .S.o:
359 1.251 lukem ${_MKTARGET_COMPILE}
360 1.263 dsl ${COMPILE.S} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
361 1.305 darran .if defined(CTFCONVERT)
362 1.305 darran ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
363 1.305 darran .endif
364 1.263 dsl ${OBJCOPY} -x ${.TARGET}
365 1.251 lukem
366 1.251 lukem .s.po:
367 1.251 lukem ${_MKTARGET_COMPILE}
368 1.263 dsl ${COMPILE.s} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
369 1.305 darran .if defined(CTFCONVERT)
370 1.305 darran ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
371 1.305 darran .endif
372 1.263 dsl ${OBJCOPY} -X ${.TARGET}
373 1.251 lukem
374 1.251 lukem .S.po:
375 1.238 lukem ${_MKTARGET_COMPILE}
376 1.263 dsl ${COMPILE.S} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
377 1.305 darran .if defined(CTFCONVERT)
378 1.305 darran ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
379 1.305 darran .endif
380 1.263 dsl ${OBJCOPY} -X ${.TARGET}
381 1.1 cgd
382 1.266 christos .s.go:
383 1.266 christos ${_MKTARGET_COMPILE}
384 1.266 christos ${COMPILE.s} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
385 1.266 christos
386 1.266 christos .S.go:
387 1.266 christos ${_MKTARGET_COMPILE}
388 1.266 christos ${COMPILE.S} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
389 1.266 christos
390 1.304 njoly .s.pico:
391 1.251 lukem ${_MKTARGET_COMPILE}
392 1.263 dsl ${COMPILE.s} ${CAPICFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
393 1.263 dsl ${OBJCOPY} -x ${.TARGET}
394 1.251 lukem
395 1.304 njoly .S.pico:
396 1.238 lukem ${_MKTARGET_COMPILE}
397 1.263 dsl ${COMPILE.S} ${CAPICFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
398 1.263 dsl ${OBJCOPY} -x ${.TARGET}
399 1.27 pk
400 1.252 lukem .if defined(LIB) # {
401 1.234 lukem .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
402 1.234 lukem || ${MKLINKLIB} != "no") && ${MKSTATICLIB} != "no"
403 1.130 tv _LIBS=lib${LIB}.a
404 1.130 tv .else
405 1.130 tv _LIBS=
406 1.130 tv .endif
407 1.58 cgd
408 1.167 matt OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
409 1.158 christos
410 1.255 thorpej STOBJS+=${OBJS}
411 1.255 thorpej
412 1.280 lukem LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
413 1.280 lukem
414 1.281 lukem .if ${LIBISPRIVATE} != "no"
415 1.252 lukem # No installation is required
416 1.252 lukem libinstall::
417 1.290 cube .endif # ${LIBISPRIVATE} == "no" # {
418 1.252 lukem
419 1.268 lukem .if ${MKDEBUGLIB} != "no"
420 1.266 christos _LIBS+=lib${LIB}_g.a
421 1.266 christos GOBJS+=${OBJS:.o=.go}
422 1.266 christos DEBUGFLAGS?=-DDEBUG
423 1.266 christos .endif
424 1.266 christos
425 1.149 lukem .if ${MKPROFILE} != "no"
426 1.130 tv _LIBS+=lib${LIB}_p.a
427 1.167 matt POBJS+=${OBJS:.o=.po}
428 1.262 christos PROFFLAGS?=-DGPROF -DPROF
429 1.1 cgd .endif
430 1.1 cgd
431 1.252 lukem .if ${MKPIC} != "no" # {
432 1.160 simonb .if ${MKPICLIB} == "no"
433 1.205 yamt .if ${MKSHLIBOBJS} != "no"
434 1.205 yamt # make _pic.a, which isn't really pic,
435 1.205 yamt # since it's needed for making shared lib.
436 1.205 yamt # but don't install it.
437 1.205 yamt SOLIB=lib${LIB}_pic.a
438 1.304 njoly SOBJS+=${OBJS:.o=.pico}
439 1.205 yamt .else
440 1.160 simonb SOLIB=lib${LIB}.a
441 1.205 yamt .endif
442 1.160 simonb .else
443 1.160 simonb SOLIB=lib${LIB}_pic.a
444 1.160 simonb _LIBS+=${SOLIB}
445 1.304 njoly SOBJS+=${OBJS:.o=.pico}
446 1.160 simonb .endif
447 1.171 christos .if defined(SHLIB_FULLVERSION)
448 1.171 christos _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
449 1.27 pk .endif
450 1.252 lukem .endif # }
451 1.27 pk
452 1.279 lukem .if ${MKLINT} != "no" && !empty(LOBJS)
453 1.58 cgd _LIBS+=llib-l${LIB}.ln
454 1.215 christos .endif
455 1.27 pk
456 1.234 lukem ALLOBJS=
457 1.234 lukem .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
458 1.234 lukem || ${MKLINKLIB} != "no") && ${MKSTATICLIB} != "no"
459 1.255 thorpej ALLOBJS+=${STOBJS}
460 1.179 dmcmahil .endif
461 1.234 lukem ALLOBJS+=${POBJS} ${SOBJS}
462 1.279 lukem .if ${MKLINT} != "no" && !empty(LOBJS)
463 1.179 dmcmahil ALLOBJS+=${LOBJS}
464 1.216 christos .endif
465 1.252 lukem .else # !defined(LIB) # } {
466 1.216 christos LOBJS=
467 1.216 christos SOBJS=
468 1.252 lukem .endif # !defined(LIB) # }
469 1.186 tv
470 1.254 lukem _YLSRCS= ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
471 1.253 christos
472 1.253 christos .NOPATH: ${ALLOBJS} ${_LIBS} ${_YLSRCS}
473 1.158 christos
474 1.162 mycroft realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
475 1.1 cgd
476 1.296 perry MKARZERO?=no
477 1.296 perry
478 1.296 perry .if ${MKARZERO} == "yes"
479 1.296 perry _ARFL=crsD
480 1.297 perry _ARRANFL=sD
481 1.296 perry _INSTRANLIB=
482 1.296 perry .else
483 1.296 perry _ARFL=crs
484 1.297 perry _ARRANFL=s
485 1.296 perry _INSTRANLIB=${empty(PRESERVE):?-a "${RANLIB} -t":}
486 1.296 perry .endif
487 1.296 perry
488 1.293 pooka # If you change this, please consider reflecting the change in
489 1.293 pooka # the override in sys/rump/Makefile.rump.
490 1.243 rtr .if !target(__archivebuild)
491 1.90 christos __archivebuild: .USE
492 1.238 lukem ${_MKTARGET_BUILD}
493 1.236 lukem rm -f ${.TARGET}
494 1.296 perry ${AR} ${_ARFL} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
495 1.243 rtr .endif
496 1.89 christos
497 1.243 rtr .if !target(__archiveinstall)
498 1.89 christos __archiveinstall: .USE
499 1.238 lukem ${_MKTARGET_INSTALL}
500 1.198 lukem ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
501 1.296 perry ${_INSTRANLIB} ${.ALLSRC} ${.TARGET}
502 1.243 rtr .endif
503 1.89 christos
504 1.197 mycroft __archivesymlinkpic: .USE
505 1.238 lukem ${_MKTARGET_INSTALL}
506 1.264 jwise ${INSTALL_SYMLINK} ${.ALLSRC} ${.TARGET}
507 1.197 mycroft
508 1.253 christos DPSRCS+= ${_YLSRCS}
509 1.253 christos CLEANFILES+= ${_YLSRCS}
510 1.230 lukem
511 1.266 christos ${STOBJS} ${POBJS} ${GOBJS} ${SOBJS} ${LOBJS}: ${DPSRCS}
512 1.103 mycroft
513 1.255 thorpej lib${LIB}.a:: ${STOBJS} __archivebuild
514 1.1 cgd
515 1.89 christos lib${LIB}_p.a:: ${POBJS} __archivebuild
516 1.1 cgd
517 1.89 christos lib${LIB}_pic.a:: ${SOBJS} __archivebuild
518 1.27 pk
519 1.266 christos lib${LIB}_g.a:: ${GOBJS} __archivebuild
520 1.266 christos
521 1.235 lukem
522 1.235 lukem _LIBLDOPTS=
523 1.235 lukem .if ${SHLIBDIR} != "/usr/lib"
524 1.235 lukem _LIBLDOPTS+= -Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib \
525 1.235 lukem -R${SHLIBDIR} \
526 1.235 lukem -L${DESTDIR}${SHLIBDIR}
527 1.235 lukem .elif ${SHLIBINSTALLDIR} != "/usr/lib"
528 1.235 lukem _LIBLDOPTS+= -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR}:${DESTDIR}/usr/lib \
529 1.235 lukem -L${DESTDIR}${SHLIBINSTALLDIR}
530 1.235 lukem .endif
531 1.235 lukem
532 1.277 christos # gcc -shared now adds -lc automatically. For libraries other than libc and
533 1.277 christos # libgcc* we add as a dependency the installed shared libc. For libc and
534 1.277 christos # libgcc* we avoid adding libc as a dependency by using -nostdlib. Note that
535 1.277 christos # -Xl,-nostdlib is not enough because we want to tell the compiler-driver not
536 1.277 christos # to add standard libraries, not the linker.
537 1.276 christos .if !defined(LIB)
538 1.274 christos DPLIBC ?= ${DESTDIR}${LIBC_SO}
539 1.276 christos .else
540 1.278 simonb .if ${LIB} != "c" && ${LIB:Mgcc*} == ""
541 1.276 christos DPLIBC ?= ${DESTDIR}${LIBC_SO}
542 1.277 christos .else
543 1.278 simonb LDLIBC ?= -nodefaultlibs
544 1.278 simonb .if ${LIB} == "c"
545 1.278 simonb LDADD+= -lgcc_pic
546 1.278 simonb .endif
547 1.276 christos .endif
548 1.274 christos .endif
549 1.274 christos
550 1.291 mrg .if ${LIBISCXX} != "no"
551 1.291 mrg LIBCC:= ${CXX}
552 1.291 mrg .else
553 1.291 mrg LIBCC:= ${CC}
554 1.291 mrg .endif
555 1.291 mrg
556 1.300 uebayasi _LDADD.lib${LIB}= ${LDADD} ${LDADD.lib${LIB}}
557 1.300 uebayasi _LDFLAGS.lib${LIB}= ${LDFLAGS} ${LDFLAGS.lib${LIB}}
558 1.300 uebayasi
559 1.274 christos lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} ${DPLIBC} \
560 1.88 cgd ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
561 1.238 lukem ${_MKTARGET_BUILD}
562 1.236 lukem rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
563 1.152 fair .if defined(DESTDIR)
564 1.301 mrg ${LIBCC} ${LDLIBC} -Wl,-nostdlib -B${_GCC_CRTDIR}/ -B${DESTDIR}${SHLIBDIR}/ \
565 1.294 he -Wl,-x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
566 1.221 drochner -Wl,--whole-archive ${SOLIB} \
567 1.300 uebayasi -Wl,--no-whole-archive ${_LDADD.lib${LIB}} \
568 1.300 uebayasi ${_LIBLDOPTS} ${_LDFLAGS.lib${LIB}} \
569 1.277 christos -L${_GCC_LIBGCCDIR}
570 1.221 drochner .else
571 1.300 uebayasi ${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} ${_LDFLAGS.lib${LIB}} \
572 1.277 christos -o ${.TARGET} ${_LIBLDOPTS} \
573 1.300 uebayasi -Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${_LDADD.lib${LIB}}
574 1.152 fair .endif
575 1.148 lukem .if ${OBJECT_FMT} == "ELF"
576 1.196 lukem # We don't use INSTALL_SYMLINK here because this is just
577 1.196 lukem # happening inside the build directory/objdir. XXX Why does
578 1.196 lukem # this spend so much effort on libraries that aren't live??? XXX
579 1.284 lukem .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
580 1.284 lukem "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
581 1.241 matt ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
582 1.177 mycroft mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
583 1.283 lukem .endif
584 1.241 matt ${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
585 1.177 mycroft mv -f lib${LIB}.so.tmp lib${LIB}.so
586 1.133 tv .endif
587 1.286 joerg .if ${MKSTRIPIDENT} != "no"
588 1.286 joerg ${OBJCOPY} -R .ident ${.TARGET}
589 1.286 joerg .endif
590 1.35 pk
591 1.252 lukem .if !empty(LOBJS) # {
592 1.103 mycroft LLIBS?= -lc
593 1.58 cgd llib-l${LIB}.ln: ${LOBJS}
594 1.238 lukem ${_MKTARGET_COMPILE}
595 1.236 lukem rm -f llib-l${LIB}.ln
596 1.206 thorpej .if defined(DESTDIR)
597 1.228 lukem ${LINT} -C${LIB} ${.ALLSRC} -L${DESTDIR}/usr/libdata ${LLIBS}
598 1.206 thorpej .else
599 1.228 lukem ${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
600 1.206 thorpej .endif
601 1.252 lukem .endif # }
602 1.1 cgd
603 1.280 lukem lint: ${LOBJS}
604 1.280 lukem .if defined(LOBJS) && !empty(LOBJS)
605 1.280 lukem ${LINT} ${LINTFLAGS} ${LOBJS}
606 1.280 lukem .endif
607 1.280 lukem
608 1.246 lukem cleanlib: .PHONY
609 1.48 mycroft rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
610 1.255 thorpej rm -f lib${LIB}.a ${STOBJS}
611 1.59 cgd rm -f lib${LIB}_p.a ${POBJS}
612 1.266 christos rm -f lib${LIB}_g.a ${GOBJS}
613 1.133 tv rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
614 1.266 christos rm -f ${STOBJS:=.tmp} ${POBJS:=.tmp} ${SOBJS:=.tmp} ${GOBJS:=.tmp}
615 1.59 cgd rm -f llib-l${LIB}.ln ${LOBJS}
616 1.1 cgd
617 1.252 lukem
618 1.252 lukem .if !target(libinstall) # {
619 1.148 lukem # Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
620 1.139 tv libinstall::
621 1.139 tv
622 1.234 lukem .if ${MKLINKLIB} != "no" && ${MKSTATICLIB} != "no"
623 1.89 christos libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
624 1.168 mycroft .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
625 1.197 mycroft
626 1.269 dbj .if ${MKUPDATE} == "no"
627 1.197 mycroft .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
628 1.197 mycroft ${DESTDIR}${LIBDIR}/lib${LIB}.a! .MADE
629 1.89 christos .endif
630 1.197 mycroft ${DESTDIR}${LIBDIR}/lib${LIB}.a! lib${LIB}.a __archiveinstall
631 1.197 mycroft .else
632 1.157 fredb .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
633 1.89 christos ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
634 1.89 christos .endif
635 1.89 christos ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
636 1.130 tv .endif
637 1.197 mycroft .endif
638 1.89 christos
639 1.149 lukem .if ${MKPROFILE} != "no"
640 1.89 christos libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
641 1.168 mycroft .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
642 1.197 mycroft
643 1.269 dbj .if ${MKUPDATE} == "no"
644 1.197 mycroft .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
645 1.197 mycroft ${DESTDIR}${LIBDIR}/lib${LIB}_p.a! .MADE
646 1.32 pk .endif
647 1.197 mycroft ${DESTDIR}${LIBDIR}/lib${LIB}_p.a! lib${LIB}_p.a __archiveinstall
648 1.197 mycroft .else
649 1.157 fredb .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
650 1.89 christos ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
651 1.89 christos .endif
652 1.89 christos ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
653 1.89 christos .endif
654 1.197 mycroft .endif
655 1.89 christos
656 1.268 lukem .if ${MKDEBUGLIB} != "no"
657 1.266 christos libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a
658 1.266 christos .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a
659 1.266 christos
660 1.269 dbj .if ${MKUPDATE} == "no"
661 1.266 christos .if !defined(BUILD) && !make(all) && !make(lib${LIB}_g.a)
662 1.266 christos ${DESTDIR}${LIBDIR}/lib${LIB}_g.a! .MADE
663 1.266 christos .endif
664 1.266 christos ${DESTDIR}${LIBDIR}/lib${LIB}_g.a! lib${LIB}_g.a __archiveinstall
665 1.266 christos .else
666 1.266 christos .if !defined(BUILD) && !make(all) && !make(lib${LIB}_g.a)
667 1.266 christos ${DESTDIR}${LIBDIR}/lib${LIB}_g.a: .MADE
668 1.266 christos .endif
669 1.266 christos ${DESTDIR}${LIBDIR}/lib${LIB}_g.a: lib${LIB}_g.a __archiveinstall
670 1.266 christos .endif
671 1.266 christos .endif
672 1.266 christos
673 1.149 lukem .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
674 1.168 mycroft libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
675 1.160 simonb .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
676 1.197 mycroft
677 1.269 dbj .if ${MKUPDATE} == "no"
678 1.197 mycroft .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
679 1.197 mycroft ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! .MADE
680 1.89 christos .endif
681 1.197 mycroft .if ${MKPICLIB} == "no"
682 1.197 mycroft ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}.a __archivesymlinkpic
683 1.197 mycroft .else
684 1.197 mycroft ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}_pic.a __archiveinstall
685 1.197 mycroft .endif
686 1.197 mycroft .else
687 1.157 fredb .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
688 1.89 christos ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
689 1.33 pk .endif
690 1.160 simonb .if ${MKPICLIB} == "no"
691 1.197 mycroft ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}.a __archivesymlinkpic
692 1.160 simonb .else
693 1.89 christos ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
694 1.160 simonb .endif
695 1.89 christos .endif
696 1.197 mycroft .endif
697 1.89 christos
698 1.171 christos .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
699 1.282 lukem _LIB_SO_TGT= ${DESTDIR}${_LIBSODIR}/${_LIB_PREFIX}${LIB}.so
700 1.282 lukem _LIB_SO_TGTLIBDIR= ${DESTDIR}${LIBDIR}/${_LIB_PREFIX}${LIB}.so
701 1.282 lukem
702 1.282 lukem libinstall:: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}
703 1.282 lukem .PRECIOUS: ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}
704 1.197 mycroft
705 1.269 dbj .if ${MKUPDATE} == "no"
706 1.197 mycroft .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
707 1.282 lukem ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}! .MADE
708 1.89 christos .endif
709 1.282 lukem ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}! lib${LIB}.so.${SHLIB_FULLVERSION}
710 1.197 mycroft .else
711 1.171 christos .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
712 1.282 lukem ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: .MADE
713 1.89 christos .endif
714 1.282 lukem ${_LIB_SO_TGT}.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
715 1.197 mycroft .endif
716 1.238 lukem ${_MKTARGET_INSTALL}
717 1.188 tv ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
718 1.264 jwise ${.ALLSRC} ${.TARGET}
719 1.195 lukem .if ${_LIBSODIR} != ${LIBDIR}
720 1.282 lukem ${INSTALL_SYMLINK} -l r \
721 1.282 lukem ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
722 1.282 lukem ${_LIB_SO_TGTLIBDIR}.${SHLIB_FULLVERSION}
723 1.195 lukem .endif
724 1.148 lukem .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
725 1.195 lukem /sbin/ldconfig -m ${_LIBSODIR} ${LIBDIR}
726 1.146 thorpej .endif
727 1.148 lukem .if ${OBJECT_FMT} == "ELF"
728 1.284 lukem .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
729 1.284 lukem "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
730 1.264 jwise ${INSTALL_SYMLINK} \
731 1.284 lukem ${_LIB_PREFIX}${LIB}.so.${SHLIB_FULLVERSION} \
732 1.282 lukem ${_LIB_SO_TGT}.${SHLIB_MAJOR}
733 1.195 lukem .if ${_LIBSODIR} != ${LIBDIR}
734 1.282 lukem ${INSTALL_SYMLINK} -l r \
735 1.282 lukem ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
736 1.282 lukem ${_LIB_SO_TGTLIBDIR}.${SHLIB_MAJOR}
737 1.195 lukem .endif
738 1.284 lukem .endif
739 1.148 lukem .if ${MKLINKLIB} != "no"
740 1.264 jwise ${INSTALL_SYMLINK} \
741 1.284 lukem ${_LIB_PREFIX}${LIB}.so.${SHLIB_FULLVERSION} \
742 1.282 lukem ${_LIB_SO_TGT}
743 1.195 lukem .if ${_LIBSODIR} != ${LIBDIR}
744 1.282 lukem ${INSTALL_SYMLINK} -l r \
745 1.282 lukem ${_LIB_SO_TGT}.${SHLIB_FULLVERSION} \
746 1.282 lukem ${_LIB_SO_TGTLIBDIR}
747 1.195 lukem .endif
748 1.83 cgd .endif
749 1.12 cgd .endif
750 1.139 tv .endif
751 1.89 christos
752 1.279 lukem .if ${MKLINT} != "no" && !empty(LOBJS)
753 1.89 christos libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
754 1.168 mycroft .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
755 1.197 mycroft
756 1.269 dbj .if ${MKUPDATE} == "no"
757 1.197 mycroft .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
758 1.197 mycroft ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln! .MADE
759 1.89 christos .endif
760 1.197 mycroft ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln! llib-l${LIB}.ln
761 1.197 mycroft .else
762 1.157 fredb .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
763 1.89 christos ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
764 1.89 christos .endif
765 1.95 mycroft ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
766 1.197 mycroft .endif
767 1.238 lukem ${_MKTARGET_INSTALL}
768 1.188 tv ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
769 1.264 jwise ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
770 1.58 cgd .endif
771 1.252 lukem .endif # !target(libinstall) # }
772 1.1 cgd
773 1.188 tv ##### Pull in related .mk logic
774 1.298 apb LINKSOWN?= ${LIBOWN}
775 1.298 apb LINKSGRP?= ${LIBGRP}
776 1.298 apb LINKSMODE?= ${LIBMODE}
777 1.1 cgd .include <bsd.man.mk>
778 1.57 jtc .include <bsd.nls.mk>
779 1.91 christos .include <bsd.files.mk>
780 1.89 christos .include <bsd.inc.mk>
781 1.109 cjs .include <bsd.links.mk>
782 1.24 mycroft .include <bsd.dep.mk>
783 1.117 mycroft
784 1.188 tv ${TARGETS}: # ensure existence
785