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