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