freebsd-nq/share/mk/bsd.lib.mk

375 lines
9.0 KiB
Makefile
Raw Normal View History

# from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91
1999-08-28 00:22:10 +00:00
# $FreeBSD$
#
1994-05-30 19:09:18 +00:00
.if !target(__initialized__)
__initialized__:
1994-05-30 19:09:18 +00:00
.if exists(${.CURDIR}/../Makefile.inc)
.include "${.CURDIR}/../Makefile.inc"
.endif
.endif
1994-05-30 19:09:18 +00:00
.if exists(${.CURDIR}/shlib_version)
SHLIB_MAJOR != . ${.CURDIR}/shlib_version ; echo $$major
.if ${OBJFORMAT} == aout
SHLIB_MINOR != . ${.CURDIR}/shlib_version ; echo $$minor
.endif
.endif
# Set up the variables controlling shared libraries. After this section,
# SHLIB_NAME will be defined only if we are to create a shared library.
# SHLIB_LINK will be defined only if we are to create a link to it.
# INSTALL_PIC_ARCHIVE will be defined only if we are to create a PIC archive.
.if defined(NOPIC)
.undef SHLIB_NAME
.undef INSTALL_PIC_ARCHIVE
.else
.if ${OBJFORMAT} == elf
.if !defined(SHLIB_NAME) && defined(SHLIB_MAJOR)
SHLIB_NAME= lib${LIB}.so.${SHLIB_MAJOR}
SHLIB_LINK?= lib${LIB}.so
.endif
SONAME?= ${SHLIB_NAME}
.else
.if defined(SHLIB_MAJOR) && defined(SHLIB_MINOR)
SHLIB_NAME?= lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
.endif
.endif
.endif
.if defined(DEBUG_FLAGS)
CFLAGS+= ${DEBUG_FLAGS}
.endif
.if !defined(DEBUG_FLAGS)
1994-05-30 19:09:18 +00:00
STRIP?= -s
.endif
1994-05-30 19:09:18 +00:00
.if ${OBJFORMAT} != aout || make(checkdpadd) || defined(NEED_LIBNAMES)
.include <bsd.libnames.mk>
.endif
1994-05-30 19:09:18 +00:00
.MAIN: all
# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
# .So used for PIC object files
1994-05-30 19:09:18 +00:00
.SUFFIXES:
.SUFFIXES: .out .o .po .So .S .s .c .cc .cpp .cxx .m .C .f .y .l
1994-05-30 19:09:18 +00:00
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
1994-05-30 19:09:18 +00:00
.c.po:
${CC} -pg ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
1994-05-30 19:09:18 +00:00
.c.So:
${CC} ${PICFLAG} -DPIC ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.cc.o .C.o .cpp.o .cxx.o:
${CXX} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.cc.po .C.po .cpp.po .cxx.po:
${CXX} -pg ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.cc.So .C.So .cpp.So .cxx.So:
${CXX} ${PICFLAG} -DPIC ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.f.o:
${FC} ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.f.po:
${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.f.So:
${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.m.o:
${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.m.po:
${OBJC} ${OBJCFLAGS} -pg -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.m.So:
${OBJC} ${PICFLAG} -DPIC ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
1994-05-30 19:09:18 +00:00
.s.o:
${CC} -x assembler-with-cpp ${CFLAGS:M-[BID]*} ${AINC} -c \
${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
1994-05-30 19:09:18 +00:00
.s.po:
${CC} -x assembler-with-cpp -DPROF ${CFLAGS:M-[BID]*} ${AINC} -c \
${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
1994-05-30 19:09:18 +00:00
.s.So:
2002-03-12 01:18:07 +00:00
${CC} -x assembler-with-cpp ${PICFLAG} -DPIC ${CFLAGS:M-[BID]*} ${AINC} -c \
${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.S.o:
${CC} ${CFLAGS:M-[BID]*} ${AINC} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.S.po:
${CC} -DPROF ${CFLAGS:M-[BID]*} ${AINC} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -X -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.S.So:
2002-03-12 01:18:07 +00:00
${CC} ${PICFLAG} -DPIC ${CFLAGS:M-[BID]*} ${AINC} -c ${.IMPSRC} -o ${.TARGET}
@${LD} -o ${.TARGET}.tmp -x -r ${.TARGET}
@mv ${.TARGET}.tmp ${.TARGET}
.if !defined(INTERNALLIB) || defined(INTERNALSTATICLIB)
.if !defined(NOPROFILE) && !defined(INTERNALLIB)
1994-05-30 19:09:18 +00:00
_LIBS=lib${LIB}.a lib${LIB}_p.a
.else
_LIBS=lib${LIB}.a
.endif
.endif
1994-05-30 19:09:18 +00:00
.if defined(SHLIB_NAME)
_LIBS+=${SHLIB_NAME}
.endif
.if defined(INSTALL_PIC_ARCHIVE)
_LIBS+=lib${LIB}_pic.a
.endif
.if !defined(PICFLAG)
2002-03-12 01:14:19 +00:00
.if ${MACHINE_ARCH} == "sparc64"
PICFLAG=-fPIC
.else
PICFLAG=-fpic
1994-05-30 19:09:18 +00:00
.endif
2002-03-12 01:14:19 +00:00
.endif
1994-05-30 19:09:18 +00:00
.if !defined(NOMAN)
all: objwarn ${_LIBS} all-man _SUBDIR # llib-l${LIB}.ln
.else
all: objwarn ${_LIBS} _SUBDIR # llib-l${LIB}.ln
.endif
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
1994-05-30 19:09:18 +00:00
lib${LIB}.a:: ${OBJS} ${STATICOBJS}
@${ECHO} building static ${LIB} library
1994-05-30 19:09:18 +00:00
@rm -f lib${LIB}.a
@${AR} cq lib${LIB}.a `lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD}
${RANLIB} lib${LIB}.a
1994-05-30 19:09:18 +00:00
POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po}
.if !defined(NOPROFILE)
1994-05-30 19:09:18 +00:00
lib${LIB}_p.a:: ${POBJS}
@${ECHO} building profiled ${LIB} library
1994-05-30 19:09:18 +00:00
@rm -f lib${LIB}_p.a
1996-08-03 06:43:05 +00:00
@${AR} cq lib${LIB}_p.a `lorder ${POBJS} | tsort -q` ${ARADD}
${RANLIB} lib${LIB}_p.a
.endif
SOBJS+= ${OBJS:.o=.So}
.if defined(SHLIB_NAME)
${SHLIB_NAME}: ${SOBJS}
@${ECHO} building shared library ${SHLIB_NAME}
@rm -f ${SHLIB_NAME} ${SHLIB_LINK}
.if defined(SHLIB_LINK)
@ln -sf ${SHLIB_NAME} ${SHLIB_LINK}
.endif
.if ${OBJFORMAT} == aout
Obviate the need to set the COMPILER_PATH and LIBRARY_PATH in Makefile.inc1 to pick up the correct cross-tools (the compiler executables and binutils) and special linker files (crt*.o). This is now controlled by a single knob, TOOLS_PREFIX, when building cross-tools. Fixed regression in Makefile.inc1,v 1.203 (-nostdinc). This clobbered target architecture's CFLAGS with building host's CPUTYPE setting in /etc/make.conf, and had a nice but nasty side effect of exposing some (normally hidden) bugs in system headers. (Attempt to move the "-nostdinc -I..." part of CFLAGS into the new CINCLUDES (modeled after a similar CXXINCLUDES) eventually failed because hard-coding ${WORLDTMP}/usr/include to be the first in the include list does not always work, e.g. lib/libbind.) Compensate the -nostdinc removal by making cpp(1) built in the cross-tools stage to not look for <> header files in the building host's /usr/include (already committed as gnu/usr.bin/cc/cc_tools/freebsd-native.h, revisions 1.10-1.12, STANDARD_INCLUDE_DIR). : $ /usr/obj/usr/src/i386/usr/bin/cpp -v /dev/null : : Before: : : #include <...> search starts here: : /usr/obj/usr/src/i386/usr/include : /usr/include : End of search list. : : After: : : #include <...> search starts here: : /usr/obj/usr/src/i386/usr/include : /usr/obj/usr/src/i386/usr/include (Disabling the use of GCC_INCLUDE_DIR in the FREEBSD_NATIVE case would fix the duplicate above.) Get rid of the (now unneeded) -I${DESTDIR}/usr/include magic in bsd.prog.mk and bsd.lib.mk. Finish the removal of LDDESTDIR in bsd.lib.mk,v 1.55 -- we no longer have users of it. The required changes to gcc were already committed as contrib/gcc.295/gcc.c, revisions 1.23 and 1.24. Basically, this allows for the changes above plus makes gcc(1) persistent about path configuration, whether it's configured as a native or a cross compiler: : $ /usr/obj/usr/src/i386/usr/bin/cc -print-search-dirs : install: /usr/obj/usr/src/i386/usr/libexec/(null) : programs: /usr/obj/usr/src/i386/usr/libexec/elf/:/usr/obj/usr/src/i386/usr/libexec/ : libraries: /usr/obj/usr/src/i386/usr/lib/ : : $ /usr/obj/alpha/usr/src/i386/usr/bin/cc -print-search-dirs : install: /usr/obj/alpha/usr/src/i386/usr/libexec/(null) : programs: /usr/obj/alpha/usr/src/i386/usr/libexec/elf/:/usr/obj/alpha/usr/src/i386/usr/libexec/ : libraries: /usr/obj/alpha/usr/src/i386/usr/lib/ Reviewed by: bde, obrien
2002-02-21 10:23:41 +00:00
@${CC} -shared -Wl,-x,-assert,pure-text \
-o ${SHLIB_NAME} \
Obviate the need to set the COMPILER_PATH and LIBRARY_PATH in Makefile.inc1 to pick up the correct cross-tools (the compiler executables and binutils) and special linker files (crt*.o). This is now controlled by a single knob, TOOLS_PREFIX, when building cross-tools. Fixed regression in Makefile.inc1,v 1.203 (-nostdinc). This clobbered target architecture's CFLAGS with building host's CPUTYPE setting in /etc/make.conf, and had a nice but nasty side effect of exposing some (normally hidden) bugs in system headers. (Attempt to move the "-nostdinc -I..." part of CFLAGS into the new CINCLUDES (modeled after a similar CXXINCLUDES) eventually failed because hard-coding ${WORLDTMP}/usr/include to be the first in the include list does not always work, e.g. lib/libbind.) Compensate the -nostdinc removal by making cpp(1) built in the cross-tools stage to not look for <> header files in the building host's /usr/include (already committed as gnu/usr.bin/cc/cc_tools/freebsd-native.h, revisions 1.10-1.12, STANDARD_INCLUDE_DIR). : $ /usr/obj/usr/src/i386/usr/bin/cpp -v /dev/null : : Before: : : #include <...> search starts here: : /usr/obj/usr/src/i386/usr/include : /usr/include : End of search list. : : After: : : #include <...> search starts here: : /usr/obj/usr/src/i386/usr/include : /usr/obj/usr/src/i386/usr/include (Disabling the use of GCC_INCLUDE_DIR in the FREEBSD_NATIVE case would fix the duplicate above.) Get rid of the (now unneeded) -I${DESTDIR}/usr/include magic in bsd.prog.mk and bsd.lib.mk. Finish the removal of LDDESTDIR in bsd.lib.mk,v 1.55 -- we no longer have users of it. The required changes to gcc were already committed as contrib/gcc.295/gcc.c, revisions 1.23 and 1.24. Basically, this allows for the changes above plus makes gcc(1) persistent about path configuration, whether it's configured as a native or a cross compiler: : $ /usr/obj/usr/src/i386/usr/bin/cc -print-search-dirs : install: /usr/obj/usr/src/i386/usr/libexec/(null) : programs: /usr/obj/usr/src/i386/usr/libexec/elf/:/usr/obj/usr/src/i386/usr/libexec/ : libraries: /usr/obj/usr/src/i386/usr/lib/ : : $ /usr/obj/alpha/usr/src/i386/usr/bin/cc -print-search-dirs : install: /usr/obj/alpha/usr/src/i386/usr/libexec/(null) : programs: /usr/obj/alpha/usr/src/i386/usr/libexec/elf/:/usr/obj/alpha/usr/src/i386/usr/libexec/ : libraries: /usr/obj/alpha/usr/src/i386/usr/lib/ Reviewed by: bde, obrien
2002-02-21 10:23:41 +00:00
`lorder ${SOBJS} | tsort -q` ${LDADD}
.else
Obviate the need to set the COMPILER_PATH and LIBRARY_PATH in Makefile.inc1 to pick up the correct cross-tools (the compiler executables and binutils) and special linker files (crt*.o). This is now controlled by a single knob, TOOLS_PREFIX, when building cross-tools. Fixed regression in Makefile.inc1,v 1.203 (-nostdinc). This clobbered target architecture's CFLAGS with building host's CPUTYPE setting in /etc/make.conf, and had a nice but nasty side effect of exposing some (normally hidden) bugs in system headers. (Attempt to move the "-nostdinc -I..." part of CFLAGS into the new CINCLUDES (modeled after a similar CXXINCLUDES) eventually failed because hard-coding ${WORLDTMP}/usr/include to be the first in the include list does not always work, e.g. lib/libbind.) Compensate the -nostdinc removal by making cpp(1) built in the cross-tools stage to not look for <> header files in the building host's /usr/include (already committed as gnu/usr.bin/cc/cc_tools/freebsd-native.h, revisions 1.10-1.12, STANDARD_INCLUDE_DIR). : $ /usr/obj/usr/src/i386/usr/bin/cpp -v /dev/null : : Before: : : #include <...> search starts here: : /usr/obj/usr/src/i386/usr/include : /usr/include : End of search list. : : After: : : #include <...> search starts here: : /usr/obj/usr/src/i386/usr/include : /usr/obj/usr/src/i386/usr/include (Disabling the use of GCC_INCLUDE_DIR in the FREEBSD_NATIVE case would fix the duplicate above.) Get rid of the (now unneeded) -I${DESTDIR}/usr/include magic in bsd.prog.mk and bsd.lib.mk. Finish the removal of LDDESTDIR in bsd.lib.mk,v 1.55 -- we no longer have users of it. The required changes to gcc were already committed as contrib/gcc.295/gcc.c, revisions 1.23 and 1.24. Basically, this allows for the changes above plus makes gcc(1) persistent about path configuration, whether it's configured as a native or a cross compiler: : $ /usr/obj/usr/src/i386/usr/bin/cc -print-search-dirs : install: /usr/obj/usr/src/i386/usr/libexec/(null) : programs: /usr/obj/usr/src/i386/usr/libexec/elf/:/usr/obj/usr/src/i386/usr/libexec/ : libraries: /usr/obj/usr/src/i386/usr/lib/ : : $ /usr/obj/alpha/usr/src/i386/usr/bin/cc -print-search-dirs : install: /usr/obj/alpha/usr/src/i386/usr/libexec/(null) : programs: /usr/obj/alpha/usr/src/i386/usr/libexec/elf/:/usr/obj/alpha/usr/src/i386/usr/libexec/ : libraries: /usr/obj/alpha/usr/src/i386/usr/lib/ Reviewed by: bde, obrien
2002-02-21 10:23:41 +00:00
@${CC} -shared -Wl,-x \
-o ${SHLIB_NAME} -Wl,-soname,${SONAME} \
Obviate the need to set the COMPILER_PATH and LIBRARY_PATH in Makefile.inc1 to pick up the correct cross-tools (the compiler executables and binutils) and special linker files (crt*.o). This is now controlled by a single knob, TOOLS_PREFIX, when building cross-tools. Fixed regression in Makefile.inc1,v 1.203 (-nostdinc). This clobbered target architecture's CFLAGS with building host's CPUTYPE setting in /etc/make.conf, and had a nice but nasty side effect of exposing some (normally hidden) bugs in system headers. (Attempt to move the "-nostdinc -I..." part of CFLAGS into the new CINCLUDES (modeled after a similar CXXINCLUDES) eventually failed because hard-coding ${WORLDTMP}/usr/include to be the first in the include list does not always work, e.g. lib/libbind.) Compensate the -nostdinc removal by making cpp(1) built in the cross-tools stage to not look for <> header files in the building host's /usr/include (already committed as gnu/usr.bin/cc/cc_tools/freebsd-native.h, revisions 1.10-1.12, STANDARD_INCLUDE_DIR). : $ /usr/obj/usr/src/i386/usr/bin/cpp -v /dev/null : : Before: : : #include <...> search starts here: : /usr/obj/usr/src/i386/usr/include : /usr/include : End of search list. : : After: : : #include <...> search starts here: : /usr/obj/usr/src/i386/usr/include : /usr/obj/usr/src/i386/usr/include (Disabling the use of GCC_INCLUDE_DIR in the FREEBSD_NATIVE case would fix the duplicate above.) Get rid of the (now unneeded) -I${DESTDIR}/usr/include magic in bsd.prog.mk and bsd.lib.mk. Finish the removal of LDDESTDIR in bsd.lib.mk,v 1.55 -- we no longer have users of it. The required changes to gcc were already committed as contrib/gcc.295/gcc.c, revisions 1.23 and 1.24. Basically, this allows for the changes above plus makes gcc(1) persistent about path configuration, whether it's configured as a native or a cross compiler: : $ /usr/obj/usr/src/i386/usr/bin/cc -print-search-dirs : install: /usr/obj/usr/src/i386/usr/libexec/(null) : programs: /usr/obj/usr/src/i386/usr/libexec/elf/:/usr/obj/usr/src/i386/usr/libexec/ : libraries: /usr/obj/usr/src/i386/usr/lib/ : : $ /usr/obj/alpha/usr/src/i386/usr/bin/cc -print-search-dirs : install: /usr/obj/alpha/usr/src/i386/usr/libexec/(null) : programs: /usr/obj/alpha/usr/src/i386/usr/libexec/elf/:/usr/obj/alpha/usr/src/i386/usr/libexec/ : libraries: /usr/obj/alpha/usr/src/i386/usr/lib/ Reviewed by: bde, obrien
2002-02-21 10:23:41 +00:00
`lorder ${SOBJS} | tsort -q` ${LDADD}
.endif
.endif
.if defined(INSTALL_PIC_ARCHIVE)
lib${LIB}_pic.a:: ${SOBJS}
@${ECHO} building special pic ${LIB} library
@rm -f lib${LIB}_pic.a
1994-12-28 00:49:58 +00:00
@${AR} cq lib${LIB}_pic.a ${SOBJS} ${ARADD}
${RANLIB} lib${LIB}_pic.a
.endif
1994-05-30 19:09:18 +00:00
llib-l${LIB}.ln: ${SRCS}
${LINT} -C${LIB} ${CFLAGS:M-[DIU]*} ${.ALLSRC:M*.c}
1994-05-30 19:09:18 +00:00
.if !target(clean)
clean: _SUBDIR
rm -f a.out ${OBJS} ${STATICOBJS} ${OBJS:S/$/.tmp/} ${CLEANFILES}
rm -f lib${LIB}.a # llib-l${LIB}.ln
rm -f ${POBJS} ${POBJS:S/$/.tmp/} lib${LIB}_p.a
rm -f ${SOBJS} ${SOBJS:.So=.so} ${SOBJS:S/$/.tmp/} \
${SHLIB_NAME} ${SHLIB_LINK} \
lib${LIB}.so.* lib${LIB}.so lib${LIB}_pic.a
.if defined(CLEANDIRS) && !empty(CLEANDIRS)
rm -rf ${CLEANDIRS}
.endif
1994-05-30 19:09:18 +00:00
.endif
_EXTRADEPEND:
@TMP=_depend$$$$; \
sed -e 's/^\([^\.]*\).o[ ]*:/\1.o \1.po \1.So:/' < ${DEPENDFILE} \
> $$TMP; \
mv $$TMP ${DEPENDFILE}
.if !defined(NOEXTRADEPEND) && defined(SHLIB_NAME)
.if ${OBJFORMAT} == aout
echo ${SHLIB_NAME}: \
Obviate the need to set the COMPILER_PATH and LIBRARY_PATH in Makefile.inc1 to pick up the correct cross-tools (the compiler executables and binutils) and special linker files (crt*.o). This is now controlled by a single knob, TOOLS_PREFIX, when building cross-tools. Fixed regression in Makefile.inc1,v 1.203 (-nostdinc). This clobbered target architecture's CFLAGS with building host's CPUTYPE setting in /etc/make.conf, and had a nice but nasty side effect of exposing some (normally hidden) bugs in system headers. (Attempt to move the "-nostdinc -I..." part of CFLAGS into the new CINCLUDES (modeled after a similar CXXINCLUDES) eventually failed because hard-coding ${WORLDTMP}/usr/include to be the first in the include list does not always work, e.g. lib/libbind.) Compensate the -nostdinc removal by making cpp(1) built in the cross-tools stage to not look for <> header files in the building host's /usr/include (already committed as gnu/usr.bin/cc/cc_tools/freebsd-native.h, revisions 1.10-1.12, STANDARD_INCLUDE_DIR). : $ /usr/obj/usr/src/i386/usr/bin/cpp -v /dev/null : : Before: : : #include <...> search starts here: : /usr/obj/usr/src/i386/usr/include : /usr/include : End of search list. : : After: : : #include <...> search starts here: : /usr/obj/usr/src/i386/usr/include : /usr/obj/usr/src/i386/usr/include (Disabling the use of GCC_INCLUDE_DIR in the FREEBSD_NATIVE case would fix the duplicate above.) Get rid of the (now unneeded) -I${DESTDIR}/usr/include magic in bsd.prog.mk and bsd.lib.mk. Finish the removal of LDDESTDIR in bsd.lib.mk,v 1.55 -- we no longer have users of it. The required changes to gcc were already committed as contrib/gcc.295/gcc.c, revisions 1.23 and 1.24. Basically, this allows for the changes above plus makes gcc(1) persistent about path configuration, whether it's configured as a native or a cross compiler: : $ /usr/obj/usr/src/i386/usr/bin/cc -print-search-dirs : install: /usr/obj/usr/src/i386/usr/libexec/(null) : programs: /usr/obj/usr/src/i386/usr/libexec/elf/:/usr/obj/usr/src/i386/usr/libexec/ : libraries: /usr/obj/usr/src/i386/usr/lib/ : : $ /usr/obj/alpha/usr/src/i386/usr/bin/cc -print-search-dirs : install: /usr/obj/alpha/usr/src/i386/usr/libexec/(null) : programs: /usr/obj/alpha/usr/src/i386/usr/libexec/elf/:/usr/obj/alpha/usr/src/i386/usr/libexec/ : libraries: /usr/obj/alpha/usr/src/i386/usr/lib/ Reviewed by: bde, obrien
2002-02-21 10:23:41 +00:00
`${CC} -shared -Wl,-f ${LDADD}` \
>> ${DEPENDFILE}
.else
.if defined(DPADD) && !empty(DPADD)
echo ${SHLIB_NAME}: ${DPADD} >> ${DEPENDFILE}
.endif
.endif
.endif
1994-05-30 19:09:18 +00:00
.if !target(install)
.if !target(beforeinstall)
beforeinstall: _includeinstall
.endif
_includeinstall:
.if defined(INCS)
.for header in ${INCS}
cd ${.CURDIR} && \
${INSTALL} -C -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} \
${header} ${DESTDIR}${INCDIR}
.endfor
1994-05-30 19:09:18 +00:00
.endif
.if defined(PRECIOUSLIB) && !defined(NOFSCHG)
SHLINSTALLFLAGS+= -fschg
.endif
_INSTALLFLAGS:= ${INSTALLFLAGS}
.for ie in ${INSTALLFLAGS_EDIT}
_INSTALLFLAGS:= ${_INSTALLFLAGS${ie}}
.endfor
_SHLINSTALLFLAGS:= ${SHLINSTALLFLAGS}
.for ie in ${INSTALLFLAGS_EDIT}
_SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${ie}}
.endfor
1994-05-30 19:09:18 +00:00
realinstall: beforeinstall
.if !defined(INTERNALLIB)
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} lib${LIB}.a ${DESTDIR}${LIBDIR}
1994-05-30 19:09:18 +00:00
.if !defined(NOPROFILE)
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} lib${LIB}_p.a ${DESTDIR}${LIBDIR}
1994-05-30 19:09:18 +00:00
.endif
.endif
.if defined(SHLIB_NAME)
${INSTALL} ${COPY} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \
${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}
.if defined(SHLIB_LINK)
ln -sf ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}/${SHLIB_LINK}
.endif
.endif
.if defined(INSTALL_PIC_ARCHIVE)
${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${LIBDIR}
.endif
1994-05-30 19:09:18 +00:00
.if defined(LINKS) && !empty(LINKS)
@set ${LINKS}; \
while test $$# -ge 2; do \
l=${DESTDIR}$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
${ECHO} $$t -\> $$l; \
ln -f $$l $$t; \
done; true
.endif
.if defined(SYMLINKS) && !empty(SYMLINKS)
@set ${SYMLINKS}; \
while test $$# -ge 2; do \
l=$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
${ECHO} $$t -\> $$l; \
ln -fs $$l $$t; \
1994-05-30 19:09:18 +00:00
done; true
.endif
install: afterinstall _SUBDIR
1994-05-30 19:09:18 +00:00
.if !defined(NOMAN)
afterinstall: realinstall maninstall
.else
afterinstall: realinstall
1994-05-30 19:09:18 +00:00
.endif
.endif
.if !target(regress)
regress:
.endif
DISTRIBUTION?= bin
.if !target(distribute)
distribute: _SUBDIR
.for dist in ${DISTRIBUTION}
cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies
.endfor
.endif
1994-05-30 19:09:18 +00:00
.if !target(lint)
lint:
.endif
.if !defined(NOMAN)
1994-05-30 19:09:18 +00:00
.include <bsd.man.mk>
.else
.if !target(all-man)
all-man:
.endif
.if !target(maninstall)
maninstall:
.endif
.endif
.include <bsd.dep.mk>
.if !exists(${DEPENDFILE})
${OBJS} ${STATICOBJS} ${POBJS} ${SOBJS}: ${SRCS:M*.h}
.endif
.include <bsd.obj.mk>
.include <bsd.sys.mk>