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