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