Annotation of src/share/mk/bsd.lib.mk, Revision 1.187
1.187 ! nathanw 1: # $NetBSD: bsd.lib.mk,v 1.186 2001/10/19 15:55:52 tv 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.183 tv 17: clean: cleanlib
1.1 cgd 18:
1.184 tv 19: .if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE})
1.154 simonb 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.185 tv 39: .if defined(SHLIB_MAJOR) && ${MKPIC} != "no"
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.185 tv 46: .if defined(SHLIB_MINOR) && ${MKPIC} != "no"
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.185 tv 53: .if defined(SHLIB_TEENY) && ${MKPIC} != "no"
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.179 dmcmahil 92: # FPICFLAGS: flags for ${FC} to compile .[fF] files to .so objects.
1.164 simonb 93: # CPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS}
94: # CPICFLAGS: flags for ${CC} to compile .[cC] files to .so objects.
95: # CAPICFLAGS flags for {$CC} to compiling .[Ss] files
1.107 jonathan 96: # (usually just ${CPPPICFLAGS} ${CPICFLAGS})
1.164 simonb 97: # APICFLAGS: flags for ${AS} to assemble .[sS] to .so objects.
1.86 jonathan 98:
1.148 lukem 99: .if ${MACHINE_ARCH} == "alpha"
1.123 jonathan 100: # Alpha-specific shared library flags
1.179 dmcmahil 101: FPICFLAGS ?= -fPIC
1.165 dmcmahil 102: CPICFLAGS ?= -fPIC -DPIC
1.107 jonathan 103: CPPPICFLAGS?= -DPIC
104: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
105: APICFLAGS ?=
1.151 drochner 106: .elif ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
1.123 jonathan 107: # mips-specific shared library flags
1.86 jonathan 108:
1.160 simonb 109: # On mips, all libs are compiled with ABIcalls, not just sharedlibs.
110: MKPICLIB= no
111:
112: # so turn shlib PIC flags on for ${AS}.
113: AINC+=-DABICALLS
1.86 jonathan 114: AFLAGS+= -fPIC
115: AS+= -KPIC
1.172 matt 116:
117: .elif ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
118: # On the VAX, all object are PIC by default, not just sharedlibs.
119: MKPICLIB= no
1.150 christos 120:
1.175 mrg 121: .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
122: ${OBJECT_FMT} == "ELF"
1.150 christos 123:
1.179 dmcmahil 124: FPICFLAGS ?= -fPIC
1.165 dmcmahil 125: CPICFLAGS ?= -fPIC -DPIC
1.150 christos 126: CPPPICFLAGS?= -DPIC
127: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
128: APICFLAGS ?= -KPIC
1.86 jonathan 129:
130: .else
131:
1.187 ! nathanw 132: # Platform-independent flags for NetBSD a.out shared libraries
1.171 christos 133: SHLIB_SOVERSION=${SHLIB_FULLVERSION}
1.125 jonathan 134: SHLIB_SHFLAGS=
1.179 dmcmahil 135: FPICFLAGS ?= -fPIC
1.165 dmcmahil 136: CPICFLAGS?= -fPIC -DPIC
1.107 jonathan 137: CPPPICFLAGS?= -DPIC
138: CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
139: APICFLAGS?= -k
1.86 jonathan 140:
141: .endif
142:
1.160 simonb 143: MKPICLIB?= yes
144:
1.123 jonathan 145: # Platform-independent linker flags for ELF shared libraries
1.148 lukem 146: .if ${OBJECT_FMT} == "ELF"
1.182 mrg 147: SHLIB_SOVERSION= ${SHLIB_MAJOR}
148: SHLIB_SHFLAGS= -soname lib${LIB}.so.${SHLIB_SOVERSION}
149: SHLIB_LDSTARTFILE?= ${DESTDIR}/usr/lib/crtbeginS.o
150: SHLIB_LDENDFILE?= ${DESTDIR}/usr/lib/crtendS.o
1.123 jonathan 151: .endif
1.86 jonathan 152:
1.82 mikel 153: CFLAGS+= ${COPTS}
1.179 dmcmahil 154: FFLAGS+= ${FOPTS}
1.1 cgd 155:
156: .c.o:
1.153 christos 157: .if defined(COPTS) && !empty(COPTS:M*-g*)
158: ${COMPILE.c} ${.IMPSRC}
159: .else
1.80 christos 160: @echo ${COMPILE.c:Q} ${.IMPSRC}
1.122 cgd 161: @${COMPILE.c} ${.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.1 cgd 165:
166: .c.po:
1.153 christos 167: .if defined(COPTS) && !empty(COPTS:M*-g*)
168: ${COMPILE.c} -pg ${.IMPSRC} -o ${.TARGET}
169: .else
1.80 christos 170: @echo ${COMPILE.c:Q} -pg ${.IMPSRC} -o ${.TARGET}
1.68 cgd 171: @${COMPILE.c} -pg ${.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.17 mycroft 175:
1.27 pk 176: .c.so:
1.153 christos 177: .if defined(COPTS) && !empty(COPTS:M*-g*)
178: ${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
179: .else
1.86 jonathan 180: @echo ${COMPILE.c:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
181: @${COMPILE.c} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 182: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
183: @rm -f ${.TARGET}.o
1.153 christos 184: .endif
1.27 pk 185:
1.58 cgd 186: .c.ln:
1.121 thorpej 187: ${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} -i ${.IMPSRC}
1.58 cgd 188:
1.18 mycroft 189: .cc.o .C.o:
1.153 christos 190: .if defined(COPTS) && !empty(COPTS:M*-g*)
191: ${COMPILE.cc} ${.IMPSRC}
192: .else
1.80 christos 193: @echo ${COMPILE.cc:Q} ${.IMPSRC}
1.62 christos 194: @${COMPILE.cc} ${.IMPSRC} -o ${.TARGET}.o
1.63 jtc 195: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
1.62 christos 196: @rm -f ${.TARGET}.o
1.153 christos 197: .endif
1.17 mycroft 198:
1.18 mycroft 199: .cc.po .C.po:
1.153 christos 200: .if defined(COPTS) && !empty(COPTS:M*-g*)
201: ${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}
202: .else
1.80 christos 203: @echo ${COMPILE.cc:Q} -pg ${.IMPSRC} -o ${.TARGET}
1.68 cgd 204: @${COMPILE.cc} -pg ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 205: @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
206: @rm -f ${.TARGET}.o
1.153 christos 207: .endif
1.28 cgd 208:
209: .cc.so .C.so:
1.153 christos 210: .if defined(COPTS) && !empty(COPTS:M*-g*)
211: ${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
212: .else
1.86 jonathan 213: @echo ${COMPILE.cc:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
214: @${COMPILE.cc} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 215: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
216: @rm -f ${.TARGET}.o
1.153 christos 217: .endif
1.118 lukem 218:
1.179 dmcmahil 219: .f.o:
220: .if defined(FOPTS) && !empty(FOPTS:M*-g*)
221: ${COMPILE.f} ${.IMPSRC}
222: .else
223: @echo ${COMPILE.f:Q} ${.IMPSRC}
224: @${COMPILE.f} ${.IMPSRC} -o ${.TARGET}.o
225: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
226: @rm -f ${.TARGET}.o
227: .endif
228:
229: .f.po:
230: .if defined(FOPTS) && !empty(FOPTS:M*-g*)
231: ${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}
232: .else
233: @echo ${COMPILE.f:Q} -pg ${.IMPSRC} -o ${.TARGET}
234: @${COMPILE.f} -pg ${.IMPSRC} -o ${.TARGET}.o
235: @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
236: @rm -f ${.TARGET}.o
237: .endif
238:
239: .f.so:
240: .if defined(FOPTS) && !empty(FOPTS:M*-g*)
241: ${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
242: .else
243: @echo ${COMPILE.f:Q} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
244: @${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
245: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
246: @rm -f ${.TARGET}.o
247: .endif
248:
249: .f.ln:
250: ${ECHO} Skipping lint for Fortran libraries.
251:
1.118 lukem 252: .m.o:
1.153 christos 253: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
254: ${COMPILE.m} ${.IMPSRC}
255: .else
1.118 lukem 256: @echo ${COMPILE.m:Q} ${.IMPSRC}
1.122 cgd 257: @${COMPILE.m} ${.IMPSRC} -o ${.TARGET}.o
1.118 lukem 258: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
259: @rm -f ${.TARGET}.o
1.153 christos 260: .endif
1.118 lukem 261:
262: .m.po:
1.153 christos 263: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
264: ${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}
265: .else
1.118 lukem 266: @echo ${COMPILE.m:Q} -pg ${.IMPSRC} -o ${.TARGET}
267: @${COMPILE.m} -pg ${.IMPSRC} -o ${.TARGET}.o
268: @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
269: @rm -f ${.TARGET}.o
1.153 christos 270: .endif
1.118 lukem 271:
272: .m.so:
1.153 christos 273: .if defined(OBJCFLAGS) && !empty(OBJCFLAGS:M*-g*)
274: ${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
275: .else
1.118 lukem 276: @echo ${COMPILE.m:Q} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}
277: @${COMPILE.m} ${CPICFLAGS} ${.IMPSRC} -o ${.TARGET}.o
278: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
279: @rm -f ${.TARGET}.o
1.153 christos 280: .endif
1.1 cgd 281:
1.40 cgd 282: .S.o .s.o:
1.80 christos 283: @echo ${COMPILE.S:Q} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC}
1.69 jtc 284: @${COMPILE.S} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 285: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
286: @rm -f ${.TARGET}.o
1.1 cgd 287:
1.40 cgd 288: .S.po .s.po:
1.80 christos 289: @echo ${COMPILE.S:Q} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
1.75 jtc 290: @${COMPILE.S} -DGPROF -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 291: @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
292: @rm -f ${.TARGET}.o
1.1 cgd 293:
1.40 cgd 294: .S.so .s.so:
1.107 jonathan 295: @echo ${COMPILE.S:Q} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}
296: @${COMPILE.S} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o
1.62 christos 297: @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
298: @rm -f ${.TARGET}.o
1.27 pk 299:
1.148 lukem 300: .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
301: || ${MKLINKLIB} != "no"
1.130 tv 302: _LIBS=lib${LIB}.a
303: .else
304: _LIBS=
305: .endif
1.58 cgd 306:
1.167 matt 307: OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
1.158 christos 308:
1.149 lukem 309: .if ${MKPROFILE} != "no"
1.130 tv 310: _LIBS+=lib${LIB}_p.a
1.167 matt 311: POBJS+=${OBJS:.o=.po}
1.1 cgd 312: .endif
313:
1.148 lukem 314: .if ${MKPIC} != "no"
1.160 simonb 315: .if ${MKPICLIB} == "no"
316: SOLIB=lib${LIB}.a
317: .else
318: SOLIB=lib${LIB}_pic.a
319: _LIBS+=${SOLIB}
1.167 matt 320: SOBJS+=${OBJS:.o=.so}
1.160 simonb 321: .endif
1.171 christos 322: .if defined(SHLIB_FULLVERSION)
323: _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
1.27 pk 324: .endif
1.35 pk 325: .endif
1.27 pk 326:
1.179 dmcmahil 327: LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
328: .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
1.58 cgd 329: _LIBS+=llib-l${LIB}.ln
1.27 pk 330: .endif
331:
1.167 matt 332: .if ${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
333: || ${MKLINKLIB} != "no"
1.179 dmcmahil 334: ALLOBJS=${OBJS} ${POBJS} ${SOBJS}
1.167 matt 335: .else
1.179 dmcmahil 336: ALLOBJS=${POBJS} ${SOBJS}
337: .endif
338: .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
339: ALLOBJS+=${LOBJS}
1.167 matt 340: .endif
1.186 tv 341:
342: .NOPATH: ${ALLOBJS} ${_LIBS} ${SRCS:M*.[ly]:C/..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
1.158 christos 343:
1.162 mycroft 344: realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
1.1 cgd 345:
1.90 christos 346: __archivebuild: .USE
1.89 christos 347: @rm -f ${.TARGET}
1.138 tv 348: @${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
1.89 christos 349: ${RANLIB} ${.TARGET}
350:
351: __archiveinstall: .USE
1.156 simonb 352: ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
353: -g ${LIBGRP} -m 600 ${.ALLSRC} ${.TARGET}
1.89 christos 354: ${RANLIB} -t ${.TARGET}
355: chmod ${LIBMODE} ${.TARGET}
356:
1.186 tv 357: DPSRCS+= ${SRCS:M*.[ly]:C/..$/.c/}
358: CLEANFILES+= ${DPSRCS} ${YHEADER:D${SRCS:M*.y:.y=.h}}
1.103 mycroft 359:
1.89 christos 360: lib${LIB}.a:: ${OBJS} __archivebuild
1.1 cgd 361: @echo building standard ${LIB} library
362:
1.89 christos 363: lib${LIB}_p.a:: ${POBJS} __archivebuild
1.1 cgd 364: @echo building profiled ${LIB} library
365:
1.89 christos 366: lib${LIB}_pic.a:: ${SOBJS} __archivebuild
1.27 pk 367: @echo building shared object ${LIB} library
368:
1.171 christos 369: lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} \
1.88 cgd 370: ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
1.171 christos 371: @echo building shared ${LIB} library \(version ${SHLIB_FULLVERSION}\)
372: @rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
1.152 fair 373: .if defined(DESTDIR)
1.155 wrstuden 374: $(LD) -nostdlib -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
1.152 fair 375: ${SHLIB_LDSTARTFILE} \
1.160 simonb 376: --whole-archive ${SOLIB} \
1.170 erh 377: --no-whole-archive ${LDADD} \
1.155 wrstuden 378: -L${DESTDIR}${LIBDIR} -R${LIBDIR} \
1.152 fair 379: ${SHLIB_LDENDFILE}
380: .else
1.126 jonathan 381: $(LD) -x -shared ${SHLIB_SHFLAGS} -o ${.TARGET} \
1.123 jonathan 382: ${SHLIB_LDSTARTFILE} \
1.160 simonb 383: --whole-archive ${SOLIB} --no-whole-archive ${LDADD} \
1.115 cjs 384: ${SHLIB_LDENDFILE}
1.152 fair 385: .endif
1.148 lukem 386: .if ${OBJECT_FMT} == "ELF"
1.177 mycroft 387: ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
388: mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
389: ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
390: mv -f lib${LIB}.so.tmp lib${LIB}.so
1.133 tv 391: .endif
1.35 pk 392:
1.179 dmcmahil 393: .if !empty(LOBJS)
1.103 mycroft 394: LLIBS?= -lc
1.58 cgd 395: llib-l${LIB}.ln: ${LOBJS}
396: @echo building llib-l${LIB}.ln
397: @rm -f llib-l${LIB}.ln
1.141 wrstuden 398: @${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
1.179 dmcmahil 399: .endif
1.1 cgd 400:
1.81 cgd 401: cleanlib:
1.48 mycroft 402: rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
1.59 cgd 403: rm -f lib${LIB}.a ${OBJS}
404: rm -f lib${LIB}_p.a ${POBJS}
1.133 tv 405: rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
1.59 cgd 406: rm -f llib-l${LIB}.ln ${LOBJS}
1.1 cgd 407:
1.26 mycroft 408: .if defined(SRCS)
1.64 christos 409: afterdepend: .depend
1.1 cgd 410: @(TMP=/tmp/_depend$$$$; \
1.79 cgd 411: sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.so \1.ln:/' \
1.58 cgd 412: < .depend > $$TMP; \
1.1 cgd 413: mv $$TMP .depend)
1.26 mycroft 414: .endif
1.1 cgd 415:
1.97 mycroft 416: .if !target(libinstall)
1.148 lukem 417: # Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
1.139 tv 418: libinstall::
419:
1.148 lukem 420: .if ${MKLINKLIB} != "no"
1.89 christos 421: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.168 mycroft 422: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
1.89 christos 423: .if !defined(UPDATE)
424: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.a
425: .endif
1.168 mycroft 426:
1.157 fredb 427: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
1.89 christos 428: ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
429: .endif
430: ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
1.130 tv 431: .endif
1.89 christos 432:
1.149 lukem 433: .if ${MKPROFILE} != "no"
1.89 christos 434: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.168 mycroft 435: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.89 christos 436: .if !defined(UPDATE)
437: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
1.32 pk 438: .endif
1.168 mycroft 439:
1.157 fredb 440: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
1.89 christos 441: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
442: .endif
443: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
444: .endif
445:
1.149 lukem 446: .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
1.168 mycroft 447: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.160 simonb 448: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
1.89 christos 449: .if !defined(UPDATE)
450: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
451: .endif
1.168 mycroft 452:
1.157 fredb 453: .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
1.89 christos 454: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
1.33 pk 455: .endif
1.160 simonb 456: .if ${MKPICLIB} == "no"
457: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a:
458: rm -f ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
459: ln -s lib${LIB}.a ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
460: .else
1.89 christos 461: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
1.160 simonb 462: .endif
1.89 christos 463: .endif
464:
1.171 christos 465: .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
466: libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
467: .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
1.89 christos 468: .if !defined(UPDATE)
1.171 christos 469: .PHONY: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
1.89 christos 470: .endif
1.168 mycroft 471:
1.171 christos 472: .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
473: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
1.89 christos 474: .endif
1.171 christos 475: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
1.156 simonb 476: ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
477: -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${.TARGET}
1.148 lukem 478: .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
1.146 thorpej 479: /sbin/ldconfig -m ${LIBDIR}
480: .endif
1.148 lukem 481: .if ${OBJECT_FMT} == "ELF"
1.178 mycroft 482: ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
1.177 mycroft 483: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp
1.178 mycroft 484: mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp\
1.83 cgd 485: ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
1.148 lukem 486: .if ${MKLINKLIB} != "no"
1.178 mycroft 487: ln -sf lib${LIB}.so.${SHLIB_FULLVERSION}\
1.177 mycroft 488: ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp
1.178 mycroft 489: mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp\
1.83 cgd 490: ${DESTDIR}${LIBDIR}/lib${LIB}.so
491: .endif
1.12 cgd 492: .endif
1.139 tv 493: .endif
1.89 christos 494:
1.179 dmcmahil 495: .if ${MKLINT} != "no" && ${MKLINKLIB} != "no" && !empty(LOBJS)
1.89 christos 496: libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.168 mycroft 497: .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
1.89 christos 498: .if !defined(UPDATE)
499: .PHONY: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
500: .endif
1.168 mycroft 501:
1.157 fredb 502: .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
1.89 christos 503: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
504: .endif
1.95 mycroft 505: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
1.156 simonb 506: ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${LIBOWN} \
507: -g ${LIBGRP} -m ${LIBMODE} ${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
1.58 cgd 508: .endif
1.1 cgd 509: .endif
510:
511: .include <bsd.man.mk>
1.57 jtc 512: .include <bsd.nls.mk>
1.91 christos 513: .include <bsd.files.mk>
1.89 christos 514: .include <bsd.inc.mk>
1.109 cjs 515: .include <bsd.links.mk>
1.24 mycroft 516: .include <bsd.dep.mk>
1.66 christos 517: .include <bsd.sys.mk>
1.117 mycroft 518:
519: # Make sure all of the standard targets are defined, even if they do nothing.
520: lint regress:
CVSweb <webmaster@jp.NetBSD.org>