version 1.101, 1997/05/09 06:19:55 |
version 1.117, 1997/10/11 08:16:26 |
|
|
# $NetBSD$ |
# $NetBSD$ |
# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94 |
# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94 |
|
|
|
.if !target(__initialized__) |
|
__initialized__: |
.if exists(${.CURDIR}/../Makefile.inc) |
.if exists(${.CURDIR}/../Makefile.inc) |
.include "${.CURDIR}/../Makefile.inc" |
.include "${.CURDIR}/../Makefile.inc" |
.endif |
.endif |
|
|
.include <bsd.own.mk> |
.include <bsd.own.mk> |
|
.include <bsd.obj.mk> |
.MAIN: all |
.MAIN: all |
|
.endif |
|
|
.PHONY: cleanlib libinstall |
.PHONY: cleanlib libinstall |
install: libinstall |
realinstall: libinstall |
clean cleandir: cleanlib |
clean cleandir: cleanlib |
|
|
.if exists(${.CURDIR}/shlib_version) |
.if exists(${.CURDIR}/shlib_version) |
Line 20 SHLIB_MINOR != . ${.CURDIR}/shlib_versio |
|
Line 23 SHLIB_MINOR != . ${.CURDIR}/shlib_versio |
|
# add additional suffixes not exported. |
# add additional suffixes not exported. |
# .po is used for profiling object files. |
# .po is used for profiling object files. |
# .so is used for PIC object files. |
# .so is used for PIC object files. |
.SUFFIXES: .out .a .ln .so .po .o .c .cc .C .F .f .r .y .l .s .S .cl .p .h .sh .m4 |
.SUFFIXES: .out .a .ln .so .po .o .s .S .c .cc .C .F .f .r .y .l .cl .p .h .sh .m4 |
|
|
|
|
# Set PICFLAGS to cc flags for producing position-independent code, |
# Set PICFLAGS to cc flags for producing position-independent code, |
Line 34 SHLIB_MINOR != . ${.CURDIR}/shlib_versio |
|
Line 37 SHLIB_MINOR != . ${.CURDIR}/shlib_versio |
|
# NetBSD/pmax used to use ${SHLIB_MAJOR}.{SHLIB-MINOR}. |
# NetBSD/pmax used to use ${SHLIB_MAJOR}.{SHLIB-MINOR}. |
# SHLIB_LDSTARTFILE: ??? |
# SHLIB_LDSTARTFILE: ??? |
# SHLIB_LDENDTILE: ?? |
# SHLIB_LDENDTILE: ?? |
# CPICFLAGS: flags to compile .c files for .so objects. |
# CPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS} |
# APICFLAGS: flags to assemble .S files for .so objects. |
# CPICFLAGS: flags for ${CC} to compile .[cC] files to .so objects. |
|
# CAPICFLAGS flags for {$CC} to compiling .[Ss] files |
|
# (usually just ${CPPPICFLAGS} ${CPICFLAGS}) |
|
# APICFLAGS: flags for ${AS} to assemble .[sS] to .so objects. |
|
|
.if (${MACHINE_ARCH} == "alpha") |
.if (${MACHINE_ARCH} == "alpha") |
|
|
Line 44 SHLIB_LDSTARTFILE= ${DESTDIR}/usr/lib/cr |
|
Line 50 SHLIB_LDSTARTFILE= ${DESTDIR}/usr/lib/cr |
|
SHLIB_LDENDFILE= ${DESTDIR}/usr/lib/crtendS.o |
SHLIB_LDENDFILE= ${DESTDIR}/usr/lib/crtendS.o |
SHLIB_SOVERSION=${SHLIB_MAJOR} |
SHLIB_SOVERSION=${SHLIB_MAJOR} |
CPICFLAGS ?= -fpic -DPIC |
CPICFLAGS ?= -fpic -DPIC |
APICFLAGS ?= -DPIC |
CPPPICFLAGS?= -DPIC |
|
CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS} |
|
APICFLAGS ?= |
|
|
.elif (${MACHINE_ARCH} == "mips") |
.elif (${MACHINE_ARCH} == "mips") |
|
|
Line 73 SHLIB_LDSTARTFILE= |
|
Line 81 SHLIB_LDSTARTFILE= |
|
SHLIB_LDENDFILE= |
SHLIB_LDENDFILE= |
SHLIB_SOVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} |
SHLIB_SOVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} |
CPICFLAGS?= -fpic -DPIC |
CPICFLAGS?= -fpic -DPIC |
APICFLAGS?= -fpic -DPIC |
CPPPICFLAGS?= -DPIC |
|
CAPICFLAGS?= ${CPPPICFLAGS} ${CPICFLAGS} |
|
APICFLAGS?= -k |
|
|
.endif |
.endif |
|
|
Line 132 CFLAGS+= ${COPTS} |
|
Line 142 CFLAGS+= ${COPTS} |
|
@rm -f ${.TARGET}.o |
@rm -f ${.TARGET}.o |
|
|
.S.so .s.so: |
.S.so .s.so: |
@echo ${COMPILE.S:Q} ${APICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET} |
@echo ${COMPILE.S:Q} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET} |
@${COMPILE.S} ${APICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o |
@${COMPILE.S} ${CAPICFLAGS} ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} -o ${.TARGET}.o |
@${LD} -x -r ${.TARGET}.o -o ${.TARGET} |
@${LD} -x -r ${.TARGET}.o -o ${.TARGET} |
@rm -f ${.TARGET}.o |
@rm -f ${.TARGET}.o |
|
|
Line 155 _LIBS+=lib${LIB}.so.${SHLIB_MAJOR}.${SHL |
|
Line 165 _LIBS+=lib${LIB}.so.${SHLIB_MAJOR}.${SHL |
|
_LIBS+=llib-l${LIB}.ln |
_LIBS+=llib-l${LIB}.ln |
.endif |
.endif |
|
|
all depend: ${SRCS} |
all: ${SRCS} ${_LIBS} |
all: ${_LIBS} |
|
|
|
OBJS+= ${SRCS:N*.h:R:S/$/.o/g} |
|
|
|
__archivebuild: .USE |
__archivebuild: .USE |
@rm -f ${.TARGET} |
@rm -f ${.TARGET} |
Line 171 __archiveinstall: .USE |
|
Line 178 __archiveinstall: .USE |
|
${RANLIB} -t ${.TARGET} |
${RANLIB} -t ${.TARGET} |
chmod ${LIBMODE} ${.TARGET} |
chmod ${LIBMODE} ${.TARGET} |
|
|
|
DPSRCS+= ${SRCS:M*.l:.l=.c} ${SRCS:M*.y:.y=.c} |
|
CLEANFILES+= ${DPSRCS} |
|
|
|
OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g} |
lib${LIB}.a:: ${OBJS} __archivebuild |
lib${LIB}.a:: ${OBJS} __archivebuild |
@echo building standard ${LIB} library |
@echo building standard ${LIB} library |
|
|
POBJS+= ${OBJS:.o=.po} |
POBJS+= ${OBJS:.o=.po} |
lib${LIB}_p.a:: ${POBJS} __archivebuild |
lib${LIB}_p.a:: ${POBJS} __archivebuild |
@echo building profiled ${LIB} library |
@echo building profiled ${LIB} library |
|
|
SOBJS+= ${OBJS:.o=.so} |
SOBJS+= ${OBJS:.o=.so} |
lib${LIB}_pic.a:: ${SOBJS} __archivebuild |
lib${LIB}_pic.a:: ${SOBJS} __archivebuild |
@echo building shared object ${LIB} library |
@echo building shared object ${LIB} library |
|
|
Line 196 lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINO |
|
Line 207 lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINO |
|
${SHLIB_LDENDFILE} |
${SHLIB_LDENDFILE} |
.endif |
.endif |
|
|
LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} |
LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} |
LLIBS?= -lc |
LLIBS?= -lc |
llib-l${LIB}.ln: ${LOBJS} |
llib-l${LIB}.ln: ${LOBJS} |
@echo building llib-l${LIB}.ln |
@echo building llib-l${LIB}.ln |
@rm -f llib-l${LIB}.ln |
@rm -f llib-l${LIB}.ln |
Line 295 ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: |
|
Line 306 ${DESTDIR}${LINTLIBDIR}/llib-l${LIB}.ln: |
|
.endif |
.endif |
.endif |
.endif |
|
|
.if !defined(NOMAN) |
|
.include <bsd.man.mk> |
.include <bsd.man.mk> |
.endif |
|
|
|
.if !defined(NONLS) |
|
.include <bsd.nls.mk> |
.include <bsd.nls.mk> |
.endif |
|
|
|
.include <bsd.obj.mk> |
|
.include <bsd.links.mk> |
|
.include <bsd.files.mk> |
.include <bsd.files.mk> |
.include <bsd.inc.mk> |
.include <bsd.inc.mk> |
|
.include <bsd.links.mk> |
.include <bsd.dep.mk> |
.include <bsd.dep.mk> |
.include <bsd.subdir.mk> |
|
.include <bsd.sys.mk> |
.include <bsd.sys.mk> |
|
|
|
# Make sure all of the standard targets are defined, even if they do nothing. |
|
lint regress: |