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