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