Annotation of src/share/mk/bsd.lib.mk, Revision 1.178
1.178 ! mycroft 1: # $NetBSD: bsd.lib.mk,v 1.177 2000/12/05 22:12:37 mycroft Exp $
1.92 mikel 2: # @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
1.1 cgd 3:
1.117 mycroft 4: .if !target(__initialized__)
5: __initialized__:
1.1 cgd 6: .if exists(${.CURDIR}/../Makefile.inc)
7: .include "${.CURDIR}/../Makefile.inc"
8: .endif
1.97 mycroft 9: .include <bsd.own.mk>
1.117 mycroft 10: .include <bsd.obj.mk>
1.159 perry 11: .include <bsd.depall.mk>
1.117 mycroft 12: .MAIN: all
13: .endif
1.97 mycroft 14:
1.143 erh 15: .PHONY: checkver cleanlib libinstall
16: realinstall: checkver libinstall
1.137 lukem 17: clean cleandir distclean: cleanlib
1.1 cgd 18:
1.154 simonb 19: .if exists(${SHLIB_VERSION_FILE})
20: SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
21: SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
1.171 christos 22: SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
1.143 erh 23:
24: # Check for higher installed library versions.
1.145 erh 25: .if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
26: exists(${BSDSRCDIR}/lib/checkver)
1.143 erh 27: checkver:
1.144 erh 28: @(cd ${.CURDIR} && \
1.176 gmcgarry 29: sh ${BSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
1.154 simonb 30: -d ${DESTDIR}${LIBDIR} ${LIB})
1.173 christos 31: .endif
32: .endif
33:
34: .if !target(checkver)
1.143 erh 35: checkver:
36: .endif
1.173 christos 37:
1.169 thorpej 38: print-shlib-major:
1.173 christos 39: .if defined(SHLIB_MAJOR)
1.169 thorpej 40: @echo ${SHLIB_MAJOR}
1.173 christos 41: .else
42: @false
43: .endif
1.169 thorpej 44:
45: print-shlib-minor:
1.173 christos 46: .if defined(SHLIB_MINOR)
1.169 thorpej 47: @echo ${SHLIB_MINOR}
1.173 christos 48: .else
49: @false
50: .endif
1.171 christos 51:
52: print-shlib-teeny:
1.173 christos 53: .if defined(SHLIB_TEENY)
1.171 christos 54: @echo ${SHLIB_TEENY}
1.143 erh 55: .else
1.169 thorpej 56: @false
1.173 christos 57: .endif
1.169 thorpej 58:
1.173 christos 59: .if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR)
60: .if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
61: .if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
62: SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
63: .else
64: SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
65: .endif
66: .else
67: SHLIB_FULLVERSION=${SHLIB_MAJOR}
68: .endif
1.35 pk 69: .endif
1.1 cgd 70:
1.101 mycroft 71: # add additional suffixes not exported.
72: # .po is used for profiling object files.
73: # .so is used for PIC object files.
1.118 lukem 74: .SUFFIXES: .out .a .ln .so .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h
75: .SUFFIXES: .sh .m4 .m
1.82 mikel 76:
1.86 jonathan 77:
78: # Set PICFLAGS to cc flags for producing position-independent code,
79: # if not already set. Includes -DPIC, if required.
80:
1.164 simonb 81: # Data-driven table using make variables to control how shared libraries
1.86 jonathan 82: # are built for different platforms and object formats.
1.125 jonathan 83: # OBJECT_FMT: currently either "ELF" or "a.out", from <bsd.own.mk>
1.164 simonb 84: # SHLIB_SOVERSION: version number to be compiled into a shared library
85: # via -soname. Usualy ${SHLIB_MAJOR} on ELF.
1.173 christos 86: # NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
87: # [.${SHLIB_TEENY}]]
1.164 simonb 88: # SHLIB_SHFLAGS: Flags to tell ${LD} to emit shared library.
1.123 jonathan 89: # with ELF, also set shared-lib version for ld.so.
90: # SHLIB_LDSTARTFILE: support .o file, call C++ file-level constructors
91: # SHLIB_LDENDFILE: support .o file, call C++ file-level destructors
1.164 simonb 92: # CPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS}
93: # CPICFLAGS: flags for ${CC} to compile .[cC] files to .so objects.
94: # CAPICFLAGS flags for {$CC} to compiling .[Ss] files
1.107 jonathan 95: # (usually just ${CPPPICFLAGS} ${CPICFLAGS})
1.164 simonb 96: # APICFLAGS: flags for ${AS} to assemble .[sS] to .so objects.
1.86 jonathan 97:
1.148 lukem 98: .if ${MACHINE_ARCH} == "alpha"
1.123 jonathan 99: # Alpha-specific shared library flags
1.165 dmcmahil 100: CPICFLAGS ?= -fPIC -DPIC
1.107 jonathan 101: CPPPICFLAGS?= -DPIC
102: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
103: APICFLAGS ?=
1.151 drochner 104: .elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
1.123 jonathan 105: # mips-specific shared library flags
1.86 jonathan 106:
1.160 simonb 107: # On mips, all libs are compiled with ABIcalls, not just sharedlibs.
108: MKPICLIB= no
109:
110: # so turn shlib PIC flags on for ${AS}.
111: AINC+=-DABICALLS
1.86 jonathan 112: AFLAGS+= -fPIC
113: AS+= -KPIC
1.172 matt 114:
115: .elif ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
116: # On the VAX, all object are PIC by default, not just sharedlibs.
117: MKPICLIB= no
1.150 christos 118:
1.175 mrg 119: .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
120: ${OBJECT_FMT} == "ELF"
1.150 christos 121:
1.165 dmcmahil 122: CPICFLAGS ?= -fPIC -DPIC
1.150 christos 123: CPPPICFLAGS?= -DPIC
124: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
125: APICFLAGS ?= -KPIC
1.86 jonathan 126:
127: .else
128:
1.125 jonathan 129: # Platform-independent flags for NetBSD a.out shared libraries (and PowerPC)
1.88 cgd 130: SHLIB_LDSTARTFILE=
131: SHLIB_LDENDFILE=
1.171 christos 132: SHLIB_SOVERSION=${SHLIB_FULLVERSION}
1.125 jonathan 133: SHLIB_SHFLAGS=
1.165 dmcmahil 134: CPICFLAGS?= -fPIC -DPIC
1.107 jonathan 135: CPPPICFLAGS?= -DPIC
136: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
137: APICFLAGS?= -k
1.86 jonathan 138:
139: .endif
140:
1.160 simonb 141: MKPICLIB?= yes
142:
1.123 jonathan 143: # Platform-independent linker flags for ELF shared libraries
1.148 lukem 144: .if ${OBJECT_FMT} == "ELF"
1.123 jonathan 145: SHLIB_SOVERSION=${SHLIB_MAJOR}
1.125 jonathan 146: SHLIB_SHFLAGS=-soname lib${LIB}.so.${SHLIB_SOVERSION}
1.142 jonathan 147: SHLIB_LDSTARTFILE= ${DESTDIR}/usr/lib/crtbeginS.o
148: SHLIB_LDENDFILE= ${DESTDIR}/usr/lib/crtendS.o
1.123 jonathan 149: .endif
1.86 jonathan 150:
1.82 mikel 151: CFLAGS+= ${COPTS}
1.1 cgd 152:
153: .c.o:
1.153 christos 154: .if defined(COPTS) && !empty(COPTS:M*-g*)
155: ${COMPILE.c} ${.IMPSRC}
156: .else
1.80 christos 157: @echo ${COMPILE.c:Q} ${.IMPSRC}
1.122 cgd 158: @${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 159: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
160: @rm -f ${.TARGET}.o
1.153 christos 161: .endif
1.1 cgd 162:
163: .c.po:
1.153 christos 164: .if defined(COPTS) && !empty(COPTS:M*-g*)
165: ${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}
166: .else
1.80 christos 167: @echo ${COMPILE.c:Q} -pg ${.IMPSRC} -o ${.TARGET}
1.68 cgd 168: @${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 169: @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
170: @rm -f ${.TARGET}.o
1.153 christos 171: .endif
1.17 mycroft 172:
1.27 pk 173: .c.so:
1.153 christos 174: .if defined(COPTS) && !empty(COPTS:M*-g*)
175: ${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
176: .else
1.86 jonathan 177: @echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
178: @${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 179: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
180: @rm -f ${.TARGET}.o
1.153 christos 181: .endif
1.27 pk 182:
1.58 cgd 183: .c.ln:
1.121 thorpej 184: ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
1.58 cgd 185:
1.18 mycroft 186: .cc.o .C.o:
1.153 christos 187: .if defined(COPTS) && !empty(COPTS:M*-g*)
188: ${COMPILE.cc} ${.IMPSRC}
189: .else
1.80 christos 190: @echo ${COMPILE.cc:Q} ${.IMPSRC}
1.62 christos 191: @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o
1.63 jtc 192: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
1.62 christos 193: @rm -f ${.TARGET}.o
1.153 christos 194: .endif
1.17 mycroft 195:
1.18 mycroft 196: .cc.po .C.po:
1.153 christos 197: .if defined(COPTS) && !empty(COPTS:M*-g*)
198: ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}
199: .else
1.80 christos 200: @echo ${COMPILE.cc:Q} -pg ${.IMPSRC} -o ${.TARGET}
1.68 cgd 201: @${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 202: @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
203: @rm -f ${.TARGET}.o
1.153 christos 204: .endif
1.28 cgd 205:
206: .cc.so .C.so:
1.153 christos 207: .if defined(COPTS) && !empty(COPTS:M*-g*)
208: ${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
209: .else
1.86 jonathan 210: @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
211: @${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 212: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
213: @rm -f ${.TARGET}.o
1.153 christos 214: .endif
1.118 lukem 215:
216: .m.o:
1.153 christos 217: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
218: ${COMPILE.m} ${.IMPSRC}
219: .else
1.118 lukem 220: @echo ${COMPILE.m:Q} ${.IMPSRC}
1.122 cgd 221: @${COMPILE.m} ${.IMPSRC} -o ${.TARGET}.o
1.118 lukem 222: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
223: @rm -f ${.TARGET}.o
1.153 christos 224: .endif
1.118 lukem 225:
226: .m.po:
1.153 christos 227: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
228: ${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}
229: .else
1.118 lukem 230: @echo ${COMPILE.m:Q} -pg ${.IMPSRC} -o ${.TARGET}
231: @${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}.o
232: @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
233: @rm -f ${.TARGET}.o
1.153 christos 234: .endif
1.118 lukem 235:
236: .m.so:
1.153 christos 237: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
238: ${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
239: .else
1.118 lukem 240: @echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
241: @${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
242: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
243: @rm -f ${.TARGET}.o
1.153 christos 244: .endif
1.1 cgd 245:
1.40 cgd 246: .S.o .s.o:
1.80 christos 247: @echo ${COMPILE.S:Q} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC}
1.69 jtc 248: @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 249: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
250: @rm -f ${.TARGET}.o
1.1 cgd 251:
1.40 cgd 252: .S.po .s.po:
1.80 christos 253: @echo ${COMPILE.S:Q} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
1.75 jtc 254: @${COMPILE.S} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 255: @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
256: @rm -f ${.TARGET}.o
1.1 cgd 257:
1.40 cgd 258: .S.so .s.so:
1.107 jonathan 259: @echo ${COMPILE.S:Q} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
260: @${COMPILE.S} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 261: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
262: @rm -f ${.TARGET}.o
1.27 pk 263:
1.148 lukem 264: .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
265: || ${MKLINKLIB} != "no"
1.130 tv 266: _LIBS=lib${LIB}.a
267: .else
268: _LIBS=
269: .endif
1.58 cgd 270:
1.167 matt 271: OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
1.158 christos 272:
1.149 lukem 273: .if ${MKPROFILE} != "no"
1.130 tv 274: _LIBS+=lib${LIB}_p.a
1.167 matt 275: POBJS+=${OBJS:.o=.po}
1.1 cgd 276: .endif
277:
1.148 lukem 278: .if ${MKPIC} != "no"
1.160 simonb 279: .if ${MKPICLIB} == "no"
280: SOLIB=lib${LIB}.a
281: .else
282: SOLIB=lib${LIB}_pic.a
283: _LIBS+=${SOLIB}
1.167 matt 284: SOBJS+=${OBJS:.o=.so}
1.160 simonb 285: .endif
1.171 christos 286: .if defined(SHLIB_FULLVERSION)
287: _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
1.27 pk 288: .endif
1.35 pk 289: .endif
1.27 pk 290:
1.148 lukem 291: .if ${MKLINT} != "no" && ${MKLINKLIB} != "no"
1.58 cgd 292: _LIBS+=llib-l${LIB}.ln
1.158 christos 293: LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
1.27 pk 294: .endif
295:
1.167 matt 296: .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
297: || ${MKLINKLIB} != "no"
1.158 christos 298: ALLOBJS=${OBJS} ${POBJS} ${SOBJS} ${LOBJS}
1.167 matt 299: .else
300: ALLOBJS=${POBJS} ${SOBJS} ${LOBJS}
301: .endif
1.163 erh 302: .NOPATH: ${ALLOBJS} ${_LIBS}
1.158 christos 303:
1.162 mycroft 304: realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
1.1 cgd 305:
1.90 christos 306: __archivebuild: .USE
1.89 christos 307: @rm -f ${.TARGET}
1.138 tv 308: @${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
1.89 christos 309: ${RANLIB} ${.TARGET}
310:
311: __archiveinstall: .USE
1.156 simonb 312: ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
313: -g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
1.89 christos 314: ${RANLIB} -t ${.TARGET}
315: chmod ${LIBMODE} ${.TARGET}
316:
1.104 mycroft 317: DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c}
1.128 tv 318: CLEANFILES+= ${DPSRCS}
1.129 tv 319: .if defined(YHEADER)
320: CLEANFILES+= ${SRCS:M*.y:.y=.h}
321: .endif
1.103 mycroft 322:
1.89 christos 323: lib${LIB}.a:: ${OBJS} __archivebuild
1.1 cgd 324: @echo building standard ${LIB} library
325:
1.89 christos 326: lib${LIB}_p.a:: ${POBJS} __archivebuild
1.1 cgd 327: @echo building profiled ${LIB} library
328:
1.89 christos 329: lib${LIB}_pic.a:: ${SOBJS} __archivebuild
1.27 pk 330: @echo building shared object ${LIB} library
331:
1.171 christos 332: lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
1.88 cgd 333: ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
1.171 christos 334: @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
335: @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
1.152 fair 336: .if defined(DESTDIR)
1.155 wrstuden 337: $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
1.152 fair 338: ${SHLIB_LDSTARTFILE} \
1.160 simonb 339: --whole-archive ${SOLIB} \
1.170 erh 340: --no-whole-archive ${LDADD} \
1.155 wrstuden 341: -L${DESTDIR}${LIBDIR} -R${LIBDIR} \
1.152 fair 342: ${SHLIB_LDENDFILE}
343: .else
1.126 jonathan 344: $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
1.123 jonathan 345: ${SHLIB_LDSTARTFILE} \
1.160 simonb 346: --whole-archive ${SOLIB} --no-whole-archive ${LDADD} \
1.115 cjs 347: ${SHLIB_LDENDFILE}
1.152 fair 348: .endif
1.148 lukem 349: .if ${OBJECT_FMT} == "ELF"
1.177 mycroft 350: ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
351: mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
352: ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
353: mv -f lib${LIB}.so.tmp lib${LIB}.so
1.133 tv 354: .endif
1.35 pk 355:
1.103 mycroft 356: LLIBS?= -lc
1.58 cgd 357: llib-l${LIB}.ln: ${LOBJS}
358: @echo building llib-l${LIB}.ln
359: @rm -f llib-l${LIB}.ln
1.141 wrstuden 360: @${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
1.1 cgd 361:
1.81 cgd 362: cleanlib:
1.48 mycroft 363: rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
1.59 cgd 364: rm -f lib${LIB}.a ${OBJS}
365: rm -f lib${LIB}_p.a ${POBJS}
1.133 tv 366: rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
1.59 cgd 367: rm -f llib-l${LIB}.ln ${LOBJS}
1.1 cgd 368:
1.26 mycroft 369: .if defined(SRCS)
1.64 christos 370: afterdepend: .depend
1.1 cgd 371: @(TMP=/tmp/_depend$$$$; \
1.79 cgd 372: sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \
1.58 cgd 373: < .depend > $$TMP; \
1.1 cgd 374: mv $$TMP .depend)
1.26 mycroft 375: .endif
1.1 cgd 376:
1.97 mycroft 377: .if !target(libinstall)
1.148 lukem 378: # Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
1.139 tv 379: libinstall::
380:
1.148 lukem 381: .if ${MKLINKLIB} != "no"
1.89 christos 382: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.168 mycroft 383: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.89 christos 384: .if !defined(UPDATE)
385: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
386: .endif
1.168 mycroft 387:
1.157 fredb 388: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
1.89 christos 389: ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
390: .endif
391: ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
1.130 tv 392: .endif
1.89 christos 393:
1.149 lukem 394: .if ${MKPROFILE} != "no"
1.89 christos 395: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.168 mycroft 396: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.89 christos 397: .if !defined(UPDATE)
398: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.32 pk 399: .endif
1.168 mycroft 400:
1.157 fredb 401: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
1.89 christos 402: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
403: .endif
404: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
405: .endif
406:
1.149 lukem 407: .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
1.168 mycroft 408: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.160 simonb 409: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.89 christos 410: .if !defined(UPDATE)
411: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
412: .endif
1.168 mycroft 413:
1.157 fredb 414: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
1.89 christos 415: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
1.33 pk 416: .endif
1.160 simonb 417: .if ${MKPICLIB} == "no"
418: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:
419: rm -f ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
420: ln -s lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
421: .else
1.89 christos 422: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
1.160 simonb 423: .endif
1.89 christos 424: .endif
425:
1.171 christos 426: .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
427: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
428: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
1.89 christos 429: .if !defined(UPDATE)
1.171 christos 430: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
1.89 christos 431: .endif
1.168 mycroft 432:
1.171 christos 433: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
434: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
1.89 christos 435: .endif
1.171 christos 436: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
1.156 simonb 437: ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
438: -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
1.148 lukem 439: .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
1.146 thorpej 440: /sbin/ldconfig -m ${LIBDIR}
441: .endif
1.148 lukem 442: .if ${OBJECT_FMT} == "ELF"
1.178 ! mycroft 443: ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
1.177 mycroft 444: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp
1.178 ! mycroft 445: mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp\
1.83 cgd 446: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
1.148 lukem 447: .if ${MKLINKLIB} != "no"
1.178 ! mycroft 448: ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
1.177 mycroft 449: ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp
1.178 ! mycroft 450: mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp\
1.83 cgd 451: ${DESTDIR}${LIBDIR}/lib${LIB}.so
452: .endif
1.12 cgd 453: .endif
1.139 tv 454: .endif
1.89 christos 455:
1.148 lukem 456: .if ${MKLINT} != "no" && ${MKLINKLIB} != "no"
1.89 christos 457: libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.168 mycroft 458: .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.89 christos 459: .if !defined(UPDATE)
460: .PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
461: .endif
1.168 mycroft 462:
1.157 fredb 463: .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
1.89 christos 464: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
465: .endif
1.95 mycroft 466: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
1.156 simonb 467: ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
468: -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
1.58 cgd 469: .endif
1.1 cgd 470: .endif
471:
472: .include <bsd.man.mk>
1.57 jtc 473: .include <bsd.nls.mk>
1.91 christos 474: .include <bsd.files.mk>
1.89 christos 475: .include <bsd.inc.mk>
1.109 cjs 476: .include <bsd.links.mk>
1.24 mycroft 477: .include <bsd.dep.mk>
1.66 christos 478: .include <bsd.sys.mk>
1.117 mycroft 479:
480: # Make sure all of the standard targets are defined, even if they do nothing.
481: lint regress:
CVSweb <webmaster@jp.NetBSD.org>