bsd.lib.mk revision 1.281       1  1.281     lukem #	$NetBSD: bsd.lib.mk,v 1.281 2008/05/03 14:48:31 lukem Exp $
      2   1.92     mikel #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
      3    1.1       cgd 
      4  1.188        tv .include <bsd.init.mk>
      5  1.207   thorpej .include <bsd.shlib.mk>
      6  1.219   thorpej .include <bsd.gcc.mk>
      7  1.227     lukem # Pull in <bsd.sys.mk> here so we can override its .c.o rule
      8  1.227     lukem .include <bsd.sys.mk>
      9   1.97   mycroft 
     10  1.281     lukem LIBISPRIVATE?=	no
     11  1.281     lukem 
     12  1.281     lukem .if ${LIBISPRIVATE} != "no"
     13  1.280     lukem MKDEBUGLIB:=	no
     14  1.280     lukem MKLINT:=	no
     15  1.280     lukem MKPIC:=		no
     16  1.280     lukem MKPROFILE:=	no
     17  1.280     lukem .endif
     18  1.280     lukem 
     19  1.188        tv ##### Basic targets
     20  1.246     lukem .PHONY:		checkver libinstall
     21  1.143       erh realinstall:	checkver libinstall
     22  1.183        tv clean:		cleanlib
     23  1.232       erh 
     24  1.232       erh ##### LIB specific flags.
     25  1.267       mrg COPTS+=     ${COPTS.lib${LIB}}
     26  1.232       erh CPPFLAGS+=  ${CPPFLAGS.lib${LIB}}
     27  1.232       erh CXXFLAGS+=  ${CXXFLAGS.lib${LIB}}
     28  1.267       mrg OBJCOPTS+=  ${OBJCOPTS.lib${LIB}}
     29  1.232       erh LDADD+=     ${LDADD.lib${LIB}}
     30  1.233       erh LDFLAGS+=   ${LDFLAGS.lib${LIB}}
     31  1.233       erh LDSTATIC+=  ${LDSTATIC.lib${LIB}}
     32    1.1       cgd 
     33  1.256     lukem ##### Libraries that this may depend upon.
     34  1.256     lukem .if defined(LIBDPLIBS) && ${MKPIC} != "no"				# {
     35  1.256     lukem .for _lib _dir in ${LIBDPLIBS}
     36  1.256     lukem .if !defined(LIBDO.${_lib})
     37  1.256     lukem LIBDO.${_lib}!=	cd ${_dir} && ${PRINTOBJDIR}
     38  1.256     lukem .MAKEOVERRIDES+=LIBDO.${_lib}
     39  1.256     lukem .endif
     40  1.256     lukem LDADD+=		-L${LIBDO.${_lib}} -l${_lib}
     41  1.256     lukem DPADD+=		${LIBDO.${_lib}}/lib${_lib}.so
     42  1.256     lukem .endfor
     43  1.256     lukem .endif									# }
     44  1.256     lukem 
     45  1.188        tv ##### Build and install rules
     46  1.240       dsl MKDEP_SUFFIXES?=	.o .po .so .ln
     47  1.192   thorpej CPPFLAGS+=	${DESTDIR:D-nostdinc ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include}
     48  1.225       mrg CXXFLAGS+=	${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} ${DESTDIR}/usr/include/g++}
     49  1.190        tv 
     50  1.252     lukem .if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE})		# {
     51  1.154    simonb SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major
     52  1.154    simonb SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor
     53  1.171  christos SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny
     54  1.143       erh 
     55  1.143       erh # Check for higher installed library versions.
     56  1.145       erh .if !defined(NOCHECKVER) && !defined(NOCHECKVER_${LIB}) && \
     57  1.201     lukem 	exists(${NETBSDSRCDIR}/lib/checkver)
     58  1.143       erh checkver:
     59  1.144       erh 	@(cd ${.CURDIR} && \
     60  1.239     lukem 	    ${HOST_SH} ${NETBSDSRCDIR}/lib/checkver -v ${SHLIB_VERSION_FILE} \
     61  1.195     lukem 		    -d ${DESTDIR}${_LIBSODIR} ${LIB})
     62  1.173  christos .endif
     63  1.252     lukem .endif									# }
     64  1.173  christos 
     65  1.173  christos .if !target(checkver)
     66  1.143       erh checkver:
     67  1.143       erh .endif
     68  1.173  christos 
     69  1.169   thorpej print-shlib-major:
     70  1.185        tv .if defined(SHLIB_MAJOR) && ${MKPIC} != "no"
     71  1.169   thorpej 	@echo ${SHLIB_MAJOR}
     72  1.173  christos .else
     73  1.173  christos 	@false
     74  1.173  christos .endif
     75  1.169   thorpej 
     76  1.169   thorpej print-shlib-minor:
     77  1.185        tv .if defined(SHLIB_MINOR) && ${MKPIC} != "no"
     78  1.169   thorpej 	@echo ${SHLIB_MINOR}
     79  1.173  christos .else
     80  1.173  christos 	@false
     81  1.173  christos .endif
     82  1.171  christos 
     83  1.171  christos print-shlib-teeny:
     84  1.185        tv .if defined(SHLIB_TEENY) && ${MKPIC} != "no"
     85  1.171  christos 	@echo ${SHLIB_TEENY}
     86  1.143       erh .else
     87  1.169   thorpej 	@false
     88  1.173  christos .endif
     89  1.169   thorpej 
     90  1.252     lukem .if defined(SHLIB_MAJOR) && !empty(SHLIB_MAJOR)				# {
     91  1.173  christos .if defined(SHLIB_MINOR) && !empty(SHLIB_MINOR)
     92  1.173  christos .if defined(SHLIB_TEENY) && !empty(SHLIB_TEENY)
     93  1.173  christos SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}.${SHLIB_TEENY}
     94  1.173  christos .else
     95  1.173  christos SHLIB_FULLVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR}
     96  1.173  christos .endif
     97  1.173  christos .else
     98  1.173  christos SHLIB_FULLVERSION=${SHLIB_MAJOR}
     99  1.173  christos .endif
    100  1.252     lukem .endif									# }
    101    1.1       cgd 
    102  1.101   mycroft # add additional suffixes not exported.
    103  1.101   mycroft # .po is used for profiling object files.
    104  1.101   mycroft # .so is used for PIC object files.
    105  1.266  christos .SUFFIXES: .out .a .ln .so .po .go .o .s .S .c .cc .cpp .cxx .C .m .F .f .r .y .l .cl .p .h
    106  1.118     lukem .SUFFIXES: .sh .m4 .m
    107   1.82     mikel 
    108   1.86  jonathan 
    109   1.86  jonathan # Set PICFLAGS to cc flags for producing position-independent code,
    110   1.86  jonathan # if not already set.  Includes -DPIC, if required.
    111   1.86  jonathan 
    112  1.164    simonb # Data-driven table using make variables to control how shared libraries
    113   1.86  jonathan # are built for different platforms and object formats.
    114  1.125  jonathan # OBJECT_FMT:		currently either "ELF" or "a.out", from <bsd.own.mk>
    115  1.164    simonb # SHLIB_SOVERSION:	version number to be compiled into a shared library
    116  1.164    simonb #			via -soname. Usualy ${SHLIB_MAJOR} on ELF.
    117  1.173  christos #			NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
    118  1.173  christos #			[.${SHLIB_TEENY}]]
    119  1.164    simonb # SHLIB_SHFLAGS:	Flags to tell ${LD} to emit shared library.
    120  1.123  jonathan #			with ELF, also set shared-lib version for ld.so.
    121  1.123  jonathan # SHLIB_LDSTARTFILE:	support .o file, call C++ file-level constructors
    122  1.123  jonathan # SHLIB_LDENDFILE:	support .o file, call C++ file-level destructors
    123  1.179  dmcmahil # FPICFLAGS:		flags for ${FC} to compile .[fF] files to .so objects.
    124  1.271   tsutsui # CPPPICFLAGS:		flags for ${CPP} to preprocess .[sS] files for ${AS}
    125  1.205      yamt # CPICFLAGS:		flags for ${CC} to compile .[cC] files to pic objects.
    126  1.205      yamt # CSHLIBFLAGS:		flags for ${CC} to compile .[cC] files to .so objects.
    127  1.205      yamt #			(usually includes ${CPICFLAGS})
    128  1.205      yamt # CAPICFLAGS:		flags for ${CC} to compiling .[Ss] files
    129  1.107  jonathan #		 	(usually just ${CPPPICFLAGS} ${CPICFLAGS})
    130  1.164    simonb # APICFLAGS:		flags for ${AS} to assemble .[sS] to .so objects.
    131   1.86  jonathan 
    132  1.252     lukem .if ${MACHINE_ARCH} == "alpha"						# {
    133  1.209   thorpej 
    134  1.179  dmcmahil FPICFLAGS ?= -fPIC
    135  1.165  dmcmahil CPICFLAGS ?= -fPIC -DPIC
    136  1.222     lukem CPPPICFLAGS?= -DPIC
    137  1.107  jonathan CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
    138  1.107  jonathan APICFLAGS ?=
    139  1.209   thorpej 
    140  1.175       mrg .elif (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") && \
    141  1.252     lukem        ${OBJECT_FMT} == "ELF"						# } {
    142  1.209   thorpej 
    143  1.222     lukem # If you use -fPIC you need to define BIGPIC to turn on 32-bit
    144  1.202       eeh # relocations in asm code
    145  1.179  dmcmahil FPICFLAGS ?= -fPIC
    146  1.165  dmcmahil CPICFLAGS ?= -fPIC -DPIC
    147  1.202       eeh CPPPICFLAGS?= -DPIC -DBIGPIC
    148  1.150  christos CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
    149  1.203       eeh APICFLAGS ?= -KPIC
    150  1.204  fredette 
    151  1.252     lukem .else									# } {
    152   1.86  jonathan 
    153  1.244     skrll # Platform-independent flags for NetBSD shared libraries
    154  1.171  christos SHLIB_SOVERSION=${SHLIB_FULLVERSION}
    155  1.125  jonathan SHLIB_SHFLAGS=
    156  1.179  dmcmahil FPICFLAGS ?= -fPIC
    157  1.165  dmcmahil CPICFLAGS?= -fPIC -DPIC
    158  1.222     lukem CPPPICFLAGS?= -DPIC
    159  1.107  jonathan CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS}
    160  1.107  jonathan APICFLAGS?= -k
    161   1.86  jonathan 
    162  1.252     lukem .endif									# }
    163  1.160    simonb 
    164  1.205      yamt .if ${MKPICLIB} != "no"
    165  1.205      yamt CSHLIBFLAGS+= ${CPICFLAGS}
    166  1.205      yamt .endif
    167  1.205      yamt 
    168  1.205      yamt .if defined(CSHLIBFLAGS) && !empty(CSHLIBFLAGS)
    169  1.205      yamt MKSHLIBOBJS= yes
    170  1.205      yamt .else
    171  1.205      yamt MKSHLIBOBJS= no
    172  1.205      yamt .endif
    173  1.205      yamt 
    174  1.123  jonathan # Platform-independent linker flags for ELF shared libraries
    175  1.148     lukem .if ${OBJECT_FMT} == "ELF"
    176  1.182       mrg SHLIB_SOVERSION=	${SHLIB_MAJOR}
    177  1.221  drochner SHLIB_SHFLAGS=		-Wl,-soname,lib${LIB}.so.${SHLIB_SOVERSION}
    178  1.272  christos SHLIB_SHFLAGS+=		-Wl,--warn-shared-textrel
    179  1.219   thorpej SHLIB_LDSTARTFILE?=	${DESTDIR}/usr/lib/crti.o ${_GCC_CRTBEGINS}
    180  1.219   thorpej SHLIB_LDENDFILE?=	${_GCC_CRTENDS} ${DESTDIR}/usr/lib/crtn.o
    181  1.123  jonathan .endif
    182   1.86  jonathan 
    183   1.82     mikel CFLAGS+=	${COPTS}
    184  1.267       mrg OBJCFLAGS+=	${OBJCOPTS}
    185  1.257    simonb AFLAGS+=	${COPTS}
    186  1.179  dmcmahil FFLAGS+=	${FOPTS}
    187    1.1       cgd 
    188    1.1       cgd .c.o:
    189  1.238     lukem 	${_MKTARGET_COMPILE}
    190  1.263       dsl 	${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    191  1.270    martin .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
    192  1.263       dsl 	${OBJCOPY} -x ${.TARGET}
    193  1.153  christos .endif
    194    1.1       cgd 
    195    1.1       cgd .c.po:
    196  1.238     lukem 	${_MKTARGET_COMPILE}
    197  1.263       dsl 	${COMPILE.c} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.IMPSRC} -o ${.TARGET}
    198  1.270    martin .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
    199  1.263       dsl 	${OBJCOPY} -X ${.TARGET}
    200  1.153  christos .endif
    201   1.17   mycroft 
    202  1.266  christos .c.go:
    203  1.266  christos 	${_MKTARGET_COMPILE}
    204  1.266  christos 	${COMPILE.c} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -g ${.IMPSRC} -o ${.TARGET}
    205  1.266  christos 
    206   1.27        pk .c.so:
    207  1.238     lukem 	${_MKTARGET_COMPILE}
    208  1.263       dsl 	${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
    209  1.270    martin .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
    210  1.263       dsl 	${OBJCOPY} -x ${.TARGET}
    211  1.153  christos .endif
    212   1.27        pk 
    213  1.223     lukem .cc.o .cpp.o .cxx.o .C.o:
    214  1.238     lukem 	${_MKTARGET_COMPILE}
    215  1.263       dsl 	${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    216  1.270    martin .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
    217  1.263       dsl 	${OBJCOPY} -x ${.TARGET}
    218  1.153  christos .endif
    219   1.17   mycroft 
    220  1.266  christos .cc.po .cpp.po .cxx.po .C.po:
    221  1.238     lukem 	${_MKTARGET_COMPILE}
    222  1.263       dsl 	${COMPILE.cc} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.IMPSRC} -o ${.TARGET}
    223  1.270    martin .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
    224  1.263       dsl 	${OBJCOPY} -X ${.TARGET}
    225  1.153  christos .endif
    226   1.28       cgd 
    227  1.266  christos .cc.go .cpp.go .cxx.go .C.go:
    228  1.266  christos 	${_MKTARGET_COMPILE}
    229  1.266  christos 	${COMPILE.cc} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -g ${.IMPSRC} -o ${.TARGET}
    230  1.266  christos 
    231  1.223     lukem .cc.so .cpp.so .cxx.so .C.so:
    232  1.238     lukem 	${_MKTARGET_COMPILE}
    233  1.263       dsl 	${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
    234  1.270    martin .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
    235  1.263       dsl 	${OBJCOPY} -x ${.TARGET}
    236  1.153  christos .endif
    237  1.118     lukem 
    238  1.179  dmcmahil .f.o:
    239  1.238     lukem 	${_MKTARGET_COMPILE}
    240  1.263       dsl 	${COMPILE.f} ${.IMPSRC} -o ${.TARGET}
    241  1.263       dsl .if !defined(FOPTS) || empty(FOPTS:M*-g*)
    242  1.263       dsl 	${OBJCOPY} -x ${.TARGET}
    243  1.179  dmcmahil .endif
    244  1.179  dmcmahil 
    245  1.179  dmcmahil .f.po:
    246  1.238     lukem 	${_MKTARGET_COMPILE}
    247  1.263       dsl 	${COMPILE.f} ${PROFFLAGS} -pg ${.IMPSRC} -o ${.TARGET}
    248  1.263       dsl .if !defined(FOPTS) || empty(FOPTS:M*-g*)
    249  1.263       dsl 	${OBJCOPY} -X ${.TARGET}
    250  1.179  dmcmahil .endif
    251  1.179  dmcmahil 
    252  1.266  christos .f.go:
    253  1.266  christos 	${_MKTARGET_COMPILE}
    254  1.266  christos 	${COMPILE.f} ${DEBUGFLAGS} -g ${.IMPSRC} -o ${.TARGET}
    255  1.266  christos 
    256  1.179  dmcmahil .f.so:
    257  1.238     lukem 	${_MKTARGET_COMPILE}
    258  1.263       dsl 	${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
    259  1.263       dsl .if !defined(FOPTS) || empty(FOPTS:M*-g*)
    260  1.263       dsl 	${OBJCOPY} -x ${.TARGET}
    261  1.179  dmcmahil .endif
    262  1.179  dmcmahil 
    263  1.179  dmcmahil .f.ln:
    264  1.238     lukem 	${_MKTARGET_COMPILE}
    265  1.217       wiz 	@echo Skipping lint for Fortran libraries.
    266  1.179  dmcmahil 
    267  1.118     lukem .m.o:
    268  1.238     lukem 	${_MKTARGET_COMPILE}
    269  1.267       mrg 	${COMPILE.m} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    270  1.263       dsl .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
    271  1.263       dsl 	${OBJCOPY} -x ${.TARGET}
    272  1.153  christos .endif
    273  1.118     lukem 
    274  1.118     lukem .m.po:
    275  1.238     lukem 	${_MKTARGET_COMPILE}
    276  1.267       mrg 	${COMPILE.m} ${PROFFLAGS} -pg ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    277  1.263       dsl .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
    278  1.263       dsl 	${OBJCOPY} -X ${.TARGET}
    279  1.153  christos .endif
    280  1.118     lukem 
    281  1.266  christos .m.go:
    282  1.266  christos 	${_MKTARGET_COMPILE}
    283  1.267       mrg 	${COMPILE.m} ${DEBUGFLAGS} -g ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    284  1.266  christos .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
    285  1.266  christos 	${OBJCOPY} -X ${.TARGET}
    286  1.266  christos .endif
    287  1.266  christos 
    288  1.118     lukem .m.so:
    289  1.238     lukem 	${_MKTARGET_COMPILE}
    290  1.267       mrg 	${COMPILE.m} ${CSHLIBFLAGS} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    291  1.263       dsl .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
    292  1.263       dsl 	${OBJCOPY} -x ${.TARGET}
    293  1.153  christos .endif
    294    1.1       cgd 
    295  1.251     lukem .s.o:
    296  1.238     lukem 	${_MKTARGET_COMPILE}
    297  1.263       dsl 	${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    298  1.263       dsl 	${OBJCOPY} -x ${.TARGET}
    299    1.1       cgd 
    300  1.251     lukem .S.o:
    301  1.251     lukem 	${_MKTARGET_COMPILE}
    302  1.263       dsl 	${COMPILE.S} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    303  1.263       dsl 	${OBJCOPY} -x ${.TARGET}
    304  1.251     lukem 
    305  1.251     lukem .s.po:
    306  1.251     lukem 	${_MKTARGET_COMPILE}
    307  1.263       dsl 	${COMPILE.s} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    308  1.263       dsl 	${OBJCOPY} -X ${.TARGET}
    309  1.251     lukem 
    310  1.251     lukem .S.po:
    311  1.238     lukem 	${_MKTARGET_COMPILE}
    312  1.263       dsl 	${COMPILE.S} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    313  1.263       dsl 	${OBJCOPY} -X ${.TARGET}
    314    1.1       cgd 
    315  1.266  christos .s.go:
    316  1.266  christos 	${_MKTARGET_COMPILE}
    317  1.266  christos 	${COMPILE.s} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    318  1.266  christos 
    319  1.266  christos .S.go:
    320  1.266  christos 	${_MKTARGET_COMPILE}
    321  1.266  christos 	${COMPILE.S} ${DEBUGFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    322  1.266  christos 
    323  1.251     lukem .s.so:
    324  1.251     lukem 	${_MKTARGET_COMPILE}
    325  1.263       dsl 	${COMPILE.s} ${CAPICFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    326  1.263       dsl 	${OBJCOPY} -x ${.TARGET}
    327  1.251     lukem 
    328  1.251     lukem .S.so:
    329  1.238     lukem 	${_MKTARGET_COMPILE}
    330  1.263       dsl 	${COMPILE.S} ${CAPICFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
    331  1.263       dsl 	${OBJCOPY} -x ${.TARGET}
    332   1.27        pk 
    333  1.252     lukem .if defined(LIB)							# {
    334  1.234     lukem .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
    335  1.234     lukem 	|| ${MKLINKLIB} != "no") && ${MKSTATICLIB} != "no"
    336  1.130        tv _LIBS=lib${LIB}.a
    337  1.130        tv .else
    338  1.130        tv _LIBS=
    339  1.130        tv .endif
    340   1.58       cgd 
    341  1.167      matt OBJS+=${SRCS:N*.h:N*.sh:R:S/$/.o/g}
    342  1.158  christos 
    343  1.255   thorpej STOBJS+=${OBJS}
    344  1.255   thorpej 
    345  1.280     lukem LOBJS+=${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln}
    346  1.280     lukem 
    347  1.281     lukem .if ${LIBISPRIVATE} != "no"
    348  1.252     lukem # No installation is required
    349  1.252     lukem libinstall::
    350  1.281     lukem .else	# ${LIBISPRIVATE} == "no"					# {
    351  1.252     lukem 
    352  1.268     lukem .if ${MKDEBUGLIB} != "no"
    353  1.266  christos _LIBS+=lib${LIB}_g.a
    354  1.266  christos GOBJS+=${OBJS:.o=.go}
    355  1.266  christos DEBUGFLAGS?=-DDEBUG
    356  1.266  christos .endif
    357  1.266  christos 
    358  1.149     lukem .if ${MKPROFILE} != "no"
    359  1.130        tv _LIBS+=lib${LIB}_p.a
    360  1.167      matt POBJS+=${OBJS:.o=.po}
    361  1.262  christos PROFFLAGS?=-DGPROF -DPROF
    362    1.1       cgd .endif
    363    1.1       cgd 
    364  1.252     lukem .if ${MKPIC} != "no"							# {
    365  1.160    simonb .if ${MKPICLIB} == "no"
    366  1.205      yamt .if ${MKSHLIBOBJS} != "no"
    367  1.205      yamt # make _pic.a, which isn't really pic,
    368  1.205      yamt # since it's needed for making shared lib.
    369  1.205      yamt # but don't install it.
    370  1.205      yamt SOLIB=lib${LIB}_pic.a
    371  1.205      yamt SOBJS+=${OBJS:.o=.so}
    372  1.205      yamt .else
    373  1.160    simonb SOLIB=lib${LIB}.a
    374  1.205      yamt .endif
    375  1.160    simonb .else
    376  1.160    simonb SOLIB=lib${LIB}_pic.a
    377  1.160    simonb _LIBS+=${SOLIB}
    378  1.167      matt SOBJS+=${OBJS:.o=.so}
    379  1.160    simonb .endif
    380  1.171  christos .if defined(SHLIB_FULLVERSION)
    381  1.171  christos _LIBS+=lib${LIB}.so.${SHLIB_FULLVERSION}
    382   1.27        pk .endif
    383  1.252     lukem .endif									# }
    384   1.27        pk 
    385  1.279     lukem .if ${MKLINT} != "no" && !empty(LOBJS)
    386   1.58       cgd _LIBS+=llib-l${LIB}.ln
    387  1.215  christos .endif
    388   1.27        pk 
    389  1.281     lukem .endif	# ${LIBISPRIVATE} == "no"					# }
    390  1.252     lukem 
    391  1.234     lukem ALLOBJS=
    392  1.234     lukem .if (${MKPIC} == "no" || (defined(LDSTATIC) && ${LDSTATIC} != "") \
    393  1.234     lukem 	|| ${MKLINKLIB} != "no") && ${MKSTATICLIB} != "no"
    394  1.255   thorpej ALLOBJS+=${STOBJS}
    395  1.179  dmcmahil .endif
    396  1.234     lukem ALLOBJS+=${POBJS} ${SOBJS}
    397  1.279     lukem .if ${MKLINT} != "no" && !empty(LOBJS)
    398  1.179  dmcmahil ALLOBJS+=${LOBJS}
    399  1.216  christos .endif
    400  1.252     lukem .else	# !defined(LIB)							# } {
    401  1.216  christos LOBJS=
    402  1.216  christos SOBJS=
    403  1.252     lukem .endif	# !defined(LIB)							# }
    404  1.186        tv 
    405  1.254     lukem _YLSRCS=	${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
    406  1.253  christos 
    407  1.253  christos .NOPATH: ${ALLOBJS} ${_LIBS} ${_YLSRCS}
    408  1.158  christos 
    409  1.162   mycroft realall: ${SRCS} ${ALLOBJS:O} ${_LIBS}
    410    1.1       cgd 
    411  1.243       rtr .if !target(__archivebuild)
    412   1.90  christos __archivebuild: .USE
    413  1.238     lukem 	${_MKTARGET_BUILD}
    414  1.236     lukem 	rm -f ${.TARGET}
    415  1.228     lukem 	${AR} cq ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
    416   1.89  christos 	${RANLIB} ${.TARGET}
    417  1.243       rtr .endif
    418   1.89  christos 
    419  1.243       rtr .if !target(__archiveinstall)
    420   1.89  christos __archiveinstall: .USE
    421  1.238     lukem 	${_MKTARGET_INSTALL}
    422  1.198     lukem 	${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
    423  1.269       dbj 	    ${empty(PRESERVE):?-a "${RANLIB} -t":} ${.ALLSRC} ${.TARGET}
    424  1.243       rtr .endif
    425   1.89  christos 
    426  1.197   mycroft __archivesymlinkpic: .USE
    427  1.238     lukem 	${_MKTARGET_INSTALL}
    428  1.264     jwise 	${INSTALL_SYMLINK} ${.ALLSRC} ${.TARGET}
    429  1.197   mycroft 
    430  1.253  christos DPSRCS+=	${_YLSRCS}
    431  1.253  christos CLEANFILES+=	${_YLSRCS}
    432  1.230     lukem 
    433  1.266  christos ${STOBJS} ${POBJS} ${GOBJS} ${SOBJS} ${LOBJS}: ${DPSRCS}
    434  1.103   mycroft 
    435  1.255   thorpej lib${LIB}.a:: ${STOBJS} __archivebuild
    436    1.1       cgd 
    437   1.89  christos lib${LIB}_p.a:: ${POBJS} __archivebuild
    438    1.1       cgd 
    439   1.89  christos lib${LIB}_pic.a:: ${SOBJS} __archivebuild
    440   1.27        pk 
    441  1.266  christos lib${LIB}_g.a:: ${GOBJS} __archivebuild
    442  1.266  christos 
    443  1.235     lukem 
    444  1.235     lukem _LIBLDOPTS=
    445  1.235     lukem .if ${SHLIBDIR} != "/usr/lib"
    446  1.235     lukem _LIBLDOPTS+=	-Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib \
    447  1.235     lukem 		-R${SHLIBDIR} \
    448  1.235     lukem 		-L${DESTDIR}${SHLIBDIR}
    449  1.235     lukem .elif ${SHLIBINSTALLDIR} != "/usr/lib"
    450  1.235     lukem _LIBLDOPTS+=	-Wl,-rpath-link,${DESTDIR}${SHLIBINSTALLDIR}:${DESTDIR}/usr/lib \
    451  1.235     lukem 		-L${DESTDIR}${SHLIBINSTALLDIR}
    452  1.235     lukem .endif
    453  1.235     lukem 
    454  1.277  christos # gcc -shared now adds -lc automatically. For libraries other than libc and
    455  1.277  christos # libgcc* we add as a dependency the installed shared libc. For libc and
    456  1.277  christos # libgcc* we avoid adding libc as a dependency by using -nostdlib. Note that
    457  1.277  christos # -Xl,-nostdlib is not enough because we want to tell the compiler-driver not
    458  1.277  christos # to add standard libraries, not the linker.
    459  1.276  christos .if !defined(LIB)
    460  1.274  christos DPLIBC ?= ${DESTDIR}${LIBC_SO}
    461  1.276  christos .else
    462  1.278    simonb .if ${LIB} != "c" && ${LIB:Mgcc*} == ""
    463  1.276  christos DPLIBC ?= ${DESTDIR}${LIBC_SO}
    464  1.277  christos .else
    465  1.278    simonb LDLIBC ?= -nodefaultlibs
    466  1.278    simonb .if ${LIB} == "c"
    467  1.278    simonb LDADD+= -lgcc_pic
    468  1.278    simonb .endif
    469  1.276  christos .endif
    470  1.274  christos .endif
    471  1.274  christos 
    472  1.274  christos lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOLIB} ${DPADD} ${DPLIBC} \
    473   1.88       cgd     ${SHLIB_LDSTARTFILE} ${SHLIB_LDENDFILE}
    474  1.238     lukem 	${_MKTARGET_BUILD}
    475  1.236     lukem 	rm -f lib${LIB}.so.${SHLIB_FULLVERSION}
    476  1.152      fair .if defined(DESTDIR)
    477  1.277  christos 	${CC} ${LDLIBC} -Wl,-nostdlib -B${_GCC_CRTDIR}/ -B${DESTDIR}/usr/lib/ \
    478  1.235     lukem 	    ${_LIBLDOPTS} \
    479  1.231     lukem 	    -Wl,-x -shared ${SHLIB_SHFLAGS} ${LDFLAGS} -o ${.TARGET} \
    480  1.221  drochner 	    -Wl,--whole-archive ${SOLIB} \
    481  1.221  drochner 	    -Wl,--no-whole-archive ${LDADD} \
    482  1.277  christos 	    -L${_GCC_LIBGCCDIR}
    483  1.221  drochner .else
    484  1.277  christos 	${CC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} ${LDFLAGS} \
    485  1.277  christos 	    -o ${.TARGET} ${_LIBLDOPTS} \
    486  1.277  christos 	    -Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${LDADD}
    487  1.152      fair .endif
    488  1.148     lukem .if ${OBJECT_FMT} == "ELF"
    489  1.196     lukem #  We don't use INSTALL_SYMLINK here because this is just
    490  1.196     lukem #  happening inside the build directory/objdir. XXX Why does
    491  1.196     lukem #  this spend so much effort on libraries that aren't live??? XXX
    492  1.241      matt 	${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
    493  1.177   mycroft 	mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
    494  1.241      matt 	${HOST_LN} -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
    495  1.177   mycroft 	mv -f lib${LIB}.so.tmp lib${LIB}.so
    496  1.133        tv .endif
    497   1.35        pk 
    498  1.252     lukem .if !empty(LOBJS)							# {
    499  1.103   mycroft LLIBS?=		-lc
    500   1.58       cgd llib-l${LIB}.ln: ${LOBJS}
    501  1.238     lukem 	${_MKTARGET_COMPILE}
    502  1.236     lukem 	rm -f llib-l${LIB}.ln
    503  1.206   thorpej .if defined(DESTDIR)
    504  1.228     lukem 	${LINT} -C${LIB} ${.ALLSRC} -L${DESTDIR}/usr/libdata ${LLIBS}
    505  1.206   thorpej .else
    506  1.228     lukem 	${LINT} -C${LIB} ${.ALLSRC} ${LLIBS}
    507  1.206   thorpej .endif
    508  1.252     lukem .endif									# }
    509    1.1       cgd 
    510  1.280     lukem lint: ${LOBJS}
    511  1.280     lukem .if defined(LOBJS) && !empty(LOBJS)
    512  1.280     lukem 	${LINT} ${LINTFLAGS} ${LOBJS}
    513  1.280     lukem .endif
    514  1.280     lukem 
    515  1.246     lukem cleanlib: .PHONY
    516   1.48   mycroft 	rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
    517  1.255   thorpej 	rm -f lib${LIB}.a ${STOBJS}
    518   1.59       cgd 	rm -f lib${LIB}_p.a ${POBJS}
    519  1.266  christos 	rm -f lib${LIB}_g.a ${GOBJS}
    520  1.133        tv 	rm -f lib${LIB}_pic.a lib${LIB}.so.* lib${LIB}.so ${SOBJS}
    521  1.266  christos 	rm -f ${STOBJS:=.tmp} ${POBJS:=.tmp} ${SOBJS:=.tmp} ${GOBJS:=.tmp}
    522   1.59       cgd 	rm -f llib-l${LIB}.ln ${LOBJS}
    523    1.1       cgd 
    524  1.252     lukem 
    525  1.252     lukem .if !target(libinstall)							# {
    526  1.148     lukem # Make sure it gets defined, in case MKPIC==no && MKLINKLIB==no
    527  1.139        tv libinstall::
    528  1.139        tv 
    529  1.234     lukem .if ${MKLINKLIB} != "no" && ${MKSTATICLIB} != "no"
    530   1.89  christos libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}.a
    531  1.168   mycroft .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}.a
    532  1.197   mycroft 
    533  1.269       dbj .if ${MKUPDATE} == "no"
    534  1.197   mycroft .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
    535  1.197   mycroft ${DESTDIR}${LIBDIR}/lib${LIB}.a! .MADE
    536   1.89  christos .endif
    537  1.197   mycroft ${DESTDIR}${LIBDIR}/lib${LIB}.a! lib${LIB}.a __archiveinstall
    538  1.197   mycroft .else
    539  1.157     fredb .if !defined(BUILD) && !make(all) && !make(lib${LIB}.a)
    540   1.89  christos ${DESTDIR}${LIBDIR}/lib${LIB}.a: .MADE
    541   1.89  christos .endif
    542   1.89  christos ${DESTDIR}${LIBDIR}/lib${LIB}.a: lib${LIB}.a __archiveinstall
    543  1.130        tv .endif
    544  1.197   mycroft .endif
    545   1.89  christos 
    546  1.149     lukem .if ${MKPROFILE} != "no"
    547   1.89  christos libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
    548  1.168   mycroft .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_p.a
    549  1.197   mycroft 
    550  1.269       dbj .if ${MKUPDATE} == "no"
    551  1.197   mycroft .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
    552  1.197   mycroft ${DESTDIR}${LIBDIR}/lib${LIB}_p.a! .MADE
    553   1.32        pk .endif
    554  1.197   mycroft ${DESTDIR}${LIBDIR}/lib${LIB}_p.a! lib${LIB}_p.a __archiveinstall
    555  1.197   mycroft .else
    556  1.157     fredb .if !defined(BUILD) && !make(all) && !make(lib${LIB}_p.a)
    557   1.89  christos ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: .MADE
    558   1.89  christos .endif
    559   1.89  christos ${DESTDIR}${LIBDIR}/lib${LIB}_p.a: lib${LIB}_p.a __archiveinstall
    560   1.89  christos .endif
    561  1.197   mycroft .endif
    562   1.89  christos 
    563  1.268     lukem .if ${MKDEBUGLIB} != "no"
    564  1.266  christos libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a
    565  1.266  christos .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_g.a
    566  1.266  christos 
    567  1.269       dbj .if ${MKUPDATE} == "no"
    568  1.266  christos .if !defined(BUILD) && !make(all) && !make(lib${LIB}_g.a)
    569  1.266  christos ${DESTDIR}${LIBDIR}/lib${LIB}_g.a! .MADE
    570  1.266  christos .endif
    571  1.266  christos ${DESTDIR}${LIBDIR}/lib${LIB}_g.a! lib${LIB}_g.a __archiveinstall
    572  1.266  christos .else
    573  1.266  christos .if !defined(BUILD) && !make(all) && !make(lib${LIB}_g.a)
    574  1.266  christos ${DESTDIR}${LIBDIR}/lib${LIB}_g.a: .MADE
    575  1.266  christos .endif
    576  1.266  christos ${DESTDIR}${LIBDIR}/lib${LIB}_g.a: lib${LIB}_g.a __archiveinstall
    577  1.266  christos .endif
    578  1.266  christos .endif
    579  1.266  christos 
    580  1.149     lukem .if ${MKPIC} != "no" && ${MKPICINSTALL} != "no"
    581  1.168   mycroft libinstall:: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
    582  1.160    simonb .PRECIOUS: ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a
    583  1.197   mycroft 
    584  1.269       dbj .if ${MKUPDATE} == "no"
    585  1.197   mycroft .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
    586  1.197   mycroft ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! .MADE
    587   1.89  christos .endif
    588  1.197   mycroft .if ${MKPICLIB} == "no"
    589  1.197   mycroft ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}.a __archivesymlinkpic
    590  1.197   mycroft .else
    591  1.197   mycroft ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a! lib${LIB}_pic.a __archiveinstall
    592  1.197   mycroft .endif
    593  1.197   mycroft .else
    594  1.157     fredb .if !defined(BUILD) && !make(all) && !make(lib${LIB}_pic.a)
    595   1.89  christos ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: .MADE
    596   1.33        pk .endif
    597  1.160    simonb .if ${MKPICLIB} == "no"
    598  1.197   mycroft ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}.a __archivesymlinkpic
    599  1.160    simonb .else
    600   1.89  christos ${DESTDIR}${LIBDIR}/lib${LIB}_pic.a: lib${LIB}_pic.a __archiveinstall
    601  1.160    simonb .endif
    602   1.89  christos .endif
    603  1.197   mycroft .endif
    604   1.89  christos 
    605  1.171  christos .if ${MKPIC} != "no" && defined(SHLIB_FULLVERSION)
    606  1.195     lukem libinstall:: ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
    607  1.195     lukem .PRECIOUS: ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
    608  1.197   mycroft 
    609  1.269       dbj .if ${MKUPDATE} == "no"
    610  1.197   mycroft .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
    611  1.197   mycroft ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}! .MADE
    612   1.89  christos .endif
    613  1.197   mycroft ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}! lib${LIB}.so.${SHLIB_FULLVERSION}
    614  1.197   mycroft .else
    615  1.171  christos .if !defined(BUILD) && !make(all) && !make(lib${LIB}.so.${SHLIB_FULLVERSION})
    616  1.195     lukem ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: .MADE
    617   1.89  christos .endif
    618  1.195     lukem ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION}: lib${LIB}.so.${SHLIB_FULLVERSION}
    619  1.197   mycroft .endif
    620  1.238     lukem 	${_MKTARGET_INSTALL}
    621  1.188        tv 	${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
    622  1.264     jwise 		${.ALLSRC} ${.TARGET}
    623  1.195     lukem .if ${_LIBSODIR} != ${LIBDIR}
    624  1.264     jwise 	${INSTALL_SYMLINK} \
    625  1.261     lukem 		-l r ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION} \
    626  1.208     perry 		${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_FULLVERSION}
    627  1.195     lukem .endif
    628  1.148     lukem .if ${OBJECT_FMT} == "a.out" && !defined(DESTDIR)
    629  1.195     lukem 	/sbin/ldconfig -m ${_LIBSODIR} ${LIBDIR}
    630  1.146   thorpej .endif
    631  1.148     lukem .if ${OBJECT_FMT} == "ELF"
    632  1.264     jwise 	${INSTALL_SYMLINK} \
    633  1.208     perry 		lib${LIB}.so.${SHLIB_FULLVERSION} \
    634  1.208     perry 		${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_MAJOR}
    635  1.195     lukem .if ${_LIBSODIR} != ${LIBDIR}
    636  1.264     jwise 	${INSTALL_SYMLINK} \
    637  1.265  christos 		-l r ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION} \
    638  1.208     perry 		${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
    639  1.195     lukem .endif
    640  1.148     lukem .if ${MKLINKLIB} != "no"
    641  1.264     jwise 	${INSTALL_SYMLINK} \
    642  1.208     perry 		lib${LIB}.so.${SHLIB_FULLVERSION} \
    643  1.208     perry 		${DESTDIR}${_LIBSODIR}/lib${LIB}.so
    644  1.195     lukem .if ${_LIBSODIR} != ${LIBDIR}
    645  1.264     jwise 	${INSTALL_SYMLINK} \
    646  1.260     lukem 		-l r ${DESTDIR}${_LIBSODIR}/lib${LIB}.so.${SHLIB_FULLVERSION} \
    647  1.208     perry 		${DESTDIR}${LIBDIR}/lib${LIB}.so
    648  1.195     lukem .endif
    649   1.83       cgd .endif
    650   1.12       cgd .endif
    651  1.139        tv .endif
    652   1.89  christos 
    653  1.279     lukem .if ${MKLINT} != "no" && !empty(LOBJS)
    654   1.89  christos libinstall:: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
    655  1.168   mycroft .PRECIOUS: ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln
    656  1.197   mycroft 
    657  1.269       dbj .if ${MKUPDATE} == "no"
    658  1.197   mycroft .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
    659  1.197   mycroft ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln! .MADE
    660   1.89  christos .endif
    661  1.197   mycroft ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln! llib-l${LIB}.ln
    662  1.197   mycroft .else
    663  1.157     fredb .if !defined(BUILD) && !make(all) && !make(llib-l${LIB}.ln)
    664   1.89  christos ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: .MADE
    665   1.89  christos .endif
    666   1.95   mycroft ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: llib-l${LIB}.ln
    667  1.197   mycroft .endif
    668  1.238     lukem 	${_MKTARGET_INSTALL}
    669  1.188        tv 	${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
    670  1.264     jwise 		${.ALLSRC} ${DESTDIR}${LINTLIBDIR}
    671   1.58       cgd .endif
    672  1.252     lukem .endif	# !target(libinstall)						# }
    673    1.1       cgd 
    674  1.188        tv ##### Pull in related .mk logic
    675    1.1       cgd .include <bsd.man.mk>
    676   1.57       jtc .include <bsd.nls.mk>
    677   1.91  christos .include <bsd.files.mk>
    678   1.89  christos .include <bsd.inc.mk>
    679  1.109       cjs .include <bsd.links.mk>
    680   1.24   mycroft .include <bsd.dep.mk>
    681  1.117   mycroft 
    682  1.188        tv ${TARGETS}:	# ensure existence
    683