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