Annotation of src/share/mk/bsd.lib.mk, Revision 1.332
1.332 ! pooka 1: # $NetBSD: bsd.lib.mk,v 1.331 2013/02/13 08:00:47 nakayama 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.255 thorpej 458: STOBJS+=${OBJS}
459:
1.280 lukem 460: LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
461:
1.281 lukem 462: .if ${LIBISPRIVATE} != "no"
1.252 lukem 463: # No installation is required
464: libinstall::
1.306 lukem 465: .endif
1.252 lukem 466:
1.268 lukem 467: .if ${MKDEBUGLIB} != "no"
1.327 christos 468: _LIBS+=${_LIB_g.a}
1.266 christos 469: GOBJS+=${OBJS:.o=.go}
470: DEBUGFLAGS?=-DDEBUG
471: .endif
472:
1.149 lukem 473: .if ${MKPROFILE} != "no"
1.327 christos 474: _LIBS+=${_LIB_p.a}
1.167 matt 475: POBJS+=${OBJS:.o=.po}
1.262 christos 476: PROFFLAGS?=-DGPROF -DPROF
1.1 cgd 477: .endif
478:
1.252 lukem 479: .if ${MKPIC} != "no" # {
1.160 simonb 480: .if ${MKPICLIB} == "no"
1.205 yamt 481: .if ${MKSHLIBOBJS} != "no"
482: # make _pic.a, which isn't really pic,
483: # since it's needed for making shared lib.
484: # but don't install it.
1.327 christos 485: SOLIB=${_LIB_pic.a}
1.304 njoly 486: SOBJS+=${OBJS:.o=.pico}
1.205 yamt 487: .else
1.327 christos 488: SOLIB=${_LIB.a}
1.205 yamt 489: .endif
1.160 simonb 490: .else
1.327 christos 491: SOLIB=${_LIB_pic.a}
1.160 simonb 492: _LIBS+=${SOLIB}
1.304 njoly 493: SOBJS+=${OBJS:.o=.pico}
1.160 simonb 494: .endif
1.171 christos 495: .if defined(SHLIB_FULLVERSION)
1.327 christos 496: _LIBS+=${_LIB.so.full}
1.27 pk 497: .endif
1.252 lukem 498: .endif # }
1.27 pk 499:
1.279 lukem 500: .if ${MKLINT} != "no" && !empty(LOBJS)
1.327 christos 501: _LIBS+=${_LIB.ln}
1.215 christos 502: .endif
1.27 pk 503:
1.234 lukem 504: ALLOBJS=
505: .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
506: || ${MKLINKLIB} != "no") && ${MKSTATICLIB} != "no"
1.255 thorpej 507: ALLOBJS+=${STOBJS}
1.179 dmcmahil 508: .endif
1.234 lukem 509: ALLOBJS+=${POBJS} ${SOBJS}
1.279 lukem 510: .if ${MKLINT} != "no" && !empty(LOBJS)
1.179 dmcmahil 511: ALLOBJS+=${LOBJS}
1.216 christos 512: .endif
1.252 lukem 513: .else # !defined(LIB) # } {
1.216 christos 514: LOBJS=
515: SOBJS=
1.252 lukem 516: .endif # !defined(LIB) # }
1.186 tv 517:
1.254 lukem 518: _YLSRCS= ${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
1.253 christos 519:
520: .NOPATH: ${ALLOBJS} ${_LIBS} ${_YLSRCS}
1.158 christos 521:
1.327 christos 522: realall: ${SRCS} ${ALLOBJS:O} ${_LIBS} ${_LIB.so.debug}
1.1 cgd 523:
1.296 perry 524: MKARZERO?=no
525:
526: .if ${MKARZERO} == "yes"
527: _ARFL=crsD
1.297 perry 528: _ARRANFL=sD
1.296 perry 529: _INSTRANLIB=
530: .else
531: _ARFL=crs
1.297 perry 532: _ARRANFL=s
1.296 perry 533: _INSTRANLIB=${empty(PRESERVE):?-a "${RANLIB} -t":}
534: .endif
535:
1.293 pooka 536: # If you change this, please consider reflecting the change in
537: # the override in sys/rump/Makefile.rump.
1.243 rtr 538: .if !target(__archivebuild)
1.90 christos 539: __archivebuild: .USE
1.238 lukem 540: ${_MKTARGET_BUILD}
1.236 lukem 541: rm -f ${.TARGET}
1.296 perry 542: ${AR} ${_ARFL} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
1.243 rtr 543: .endif
1.89 christos 544:
1.243 rtr 545: .if !target(__archiveinstall)
1.89 christos 546: __archiveinstall: .USE
1.238 lukem 547: ${_MKTARGET_INSTALL}
1.198 lukem 548: ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.296 perry 549: ${_INSTRANLIB} ${.ALLSRC} ${.TARGET}
1.243 rtr 550: .endif
1.89 christos 551:
1.197 mycroft 552: __archivesymlinkpic: .USE
1.238 lukem 553: ${_MKTARGET_INSTALL}
1.264 jwise 554: ${INSTALL_SYMLINK} ${.ALLSRC} ${.TARGET}
1.197 mycroft 555:
1.253 christos 556: DPSRCS+= ${_YLSRCS}
557: CLEANFILES+= ${_YLSRCS}
1.230 lukem 558:
1.266 christos 559: ${STOBJS} ${POBJS} ${GOBJS} ${SOBJS} ${LOBJS}: ${DPSRCS}
1.103 mycroft 560:
1.327 christos 561: ${_LIB.a}:: ${STOBJS} __archivebuild
1.1 cgd 562:
1.327 christos 563: ${_LIB_p.a}:: ${POBJS} __archivebuild
1.1 cgd 564:
1.327 christos 565: ${_LIB_pic.a}:: ${SOBJS} __archivebuild
1.27 pk 566:
1.327 christos 567: ${_LIB_g.a}:: ${GOBJS} __archivebuild
1.266 christos 568:
1.235 lukem 569:
570: _LIBLDOPTS=
571: .if ${SHLIBDIR} != "/usr/lib"
1.324 joerg 572: _LIBLDOPTS+= -Wl,-rpath,${SHLIBDIR} \
573: -L=${SHLIBDIR}
574: .elif ${SHLIBINSTALLDIR} != "/usr/lib"
575: _LIBLDOPTS+= -Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR} \
576: -L=${SHLIBINSTALLDIR}
1.235 lukem 577: .endif
578:
1.277 christos 579: # gcc -shared now adds -lc automatically. For libraries other than libc and
580: # libgcc* we add as a dependency the installed shared libc. For libc and
581: # libgcc* we avoid adding libc as a dependency by using -nostdlib. Note that
582: # -Xl,-nostdlib is not enough because we want to tell the compiler-driver not
583: # to add standard libraries, not the linker.
1.276 christos 584: .if !defined(LIB)
1.312 matt 585: .if !empty(LIBC_SO)
1.274 christos 586: DPLIBC ?= ${DESTDIR}${LIBC_SO}
1.312 matt 587: .endif
1.276 christos 588: .else
1.278 simonb 589: .if ${LIB} != "c" && ${LIB:Mgcc*} == ""
1.312 matt 590: .if !empty(LIBC_SO)
1.276 christos 591: DPLIBC ?= ${DESTDIR}${LIBC_SO}
1.312 matt 592: .endif
1.277 christos 593: .else
1.278 simonb 594: LDLIBC ?= -nodefaultlibs
595: .if ${LIB} == "c"
1.318 mrg 596: LDADD+= -lgcc
1.278 simonb 597: .endif
1.276 christos 598: .endif
1.274 christos 599: .endif
600:
1.291 mrg 601: .if ${LIBISCXX} != "no"
602: LIBCC:= ${CXX}
603: .else
604: LIBCC:= ${CC}
605: .endif
606:
1.327 christos 607: _LDADD.${_LIB}= ${LDADD} ${LDADD.${_LIB}}
608: _LDFLAGS.${_LIB}= ${LDFLAGS} ${LDFLAGS.${_LIB}}
1.300 uebayasi 609:
1.327 christos 610: ${_LIB.so.full}: ${SOLIB} ${DPADD} ${DPLIBC} \
1.88 cgd 611: ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
1.238 lukem 612: ${_MKTARGET_BUILD}
1.327 christos 613: rm -f ${.TARGET}
614: ${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} \
615: ${_LDFLAGS.${_LIB}} -o ${.TARGET} ${_LIBLDOPTS} \
616: -Wl,--whole-archive ${SOLIB} \
1.328 matt 617: -Wl,--no-whole-archive ${_LDADD.${_LIB}}
1.196 lukem 618: # We don't use INSTALL_SYMLINK here because this is just
619: # happening inside the build directory/objdir. XXX Why does
620: # this spend so much effort on libraries that aren't live??? XXX
1.284 lukem 621: .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
622: "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
1.327 christos 623: ${HOST_LN} -sf ${_LIB.so.full} ${_LIB.so.major}.tmp
624: mv -f ${_LIB.so.major}.tmp ${_LIB.so.major}
1.283 lukem 625: .endif
1.327 christos 626: ${HOST_LN} -sf ${_LIB.so.full} ${_LIB.so}.tmp
627: mv -f ${_LIB.so}.tmp ${_LIB.so}
1.286 joerg 628: .if ${MKSTRIPIDENT} != "no"
629: ${OBJCOPY} -R .ident ${.TARGET}
630: .endif
1.35 pk 631:
1.327 christos 632: .if defined(_LIB.so.debug)
633: ${_LIB.so.debug}: ${_LIB.so.full}
1.307 lukem 634: ${_MKTARGET_CREATE}
1.327 christos 635: ( ${OBJCOPY} --only-keep-debug ${_LIB.so.full} ${_LIB.so.debug} \
1.309 lukem 636: && ${OBJCOPY} --strip-debug -p -R .gnu_debuglink \
1.327 christos 637: --add-gnu-debuglink=${_LIB.so.debug} ${_LIB.so.full} \
638: ) || (rm -f ${.TARGET}; false)
1.307 lukem 639: .endif
640:
1.252 lukem 641: .if !empty(LOBJS) # {
1.103 mycroft 642: LLIBS?= -lc
1.327 christos 643: ${_LIB.ln}: ${LOBJS}
1.238 lukem 644: ${_MKTARGET_COMPILE}
1.327 christos 645: rm -f ${.TARGET}
1.206 thorpej 646: .if defined(DESTDIR)
1.228 lukem 647: ${LINT} -C${LIB} ${.ALLSRC} -L${DESTDIR}/usr/libdata ${LLIBS}
1.206 thorpej 648: .else
1.228 lukem 649: ${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
1.206 thorpej 650: .endif
1.252 lukem 651: .endif # }
1.1 cgd 652:
1.280 lukem 653: lint: ${LOBJS}
654: .if defined(LOBJS) && !empty(LOBJS)
655: ${LINT} ${LINTFLAGS} ${LOBJS}
656: .endif
657:
1.327 christos 658:
1.317 apb 659: # If the number of entries in CLEANFILES is too large, then the
660: # commands in bsd.clean.mk encounter errors like "exec(/bin/sh)
661: # failed (Argument list too long)". Avoid that by splitting the
662: # files to clean into several lists using different variable names.
663: # __cleanuse is an internal target in bsd.clean.mk; the way we
664: # use it here mimics the way it's used by the clean target in
665: # bsd.clean.mk.
666: #
667: clean: libclean1 libclean2 libclean3 libclean4 libclean5
668: libclean1: .PHONY .MADE __cleanuse LIBCLEANFILES1
669: libclean2: .PHONY .MADE __cleanuse LIBCLEANFILES2
670: libclean3: .PHONY .MADE __cleanuse LIBCLEANFILES3
671: libclean4: .PHONY .MADE __cleanuse LIBCLEANFILES4
672: libclean5: .PHONY .MADE __cleanuse LIBCLEANFILES5
1.316 apb 673: CLEANFILES+= a.out [Ee]rrs mklog core *.core
1.327 christos 674: LIBCLEANFILES1+= ${_LIB.a} ${STOBJS} ${STOBJS:=.tmp}
675: LIBCLEANFILES2+= ${_LIB_p.a} ${POBJS} ${POBJS:=.tmp}
676: LIBCLEANFILES3+= ${_LIB_g.a} ${GOBJS} ${GOBJS:=.tmp}
677: LIBCLEANFILES4+= ${_LIB_pic.a}
678: .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
679: LIBCLEANFILES4+= ${_LIB.so}.* ${_LIB.so} ${_LIB.so.debug}
680: .endif
1.317 apb 681: LIBCLEANFILES4+= ${SOBJS} ${SOBJS:=.tmp}
1.327 christos 682: LIBCLEANFILES5+= ${_LIB.ln} ${LOBJS}
1.252 lukem 683:
684: .if !target(libinstall) # {
1.148 lukem 685: # Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
1.139 tv 686: libinstall::
687:
1.234 lukem 688: .if ${MKLINKLIB} != "no" && ${MKSTATICLIB} != "no"
1.327 christos 689: libinstall:: ${_DEST.LIB}/${_LIB.a}
690: .PRECIOUS: ${_DEST.LIB}/${_LIB.a}
1.197 mycroft 691:
1.269 dbj 692: .if ${MKUPDATE} == "no"
1.327 christos 693: .if !defined(BUILD) && !make(all) && !make(${_LIB.a})
694: ${_DEST.LIB}/${_LIB.a}! .MADE
1.89 christos 695: .endif
1.327 christos 696: ${_DEST.LIB}/${_LIB.a}! ${_LIB.a} __archiveinstall
1.197 mycroft 697: .else
1.327 christos 698: .if !defined(BUILD) && !make(all) && !make(${_LIB.a})
699: ${_DEST.LIB}/${_LIB.a}: .MADE
1.89 christos 700: .endif
1.327 christos 701: ${_DEST.LIB}/${_LIB.a}: ${_LIB.a} __archiveinstall
1.130 tv 702: .endif
1.197 mycroft 703: .endif
1.89 christos 704:
1.149 lukem 705: .if ${MKPROFILE} != "no"
1.327 christos 706: libinstall:: ${_DEST.LIB}/${_LIB_p.a}
707: .PRECIOUS: ${_DEST.LIB}/${_LIB_p.a}
1.197 mycroft 708:
1.269 dbj 709: .if ${MKUPDATE} == "no"
1.327 christos 710: .if !defined(BUILD) && !make(all) && !make(${_LIB_p.a})
711: ${_DEST.LIB}/${_LIB_p.a}! .MADE
1.32 pk 712: .endif
1.327 christos 713: ${_DEST.LIB}/${_LIB_p.a}! ${_LIB_p.a} __archiveinstall
1.197 mycroft 714: .else
1.327 christos 715: .if !defined(BUILD) && !make(all) && !make(${_LIB_p.a})
716: ${_DEST.LIB}/${_LIB_p.a}: .MADE
1.89 christos 717: .endif
1.327 christos 718: ${_DEST.LIB}/${_LIB_p.a}: ${_LIB_p.a} __archiveinstall
1.89 christos 719: .endif
1.197 mycroft 720: .endif
1.89 christos 721:
1.268 lukem 722: .if ${MKDEBUGLIB} != "no"
1.327 christos 723: libinstall:: ${_DEST.LIB}/${_LIB_g.a}
724: .PRECIOUS: ${_DEST.LIB}/${_LIB_g.a}
1.266 christos 725:
1.269 dbj 726: .if ${MKUPDATE} == "no"
1.329 spz 727: .if !defined(BUILD) && !make(all) && !make(${_LIB_g.a})
1.327 christos 728: ${_DEST.LIB}/${_LIB_g.a}! .MADE
1.266 christos 729: .endif
1.327 christos 730: ${_DEST.LIB}/${_LIB_g.a}! ${_LIB_g.a} __archiveinstall
1.266 christos 731: .else
1.327 christos 732: .if !defined(BUILD) && !make(all) && !make(${LIB_g.a})
733: ${_DEST.LIB}/${_LIB_g.a}: .MADE
1.266 christos 734: .endif
1.327 christos 735: ${_DEST.LIB}/${_LIB_g.a}: ${_LIB_g.a} __archiveinstall
1.266 christos 736: .endif
737: .endif
738:
1.149 lukem 739: .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
1.327 christos 740: libinstall:: ${_DEST.LIB}/${_LIB_pic.a}
741: .PRECIOUS: ${_DEST.LIB}/${_LIB_pic.a}
1.197 mycroft 742:
1.269 dbj 743: .if ${MKUPDATE} == "no"
1.327 christos 744: .if !defined(BUILD) && !make(all) && !make(${_LIB_pic.a})
745: ${_DEST.LIB}/${_LIB_pic.a}! .MADE
1.89 christos 746: .endif
1.197 mycroft 747: .if ${MKPICLIB} == "no"
1.331 nakayama 748: ${_DEST.LIB}/${_LIB_pic.a}! ${_LIB.a} __archivesymlinkpic
1.197 mycroft 749: .else
1.327 christos 750: ${_DEST.LIB}/${_LIB_pic.a}! ${_LIB_pic.a} __archiveinstall
1.197 mycroft 751: .endif
752: .else
1.327 christos 753: .if !defined(BUILD) && !make(all) && !make(${_LIB_pic.a})
754: ${_DEST.LIB}/${_LIB_pic.a}: .MADE
1.33 pk 755: .endif
1.160 simonb 756: .if ${MKPICLIB} == "no"
1.331 nakayama 757: ${_DEST.LIB}/${_LIB_pic.a}: ${_LIB.a} __archivesymlinkpic
1.160 simonb 758: .else
1.327 christos 759: ${_DEST.LIB}/${_LIB_pic.a}: ${_LIB_pic.a} __archiveinstall
1.160 simonb 760: .endif
1.89 christos 761: .endif
1.197 mycroft 762: .endif
1.89 christos 763:
1.171 christos 764: .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
1.282 lukem 765:
1.327 christos 766: libinstall:: ${_DEST.OBJ}/${_LIB.so.full}
767: .PRECIOUS: ${_DEST.OBJ}/${_LIB.so.full}
1.197 mycroft 768:
1.269 dbj 769: .if ${MKUPDATE} == "no"
1.327 christos 770: .if !defined(BUILD) && !make(all) && !make(${_LIB.so.full})
771: ${_DEST.OBJ}/${_LIB.so.full}! .MADE
1.89 christos 772: .endif
1.327 christos 773: ${_DEST.OBJ}/${_LIB.so.full}! ${_LIB.so.full}
1.197 mycroft 774: .else
1.327 christos 775: .if !defined(BUILD) && !make(all) && !make(${_LIB.so.full})
776: ${_DEST.OBJ}/${_LIB.so.full}: .MADE
1.89 christos 777: .endif
1.327 christos 778: ${_DEST.OBJ}/${_LIB.so.full}: ${_LIB.so.full}
1.197 mycroft 779: .endif
1.238 lukem 780: ${_MKTARGET_INSTALL}
1.188 tv 781: ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.327 christos 782: ${.ALLSRC} ${.TARGET}
1.195 lukem 783: .if ${_LIBSODIR} != ${LIBDIR}
1.327 christos 784: ${INSTALL_SYMLINK} -l r ${_DEST.OBJ}/${_LIB.so.full} \
785: ${_DEST.LIB}/${_LIB.so.full}
1.195 lukem 786: .endif
1.284 lukem 787: .if defined(SHLIB_FULLVERSION) && defined(SHLIB_MAJOR) && \
788: "${SHLIB_FULLVERSION}" != "${SHLIB_MAJOR}"
1.327 christos 789: ${INSTALL_SYMLINK} ${_LIB.so.full} ${_DEST.OBJ}/${_LIB.so.major}
1.195 lukem 790: .if ${_LIBSODIR} != ${LIBDIR}
1.327 christos 791: ${INSTALL_SYMLINK} -l r ${_DEST.OBJ}/${_LIB.so.full} \
792: ${_DEST.LIB}/${_LIB.so.major}
1.195 lukem 793: .endif
1.284 lukem 794: .endif
1.148 lukem 795: .if ${MKLINKLIB} != "no"
1.327 christos 796: ${INSTALL_SYMLINK} ${_LIB.so.full} ${_DEST.OBJ}/${_LIB.so}
1.195 lukem 797: .if ${_LIBSODIR} != ${LIBDIR}
1.327 christos 798: ${INSTALL_SYMLINK} -l r ${_DEST.OBJ}/${_LIB.so.full} \
799: ${_DEST.LIB}/${_LIB.so}
1.195 lukem 800: .endif
1.83 cgd 801: .endif
1.12 cgd 802: .endif
1.89 christos 803:
1.327 christos 804: .if defined(_LIB.so.debug)
805: libinstall:: ${_DEST.DEBUG}/${_LIB.so.debug}
806: .PRECIOUS: ${_DEST.DEBUG}/${_LIB.so.debug}
1.307 lukem 807:
1.327 christos 808: ${_DEST.DEBUG}/${_LIB.so.debug}: ${_LIB.so.debug}
1.307 lukem 809: ${_MKTARGET_INSTALL}
810: ${INSTALL_FILE} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
1.327 christos 811: ${.ALLSRC} ${.TARGET}
1.307 lukem 812: .endif
813:
1.279 lukem 814: .if ${MKLINT} != "no" && !empty(LOBJS)
1.327 christos 815: libinstall:: ${_DEST.LINT}/${_LIB.ln}
816: .PRECIOUS: ${_DEST.LINT}/${_LIB.ln}
1.197 mycroft 817:
1.269 dbj 818: .if ${MKUPDATE} == "no"
1.327 christos 819: .if !defined(BUILD) && !make(all) && !make(${_LIB.ln})
820: ${_DEST.LINT}/${_LIB.ln}! .MADE
1.89 christos 821: .endif
1.327 christos 822: ${_DEST.LINT}/${_LIB.ln}! ${_LIB.ln}
1.197 mycroft 823: .else
1.327 christos 824: .if !defined(BUILD) && !make(all) && !make(${_LIB.ln})
825: ${_DEST.LINT}/${_LIB.ln}: .MADE
1.89 christos 826: .endif
1.327 christos 827: ${_DEST.LINT}/${_LIB.ln}: ${_LIB.ln}
1.197 mycroft 828: .endif
1.238 lukem 829: ${_MKTARGET_INSTALL}
1.188 tv 830: ${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
1.327 christos 831: ${.ALLSRC} ${_DEST.LINT}
1.58 cgd 832: .endif
1.252 lukem 833: .endif # !target(libinstall) # }
1.1 cgd 834:
1.188 tv 835: ##### Pull in related .mk logic
1.298 apb 836: LINKSOWN?= ${LIBOWN}
837: LINKSGRP?= ${LIBGRP}
838: LINKSMODE?= ${LIBMODE}
1.1 cgd 839: .include <bsd.man.mk>
1.57 jtc 840: .include <bsd.nls.mk>
1.91 christos 841: .include <bsd.files.mk>
1.89 christos 842: .include <bsd.inc.mk>
1.109 cjs 843: .include <bsd.links.mk>
1.24 mycroft 844: .include <bsd.dep.mk>
1.315 joerg 845: .include <bsd.clang-analyze.mk>
1.316 apb 846: .include <bsd.clean.mk>
1.117 mycroft 847:
1.188 tv 848: ${TARGETS}: # ensure existence
CVSweb <webmaster@jp.NetBSD.org>