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