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