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