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