History log of /freebsd-10.0-release/share/mk/bsd.lib.mk
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 255384 08-Sep-2013 des

Create a private library directory (LIBPRIVATEDIR) for libraries which
we don't want to expose but which can't or shouldn't be static.

To mark a library as private, define PRIVATELIB in its Makefile. It
will be installed in LIBPRIVATEDIR, which is normally /usr/lib/private
(or /usr/lib32/private for 32-bit libraries on 64-bit platforms).

To indicate that a program or library depends on a private library,
define USEPRIVATELIB in its Makefile. The correct version of
LIBPRIVATEDIR will be added to its run-time library search path.

Approved by: re (blanket)


# 251810 16-Jun-2013 jlh

Fix install from read-only obj dir when SHLIB_LDSCRIPT is used.

Reported by: joeld
Tested by: joeld


# 251512 07-Jun-2013 emaste

Add a new knob WITH_DEBUG_FILES to control the building of standalone
debug files for userland programs and libraries. The "-g" debug flag
is automatically applied when WITH_DEBUG_FILES is set.

The debug files are now named ${prog}.debug and ${shlib}.debug for
consistency with other systems and documentation. In addition they are
installed under /usr/lib/debug, to simplify the process of installing
them if needed after a crash. Users of bsd.{prog,lib}.mk outside of the
base system place the standalone debug files in a .debug subdirectory.
GDB automatically searches both of these directories for standalone
debug files.

Thanks to everyone who contributed changes, review, and testing during
development.


# 250992 25-May-2013 jlh

Rework the comment I initially wrote when SHLIB_LDSCRIPT was introduced.
The build system is really intricate and I had a hard time to remind the
whole picture even when reading my own words. This one will hopefully
be better.


# 248806 28-Mar-2013 markj

Make sure that ${SHLIB_NAME}.debug and ${SHLIB_NAME}.symbols are always
deleted by a "make clean" when DEBUG_FLAGS is set.

Reported by: gleb
Approved by: emaste (co-mentor)


# 247054 20-Feb-2013 emaste

Fix parallel build race with DEBUG_FLAGS

Reported by: Jan Beich on freebsd-current
Tested by: markj


# 245885 24-Jan-2013 brooks

Don't declare an dependency on _maninstall when LIBRARIES_ONLY is set.
It doesn't exist.


# 245752 21-Jan-2013 brooks

Replace all known uses of ln in the build process with appropriate
install -l invocations via new INSTALL_LINK and INSTALL_SYMLINK
variables.

Sponsored by: DARPA, AFRL
Reviewed by: ian, ray, rpaulo


# 245561 17-Jan-2013 brooks

Add a new LIBRARIES_ONLY make variable to disable the build and install
of files other than the actual libraries.

Use LIBRARIES_ONLY to supress the inclusion of files in the lib32
distribution that are duplicates of files in base.

Sponsored by: DARPA, AFRL
Reviewed by: emaste


# 244915 31-Dec-2012 markj

Explicitly specify that the beforelinking target depends on the
generated object files, ensuring that the beforelinking recipe won't be
executed until compilation has finished.

Also define SHLIB_NAME_FULL to denote ${SHLIB_NAME}.debug if
DEBUG_FILES is set and ${SHLIB_NAME} otherwise, which helps avoid
obfuscating the compilation and linking rules.

Reviewed by: emaste
Approved by: emaste (co-mentor)


# 244408 18-Dec-2012 emaste

No reason to install debug data with the schg flag


# 244236 14-Dec-2012 emaste

Put shared library debug info into separate .symbols file

Sponsored by: ADARA Networks


# 244224 14-Dec-2012 emaste

Minor refactoring prior to .symbols file changes

- Combine .if x and .if !x using .else
- Separate out beforelinking dependency
- Add comments to clarify .if nesting

Sponsored by: ADARA Networks


# 243933 05-Dec-2012 eadler

Clean up hardcoded ar(1) flags in the tree to use the global ARFLAGS in
share/mk/sys.mk instead.

This is part of a medium term project to permit deterministic builds of
FreeBSD.

Submitted by: Erik Cederstrand <erik@cederstrand.dk>
Reviewed by: imp, toolchain@
Approved by: cperciva
MFC after: 2 weeks


# 236810 09-Jun-2012 dim

Amend r227797 by also passing ${STATIC_CXXFLAGS} for the other supported
C++ file extensions.

MFC after: 3 days


# 235122 07-May-2012 jlh

Introduce the ${SHLIB_LDSCRIPT} variable to have an ld(1) script
instead of a symlink for .so files.

Reviewed by: kib, kan (previous version), dim
Approved by: kib (mentor)
Silence from: -hackers@
MFC after: 1 week


# 228307 06-Dec-2011 kib

Force linker error when created shared library contains a relocation
against text. Provide the override switch to turn off the strict
behaviour. Apparently, openssl libcrypto needs it due to assembler
code not being PIC.

Discussed with: bf
MFC after: 2 weeks


# 228158 30-Nov-2011 fjoe

- CTF knob is now implemented using common scheme: MK_CTF=yes/no is
defined based on WITH/WITHOUT_CTF settings, default is WITHOUT_CTF,
NO_CTF overrides WITH_CTF (used by Makefile.inc1)
- CTFCONVERT_CMD/NORMAL_CTFCONVERT are now defined to empty string
if make(1) can handle empty commands


# 228137 29-Nov-2011 fjoe

- fix WITH_CTF when specified in /etc/src.conf [1]
- CTFCONVERT_CMD=... is a hack (should be defined to empty string instead):
make(1) should be taught to ignore empty commands silently in compat mode
(as it does in !compat mode, GNU make also silently ignores empty commands)
and to skip printing empty commands in !compat mode
- config(8) should generate ${NORMAL_CTFCONVERT} invocation without '@':
this will allow to simplify kern.pre.mk even more and lessen the number
of shell invocations during kernel build when CTF is turned off
- WITH_CTF can now be converted to usual MK_CTF=yes/no infrastructure

Pointy hat to: fjoe [1]


# 228124 29-Nov-2011 fjoe

Conditionalize ctfconvert/ctfmerge runs on make level (.if/.endif) instead
of executing a shell on every object or executable/library file.

This shaves off more than 30,000 shell invocations during buildworld.


# 227932 24-Nov-2011 des

Add CTF magic to the new .c.o rule.

MFC after: 3 weeks


# 227797 21-Nov-2011 des

As threatened on -arch, add {SHARED,STATIC}_{C,CXX}FLAGS, which allow a
Makefile to specify different CFLAGS for shared and static libraries.

MFC after: 3 weeks


# 220863 19-Apr-2011 dim

Remove support for the Intel C Compiler from the build infrastructure.
This support has not worked for several years, and is not likely to work
again, unless Intel decides to release a native FreeBSD version of their
compiler. ;)


# 220755 17-Apr-2011 dim

Remove libobjc and other Objective-C related components, as these are
extremely outdated, and not used by anything in the base system.

Silence from: current@


# 217100 07-Jan-2011 kib

Introduce make variable ACFLAGS used to supply additional flags to
cc driver when compiling assembler source file that is preprocessed.


# 212423 10-Sep-2010 rpaulo

Check the existence of a 'beforelinking' target and make the resulting
program or library depend on that before doing the final linking. This
will be needed by DTrace.

Sponsored by: The FreeBSD Foundation


# 211725 23-Aug-2010 imp

MFtbemd:

Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.


# 211437 17-Aug-2010 rpaulo

For every instance of '.if ${CC} == "foo"' or '.if ${CC} != "foo"' in
Makefiles or *.mk files, use ${CC:T:Mfoo} instead, so only the basename
of the compiler command (excluding any arguments) is considered.

This allows you to use, for example, CC="/nondefault/path/clang -xxx",
and still have the various tests in bsd.*.mk identify your compiler as
clang correctly.

ICC if cases were also changed.

Submitted by: Dimitry Andric <dimitry at andric.com>


# 210656 30-Jul-2010 rpaulo

Add missing escape characthers.

Pointed out by: b.f.


# 210636 30-Jul-2010 rpaulo

Fix previous commit: I forgot to include parenthesis.

Submitted by: anonymous


# 210612 29-Jul-2010 rpaulo

When building WITH_CTF=1, print the ctf executable that's going to be
run. This makes the 'ctfconvert' and 'ctfmerge' programs show up during
a build when compiling a kernel, a library or a program.

Sponsored by: The FreeBSD Foundation


# 206082 02-Apr-2010 netchild

WITH_CTF can now be specified in src.conf (not recommended, there
are some problems with static executables), make.conf (would also
affect ports which do not use GNU make and do not override the
compile targets) or in the kernel config (via "makeoptions
WITH_CTF=yes").

Additional (related) changes:
- propagate WITH_CTF to module builds
- do not add -g to the linker flags, it's a noop there anyway
(at least according to the man page of ld)
- do not add -g to CFLAGS unconditionally
we need to have a look if it is really needed (IMO not) or if there
is a way to add it only when WITH_CTF is used

Note: ctfconvert / ctfmerge lines will not appear in the build output,
to protect the innocent (those which do not build with WITH_CTF would
see the shell-test and may think WITH_CTF is used).

Reviewed by: imp, jhb, scottl (earlier version)
Discussed on: arch@


# 202807 22-Jan-2010 sepotvin

Introduce two new flags PO_CFLAGS and PO_CXXFLAGS to make it possible
to have different flags when building profiled objects.

MFC after: 1 month


# 195697 14-Jul-2009 kan

Second attempt at eliminating .text relocations in shared libraries
compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC
generates local calls to this function which result in absolute
relocations put into position-independent code segment, making dynamic
loader do extra work every time given shared library is being relocated
and making affected text pages non-shareable.

Reviewed by: kib
Approved by: re (kib)


# 179184 21-May-2008 jb

Add support for the Compact C Type (CTF) conversions throughout FreeBSD's
system makefiles.

Note that the CTF conversion defaults to off. We may choose to change this
default later if DTrace proves popular and people are prepared to wear
the compilation performance impact of compiling with debug symbols all the
time.

Setting NO_CTF in the make args or user environment turns off CTF conversion.
Even if we choose to default CTF generation to on later, we still need
NO_CTF so that the buildworld process can bootstrap the tools without
needlessly generating CTF data for temporary tools.

Setting WITH_CTF in the make args or user environment (and _NOT_ in
/etc/make.conf) is the only way to enable CTF data conversion. Nore that
this can't be implemented the same way that the WITH_ and WITHOUT_ stuff
is implemented throughout the buildworld because the CTF conversion needs
to work when building a simple object without a Makefile, using the
default rules in sys.mk.

Typing 'make test.o' with no makefile and just a source file test.c
should work. Also, typing 'make WITH_CTF=1 test.o without a makefile and
just a source file test.c should work and produce an object with a CTF
elf section. Typing 'make WITH_CTF=1 CFLAGS=-g test.o' without a makefile
and just a source file test.c should produce an object with both a CTF
elf section and the debug elf sections.

In the FreeBSD build where more .mk files are used than just sys.mk
which is included my make by default, the use of DEBUG_FLAGS is the
correct way to enable a debug build. The important thing to note here
is that it is the DEBUG_FLAGS setting that prevents libraries and
programs from being stripped on installation. So, for the addition of
CTF data conversion, setting DEBUG_FLAGS to contain -g, without NO_CTF,
will cause the ctfconvert and ctfmerge build programs to be executed
also with the -g arg so that debug symbols are retained rather than
being removed after the CTF data elf section has been added.

Add DTrace libraries to the list of libnames.


# 178047 09-Apr-2008 kan

Fix spelling mistake in comment.


# 172832 20-Oct-2007 ru

- Convert NO_INSTALLLIB option to a new syntax: makefiles should
test MK_INSTALLLIB, users can set WITHOUT_INSTALLLIB. The old
NO_INSTALLLIB is still supported as several makefiles set it.

- While here, fix an install when instructed not to install libs
(usr.bin/lex/lib/Makefile).

PR: bin/114200
Submitted by: Henrik Brix Andersen


# 169822 21-May-2007 ru

Style: remove redundant parentheses.


# 169524 13-May-2007 deischen

Enable symbol versioning by default. Use WITHOUT_SYMVER to disable it.
Warning, after symbol versioning is enabled, going back is not easy
(use WITHOUT_SYMVER at your own risk).

Change the default thread library to libthr.

There most likely still needs to be a version bump for at least the
thread libraries. If necessary, this will happen later.


# 168317 03-Apr-2007 kan

Break out Version.map generation code from bsd.lib.mk into a
separate bsd.symver.mk file. Include bsd.symver.mk in bsd.lib.mk
to maintain the status quo.


# 163683 25-Oct-2006 ru

- Don't pass an empty ``NM='' to lorder(1) when NM is unset.
- Don't redundantly use "env".
- Protect NM value with quotes, just in case.


# 162293 13-Sep-2006 obrien

When building WITHOUT_ASSERT_DEBUG, we need to disable -Werror as its easy
to see "warning: unused variable `foo'".


# 162210 11-Sep-2006 imp

Add a knob for compiling the tree -DNDEBUG. This turns off all the
asserts and makes binaries smaller. The binaries also become
repeatable again. As it was, without this md5's of binaries built
with different paths differed.

# Where do I document this?


# 161627 25-Aug-2006 imp

Pass whatever the value of NM down to lorder. This allows one to
override NM in Makefiles when, for example, cross compiling and have
that value be used by lorder. NM normally isn't defined, so we pass a
null value to lorder. lorder says 'NM=${NM-nm}' which causes it to
pickup the default value.


# 157054 23-Mar-2006 des

Add proper dependencies for the version map, and make sure 'make clean'
removes it if it was generated.

Reviewed by: ru


# 156854 18-Mar-2006 ru

Convert NO_PROFILE and NO_LIB32 to new style.


# 156813 17-Mar-2006 ru

Reimplementation of world/kernel build options. For details, see:

http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by: imp, jhb, kris, phk, ru (all bugs are mine)


# 156772 16-Mar-2006 deischen

Teach bsd.lib.mk to auto generate a version map file based on
a set of symbol definitions (VERSION_DEF) and symbol mappings
(SYMBOL_MAPS).

Add an awk script to generate the version map.

Suggested by: ru
Helped by: ru
Reviewed by: ru


# 155264 03-Feb-2006 ru

Handle NO_INCS solely inside bsd.incs.mk.


# 152602 19-Nov-2005 ru

Add the NO_INCS knob to bsd.prog.mk and bsd.lib.mk to not include
bsd.incs.mk, and use it when installing 32-bit compat libraries
on amd64. This causes it to *not* overwrite native headers with
i386 versions, which was the case with <fenv.h> and <vgl.h>.

PR: amd64/83806
Prodded by: bde
MFC after: 1 week


# 148725 05-Aug-2005 phk

Don't install ${LIB}_pic.a if NO_TOOLCHAIN


# 144893 11-Apr-2005 harti

Make sure the only thing that follows .endif or .else is a comment.


# 141503 08-Feb-2005 phantom

Allow building/installing of NLS catalogs while building of libraries

MFC after: 3 days


# 139111 21-Dec-2004 ru

NOFSCHG -> NO_FSCHG


# 139110 21-Dec-2004 ru

NOINSTALLLIB -> NO_INSTALLLIB


# 139107 21-Dec-2004 ru

NOEXTRADEPEND -> NO_EXTRADEPEND


# 139106 21-Dec-2004 ru

NODOCCOMPRESS -> NO_DOCCOMPRESS
NOINFO -> NO_INFO
NOINFOCOMPRESS -> NO_INFOCOMPRESS
NOLINT -> NO_LINT
NOPIC -> NO_PIC
NOPROFILE -> NO_PROFILE


# 139103 21-Dec-2004 ru

Start the dreaded NOFOO -> NO_FOO conversion.

OK'ed by: core


# 136019 01-Oct-2004 ru

Install precious shared libraries with -S.

Prodded by: Xin LI


# 129024 07-May-2004 des

Add SHLIB as a shortcut for shared-only libraries.

Not objected to by: bde, ru


# 127027 15-Mar-2004 trhodes

Remove whitespace at EOL.


# 126938 13-Mar-2004 trhodes

Fix some style bugs in previous commit.
Fix 'broken' ifdefs.
icc does not support profiling yet so remove unfinished code which was
supposed to help.

Submitted by: netchild (original version)
Reviewed by: ru


# 126890 12-Mar-2004 trhodes

This are the build infrastructure changes to allow to use the
Intel C/C++ compiler (lang/icc) to build the kernel.

The icc CPUTYPE CFLAGS use icc v7 syntax, icc v8 moans about them, but
doesn't abort. They also produce CPU specific code (new instructions
of the CPU, not only CPU specific scheduling), so if you get coredumps
with signal 4 (SIGILL, illegal instruction) you've used the wrong
CPUTYPE.

Incarnations of this patch survive gcc compiles and my make universe.
I use it on my desktop.

To use it update share/mk, add
/usr/local/intel/compiler70/ia32/bin (icc v7, works)
or
/usr/local/intel_cc_80/bin (icc v8, doesn't work)
to your PATH, make sure you have a new kernel compile directory
(e.g. MYKERNEL_icc) and run
CFLAGS="-O2 -ip" CC=icc make depend
CFLAGS="-O2 -ip" CC=icc make
in it.

Don't compile with -ipo, the build infrastructure uses ld directly to
link the kernel and the modules, but -ipo needs the link step to be
performed with Intel's linker.

Problems with icc v8:
- panic: npx0 cannot be emulated on an SMP system
- UP: first start of /bin/sh results in a FP exception

Parts of this commit contains suggestions or submissions from
Marius Strobl <marius@alchemy.franken.de>.

Reviewed by: silence on -arch
Submitted by: netchild


# 125119 27-Jan-2004 ru

Fixed bogus ${FOO:Mbar} tests where the actual intent is to check
if the result set is empty. While here, replaced non-bogus empty
string comparisons with equivalent empty() checks.


# 124637 17-Jan-2004 ru

Guess better the source for object files in case .depend file is
missing and there are multiple choices using multiple inference
(suffix transformation) rules.

This is known to fix compilation of s_log1p.o in lib/msun on i386,
as otherwise it attempted to use s_log1p.S as the source (which is
marked broken) instead of legal s_log1p.c which is in CFLAGS. The
normal case where .depend file exists is not affected.

Reviewed by: bde


# 119846 07-Sep-2003 ru

- No need to create libfoo.so -> libfoo.so.X symlinks in /lib,
as it was decided that our toolchain will revert to looking
for libraries in /usr/lib only.

- Make /usr/lib/libfoo.so -> /lib/libfoo.so.X symlinks absolute
so that they still work if /usr is symlinked.

- Remove stale /usr/lib/libfoo.so.X libraries during install.

Discussed with: gordon, obrien, peter


# 119730 04-Sep-2003 peter

Emergency backout of rev 1.152. This is a 100% guaranteed way to totally
hose your system. You end up with just about everything statically linked
(except for libpam.so), which then causes all the pam users to fail.
eg: login, sshd, su etc all stop working because dlopen no longer works
because there is no libc.so in memory anymore.

gcc passes -L/usr/lib to ld. The /usr/lib/libxxx.so symlink is *not* a
compatability link. It is actually the primary link. There should be no
symlinks in /lib at all. Only /lib/libXX.so.Y.

peter@daintree[9:27pm]/usr/bin-104> file yppasswd
yppasswd: setuid ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 5.1.1, dynamically linked (uses shared libs), stripped
peter@daintree[9:27pm]/usr/bin-105> ldd yppasswd
yppasswd:
libpam.so.2 => /usr/lib/libpam.so.2 (0x280d1000)
peter@daintree[9:28pm]/usr/bin-106>

Note no libc.so.5. Hence libpam.so.2 has unresolved dependencies.

I believe this is also the cause of the recent buildworld failures when
pam_krb5.so references -lcrypto stuff etc and when librpcsvc.so references
des_setparity() etc.

This change could not possibly have worked, unless there are other missing
changes to the gcc configuration. It won't work with ports versions of
gcc either.


# 119710 03-Sep-2003 ru

As ld(1) was taught to look into /lib, there's no longer a reason
for having compatibility .so symlinks.

Submitted by: obrien
Reviewed by: gordon


# 119607 31-Aug-2003 ru

Whitespace diff reduction between bsd.prog.mk and bsd.lib.mk outputs.


# 119056 17-Aug-2003 gordon

When creating .so symlinks, use SHLIBDIR instead of LIBDIR so symlinks
are created in the correct location. Always make them. For libraries
that live in /lib, this causes a /lib/libfoo.so and a compatibility
/usr/lib/libfoo.so to be created. We may want to drop the
/usr/lib/libfoo.so symlink at some future point.


# 119009 17-Aug-2003 gordon

Handle the case where SHLIBDIR != LIBDIR. When creating links, we
need relative pathing to work correctly. This is s necessary step
for putting libraries in /lib while the .so symlinks still live
in /usr/lib.

This should be a big NOOP in the case where SHLIBDIR == LIBDIR.


# 117173 02-Jul-2003 ru

Don't trust sys.mk,v 1.61 commit log, and make .asm alias for .S.


# 117159 02-Jul-2003 ru

Revert to using as(1) to compile plain assembler source files.
All .s files that need cpp(1) processing (see gcc(1) manpage's
DESCRIPTION section) have been repo-copied to .S files. This
is mostly to bring bsd.lib.mk in agreement with sys.mk.

Desired by: obrien


# 117122 01-Jul-2003 ru

There's no reason to keep separate AINC knob anymore.
The only real use of it (lib/libc/Makefile) has been
fixed, and if necessary, the contents of AINC should
be added to CFLAGS.

Explained by: bde


# 117084 30-Jun-2003 ru

Propagate the ${AINC} knob (assembler include) to sys.mk,
and remove the .S.o transformation rule from bsd.lib.mk.


# 117083 30-Jun-2003 ru

Removed suffix-transformation rules that are duplicates
(or are subsets) of the corresponding rules in sys.mk.


# 117080 30-Jun-2003 ru

The use of ld(1) to strip compiler local and non-global
symbols from object files has bitrotted over the last
thirteen years, and it now does more harm than good.

An attempt to work around the problems caused by using
ld(1) for stripping was to pass LDFLAGS to the ld(1)
command, but this was not right either as ${LDFLAGS}
should, by design, be used with cc(1) and not ld(1).

One of the proposed solutions was to use the objcopy(1)
utility to do the strip work, and the other would be to
use strip(1), but Bruce Evans suggested not stripping
any symbols at all. This works by leaving the grunt
work to the final strip(1) command (when installing the
binary).

Submitted by: bde


# 117034 29-Jun-2003 gordon

Add ${CRUNCH_CFLAGS} support for adding compile options to crunch
components. This is generally considered a non-optimal solution but
it gets the job done for the /rescue case.

Submitted by: Tim Kientzle <kientzle@acm.org>


# 116855 25-Jun-2003 peter

Be consistent about the use of ${LDFLAGS} for the internal rules. Some
were missing. This made it difficult to add backend ABI overrides when
building shared libs.


# 116144 10-Jun-2003 obrien

Remove NOSHLIBS, users can get by with NOPIC.

Desired by: ru


# 114135 27-Apr-2003 obrien

Add NOSHLIBS.
If one is using NOSHARED, why build the libs.


# 103713 20-Sep-2002 markm

Extend the lint handling a bit.

o Make it possible to prevent parts of the tree from being linted
(say) during a 'make world' by setting NOLINT in a leaf Makefile.

o Make "make lint" work (better) for executable programs.

o Clean up (nuke!) a syntax damaged pipeline.


# 103436 16-Sep-2002 peter

Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports. As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL. It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha


# 100872 29-Jul-2002 ru

Drop support for COPY, -c has been the default mode of install(1)
for a long time now.

Approved by: bde


# 100457 21-Jul-2002 ru

Moved `clean:' below, just before the inclusion of bsd.obj.mk,
so that CLEANFILES from bsd.man.mk and bsd.dep.mk are honored.


# 100375 19-Jul-2002 ru

Only define SHLIB_LINK if SHLIB_NAME matches the *.so.* pattern.
(Useful for RELENG_4's lib/libpam/modules.)


# 100332 18-Jul-2002 ru

Correction to the previous revision: define SHLIB_LINK if SHLIB_NAME
is defined (whether or not LIB is defined).


# 99362 03-Jul-2002 ru

Make it possible (again) to build and install shared library only.
One needs to define SHLIB_NAME for this to work.

Prodded by: mi


# 99343 03-Jul-2002 ru

Try really hard to fix parallel installs. Add a bunch of .ORDER
directives to ensure that all realinstall sub-tasks are executed
after beforeinstall, similarly ensure that all afterinstall sub-
tasks are executed after realinstall. Demonstration:

all: task1 task2
.ORDER: task1 task2

task2: task2_subtask
.ORDER: task1 task2_subtask

task1 task2 task2_subtask:
@sleep `jot -r 1 0 1.0`
@echo ${.TARGET}

Without the second .ORDER directive, task2_subtask can be run in
parallel with task1.

Spotted by: Andrea Campi <andrea@webcom.it>


# 99256 02-Jul-2002 ru

Handle installation of hard and symbolic links via a seperate .mk file.


# 98870 26-Jun-2002 jmallett

If CLEANFILES is nil or not defined, do not try to remove it. This happens
when SRCS is entirely files which produce only one compiled form, and when
NOMAN is defined. This does not seem to happen in STABLE.

Approved by: ru


# 97769 03-Jun-2002 ru

Reimplement FILES support using bsd.files.mk with the
same set of features as in recently added bsd.incs.mk
(FILESGROUPS, accessibility from both bsd.prog.mk and
bsd.lib.mk, de-pessimized typical installation path,
etc.) New standard targets: buildfiles, installfiles,
and files (buildfiles + installfiles).


# 97101 22-May-2002 ru

Revision 1.39 made filtering of CFLAGS unnecessary.


# 96668 15-May-2002 ru

Rename `includes' to `buildincludes'.
Rename `incsinstall' to `installincludes'.
Make `includes' a -j safe shortcut for `buildincludes' + `installincludes'.
`buildincludes' and `installincludes' are SUBDIR friendly, if run directly.


# 96529 13-May-2002 ru

CLEANFILES are too long for libc.


# 96512 13-May-2002 ru

Major cleanup of bsd.lib.mk.

Get rid of the INTERNALSTATICLIB knob and just use plain INTERNALLIB.
INTERNALLIB now means to build static library only and don't install
anything. Added a NOINSTALLLIB knob for libpam/modules. To not
build any library at all, just do not set LIB.


# 96462 12-May-2002 ru

Added new bsd.incs.mk which handles installing of header files
via INCS. Implemented INCSLINKS (equivalent to SYMLINKS) to
handle symlinking include files. Allow for multiple groups of
include files to be installed, with the powerful INCSGROUPS knob.
Documentation to follow.

Added standard `includes' and `incsinstall' targets, use them
in Makefile.inc1. Headers from the following makefiles were
not installed before (during `includes' in Makefile.inc1):

kerberos5/lib/libtelnet/Makefile
lib/libbz2/Makefile
lib/libdevinfo/Makefile
lib/libform/Makefile
lib/libisc/Makefile
lib/libmenu/Makefile
lib/libmilter/Makefile
lib/libpanel/Makefile

Replaced all `beforeinstall' targets for installing includes
with the INCS stuff.

Renamed INCDIR to INCSDIR, for consistency with FILES and SCRIPTS,
and for compatibility with NetBSD. Similarly for INCOWN, INCGRP,
and INCMODE.

Consistently use INCLUDEDIR instead of /usr/include.

gnu/lib/libstdc++/Makefile and gnu/lib/libsupc++/Makefile changes
were only lightly tested due to the missing contrib/libstdc++-v3.
I fully tested the pre-WIP_GCC31 version of this patch with the
contrib/libstdc++.295 stuff.

These changes have been tested on i386 with the -DNO_WERROR "make
world" and "make release".


# 96453 12-May-2002 obrien

Back out rev 1.118.


# 96343 10-May-2002 obrien

[Ab]use LDFLAGS rather than CFLAGS.
BDE tells me POSIX pretends `ld' as a directly callable entity does not exist.


# 96311 09-May-2002 obrien

Pass CFLAGS to {CC} when using it as an `ld' replacement.


# 96258 09-May-2002 obrien

Pay attention to LDFLAGS when linking.


# 96237 08-May-2002 obrien

Get rid of the INTERNALSTATICLIB knob and just use plain INTERNALLIB.
INTERNALLIB now implies NOPROFILE, NOMAN, and don't install anything.
Add a NOLIB knob.


# 96164 07-May-2002 ru

Added internal, non-recursive (SUBDIR) versions of the `all-man'
and `maninstall' targets. This fixes the issue where each subdir
was descended into twice during "make all", and also resurrects
the standardization of `maninstall'.

Urged by: bde


# 96162 07-May-2002 ru

Install the manpages before descending into SUBDIRs.


# 95368 24-Apr-2002 ru

Abuse bsd.obj.mk for defining default distribute target.


# 95327 23-Apr-2002 obrien

Change the name of the 'bin' distribution to 'base'.
This is done since it contains much more than /bin, and also gets in the
way when making a combined install+fixit CD.

OK'ed by: jkh


# 95306 23-Apr-2002 ru

Merge bsd.obj.mk's version of the _SUBDIR target with bsd.subdir.mk.

Ensure all standard targets honor SUBDIR. Now `make obj' descends into
SUBDIRs even if NOOBJ is set (some descendants may still need an object
directory, but we do not have such precedents). Now `make install' in
non-bsd.subdir.mk makefiles runs `afterinstall' target _after_ `install'
in SUBDIRs, like we do in bsd.subdir.mk. Nothing depended on the wrong
order anyway.

Fixed `distribute' targets (except for the bsd.subdir.mk version) so that
they do not depend on _SUBDIR; `distribute' calls `install' which already
depends on _SUBDIR.

De-standardize `maninstall', otherwise manpages would be installed twice.
(To be revised later.)


# 95251 22-Apr-2002 ru

Make .asm transformation rules synonyms to the .s rules.


# 95216 21-Apr-2002 markm

Style. Fix long lines and a <tab> indent that should be 4 spaces.


# 95114 20-Apr-2002 obrien

reorg a little.


# 95064 19-Apr-2002 obrien

Add .asm as an alias for .s. .asm is common in contribed sources.

Helps with: gcc31 build.


# 94940 17-Apr-2002 ru

Don't include bsd.own.mk from sys.mk, this makes it impossible
to use ``.if defined()'' inside bsd.own.mk to test for defines
in individual makefiles. For example, setting DEBUG_FLAGS in
Makefile didn't take the desired effect on the STRIP assignment.

Added bsd.init.mk (like in NetBSD) that handles the inclusion
of ../Makefile.inc and bsd.own.mk from all bsd.*.mk files that
"build something".

Back out bsd.own.mk,v 1.15: moved OBJFORMAT initialization back
to sys.mk (several source tree makefiles want to check it early)
and removed MACHINE_ARCH initialization (it's hard to see from
looking at the commitlogs what the problem was at the time, but
now it serves no purpose).

Prohibit the direct inclusion of bsd.man.mk and bsd.libnames.mk.

Protect bsd.obj.mk from repetitive inclusion. Prohibiting the
direct inclusion of bsd.obj.mk might be a good idea too.


# 94113 07-Apr-2002 ru

Fixed the nasty bug where .depend file that exists somewhere in
the .PATH (but not in the ${.OBJDIR}) would result in a leak of
the ${OBJS}: ${SRCS:M*.h} dependency hint.

Spotted by: fixing the broken gnu/usr.bin/cc/cc1obj build
MFC after: 1 day


# 92980 22-Mar-2002 des

Install static and profiled libraries with -C.


# 92553 18-Mar-2002 ru

lint the previous lint commit.

Reviewed by: markm


# 92491 17-Mar-2002 markm

Allow "make lint" to mostly work. Our sources are very unclean WRT
lint, so this is turned off by default. Setting WANT_LINT will turn
on generation of lint libraries for /usr/libdata/lint/*.ln.

Reviewd by: silence in -audit.


# 92129 11-Mar-2002 obrien

Consistently use $PICFLAG.


# 92128 11-Mar-2002 obrien

Spell pic "PIC" for sparc64.


# 91011 21-Feb-2002 ru

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


# 87307 03-Dec-2001 bde

Unbreak "make lint" for programs and "make llib-l${LIB}.ln" for
libraries a little by not passing all of ${CFLAGS} to lint. Pass
only options matching -[DIU]*. The important -nostdinc option can't
be passed like I first thought because lint misinterprets as
"-n -o stdinc". The unimportant -B* option can't be passed because
lint doesn't support it. Otherwise, we pass the same options as
to mkdep, exept for a bug in the latter: -U* is not passed. All
this depends on option args not being separated from option flags
by a space.


# 84136 29-Sep-2001 ru

Fix cross-building, etc:

1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!

2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.

We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.

Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.

That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.

3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.

There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:

1) They use (and depend on) the host environment.

2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.

In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.

4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.

5. Fixed "includes" to install secure/lib/libtelnet headers if
required.

Reviewed by: bde


# 83762 21-Sep-2001 ru

When bootstrapping (build-tools and cross-tools), avoid
including the ${WORLDTMP}/usr/include headers that may
not match the installed host libraries.

This should fix the 20010919 UPDATING entry.


# 76862 19-May-2001 kris

(Previous commit was made prematurely before I could finish composing
the log message)

Bring in the WARNS directive from NetBSD, localized in a new bsd.sys.mk
to avoid polluting sys.mk. This directive controls the addition of
compiler warning flags to CFLAGS in a relatively compiler-neutral manner.

The idea is that WARNS can be set in Makefile.inc or in individual
Makefiles as they become clean, to prevent the introduction of new
warnings in the code (-Werror is added by default when WARNS > 0).

This behaviour can be overridden with the following two knobs:
NO_WARNS disables the checking of WARNS completely
NO_WERROR disables the addition of -Werror to the flags.

Additionally, setting WFORMAT to 1 (in makefiles) and/or defining
FORMAT_AUDIT (by the user) will enable increased checking of format
string arguments.

Obtained from: NetBSD
Reviewed by: peter


# 76861 19-May-2001 kris

Bring in the WARNS directive from NetBSD, localized in a new bsd.sys.mk
to avoid polluting sys.mk. This directive controls the addition of
compiler warning flags to CFLAGS in a relatively compiler-neutral manner.

The idea is that WARNS can be set in Makefile.inc or in individual
Makefiles as they become clean, to prevent the introduction of new
warnings in the code. -Werror is added by default


# 74842 27-Mar-2001 ru

Make it possible to build manpages for the entire source tree.


# 74805 26-Mar-2001 ru

Do not depend on ``all-man'' if -DNOMAN.


# 66534 02-Oct-2000 peter

Change "building the standard ${LIB} library" to "building the static
${LIB} library". "standard" tends to imply the one that is normally
used... but by default it is not the case - the .so would be the
"standard" library. Therefore, change this to 'static'. Another option
might be "conventional ${LIB} library".


# 61423 08-Jun-2000 bde

When dubiously reprogramming .SUFFIXES, don't screw up the order of .S
relative to .s. This fixes wrong sources being preferred after
"gcc -save-temps" creates .s files from .S files.


# 56971 03-Feb-2000 ru

Unbroke PRECIOUSLIB feature (broken in rev 1.88).

Original version submitted by: Jim Bloom <bloom@acm.org>
Reviewed by: bde
Approved by: jkh


# 55954 14-Jan-2000 rgrimes

Introduce the new mk internal target _includeinstall and add the
controlling knob defaults INCOWN, INCGRP, INCMODE, and INCDIR.

Reviewed by: marcel, and make world


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 49328 31-Jul-1999 hoek

Add variable INSTALLFLAGS_EDIT used to remove arbitrary INSTALLFLAGS.

Specifically intended for removing -fschg ("INSTALLFLAGS_EDIT=:S/schg/uchg/")
this makes the NOFSCHG flag redundant. NOFSCHG will still be honoured by
bsd.lib.mk but is valid for buildworld only. NOFSCHG is still implemented in
the old way (ie. _not_ ".if NOFSCHG then { INSTALLFLAGS_EDIT+=:S/schg/,/ }"
to emphasize the fact that NOFSCHG is only supported in a limited
fashion and for buildworld.

The interface and implementation are such that future use of flags such
as sappnd can also be easily removed or altered (perhaps to uappnd).

This commit brought to you by the letters B, D, and E, and the numbers six,
one, thirteen, and three.


# 48204 24-Jun-1999 jmg

add support to buildworld as a normal user:
-DNOFSCHG disables installation of libs with flag schg
GAMEGRP change the group with which games are installed

also organize the binary section into alphebetical order some what..


# 44946 23-Mar-1999 bde

Removed all traces of LN_FLAGS. It was only used to produce a link
/usr/sbin/sysctl -> ${DESTDIR}/sbin/sysctl in some versions of 2.2,
and this link was broken if DESTDIR was set.

Added a SYMLINKS macro. This works the same as LINKS, except it
creates symlinks and the linked-to pathname may be relative. This
is more flexible than LN_FLAGS, since it supports installing
symlinks independently of hard links.

Use `ln -f[s] ...' instead of `rm -f ...; ln [-s] ...' for LINKS and
SYMLINKS. This is equivalent if the target is neither a directory nor
a symlink to a directory.

PR: 8279


# 43055 22-Jan-1999 jdp

Introduce a new variable NEED_LIBNAMES. If it is defined,
<bsd.libnames.mk> is included regardless of the object file format.

This is needed to fix the a.out PAM breakage that manifests itself
when trying to build login.


# 42915 20-Jan-1999 jdp

Add some capabilities to <bsd.lib.mk> so that it can be used for
building dlopen-able modules, and add features needed to build a
static PAM library. I think I cleaned it up some, too, but beauty
is in the eye of the beholder.

You can now build a shared library without version numbers, by
defining SHLIB_NAME to something like "pam_unix.so". If SHLIB_MAJOR
and/or SHLIB_MINOR are set, SHLIB_NAME gets the usual default value,
but it can be overridden if desired. If none of these symbols are
set, no shared library is built.

SHLIB_LINK controls the name of the symbolic link that points to
the library. If it is unset, no link is made. In the usual case,
it gets the right default: e.g., "libc.so" for ELF, nothing for
a.out. This can be overridden.

STATICOBJS can be set to a list of extra object files that should
be added to the static library but not to the shared library.
These objects are added to the profiled library too.

These changes should make it easy to use <bsd.lib.mk> for building
things such as PAM modules and dynamic linkers, for which <bsd.prog.mk>
has been abused until now.


# 42450 09-Jan-1999 jdp

Switch to using ".So" as the extension for PIC object files rather
than ".so". The old extension conflicted with well-established
naming conventions for dynamically loadable modules.

The "clean" targets continue to remove ".so" files too, to deal with
old systems.


# 41562 06-Dec-1998 bde

Removed bitrotted code for setting OBJFORMAT.


# 41218 17-Nov-1998 jdp

For ELF, create a symbolic link libfoo.so -> libfoo.so.NNN in the
object tree too. This makes it possible to link against a shared
library that hasn't been installed yet.


# 40526 19-Oct-1998 imp

Default to aout only on i386. Before we defaulted to elf only on
Alpha. This is a minor, but important distinction. Should be a no-op
to the install base. If OBJFORMAT is set elsewhere, things work
exactly as they did before.


# 39525 20-Sep-1998 obrien

Change lib specification in `clean' target to match ELF shared libs too.

Reported by: Kris Kennaway <kkennawa@physics.adelaide.edu.au>


# 38655 30-Aug-1998 jb

BINFORMAT -> OBJFORMAT ready for E-day.


# 38187 08-Aug-1998 peter

Clean up all temporaries that we can generate.


# 38186 08-Aug-1998 peter

Use more standard ld commands when stripping symbols out; ld -O is a
freebsd-aout extension. The binutils ld doesn't understand it.
Essentially this is backing out rev 1.33 for elf and other toolchain
support..


# 38183 08-Aug-1998 peter

Make ../Makefile.inc handling more consistant to prevent multiple includes
when certain .mk files include other .mk files. This will remove the
need for multiple include protection in some other makefiles around the
tree (and helps some elf conditionals).


# 36673 05-Jun-1998 dt

Recognize ".cpp" as a C++ suffix.

PR: 3476


# 36640 04-Jun-1998 peter

Hard coded /usr/lib reference


# 36055 15-May-1998 bde

Oops, forgot references in previous commit.

Submitted by: Brian Cully <shmit@erols.com>
PR: 6178


# 36054 15-May-1998 bde

Support Objective C almost as well as C++.

Notes:
- We no longer use -fgnu-runtime in bsd.lib.mk, since it is the default
and bsd.lib.mk is the wrong place to override it.
- Gnu C doesn't have a special compiler driver for Objective C like it
does for C++. The defaults are suitable for Gnu C. Use `OBJCLIBS='
in /etc/make.conf for POC.


# 34528 12-Mar-1998 eivind

Introduce the 'regress' target.

Silently approved by: -hackers, -current


# 34179 07-Mar-1998 bde

Fixed generation of extra dependencies:
- the two `_EXTRADEPEND::' targets potentially clobbered each other for
`make -jN'. In practice, the output for the second target sometimes
disappeared.
- bogus dependencies were generated for static libraries.


# 34092 06-Mar-1998 bde

If .depend doesn exist, then pretend that all objects depend on all
headers in ${SRCS}, as in bsd.lmod.mk and bsd.prog.mk. This helps
`make [-j]' work when .depend doesn't exist. Even plain `make'
sometimes only worked because of magic ordering in ${SRCS}.


# 33688 20-Feb-1998 bde

Removed default tags target. It was identical to the central one in
bsd.dep.mk.


# 32495 13-Jan-1998 jb

Choose the default binary format based on machine type.
Alpha is elf, not aout.


# 31813 17-Dec-1997 bde

Oops, rm -f can't handle empty lists.


# 31809 17-Dec-1997 bde

Normally don't include <bsd.libnames.mk>. Include it in the !aout case
(as in bsd.prog.mk). Include it if `checkdpadd' is being made, so that
it can be checked until it goes away.

Don't clean files that we don't create.

Fixed style of empty test.


# 29141 05-Sep-1997 peter

Restore the BINFORMAT?= in sys.mk, or it's painfully difficult to use
.if in Makefiles. bsd.prog.mk and bsd.lib.mk do not depend on it however.

Allow overriding of the -soname arg when building the lib*crypt.so* libs
since libdescrypt.so and libscrupt.so both need a -soname of libcrypt.so
so that the symlink is obeyed at runtime rather than at compile time.


# 29129 05-Sep-1997 peter

Change the BINFORMAT definitions so that they do not depend on sys.mk,
since 2.1.x make(1) apparently does not have the -m switch to set both
the the bsd.*.mk and sys.mk location, and this breaks 'make world' from a
2.1.x system.


# 28945 30-Aug-1997 peter

A first cut at some rules for building elf shared libs. Of particular
note, using "-Wl,-f" to generate a library objects list doesn't work
anymore since the hack to ld hasn't been incorporated into binutils-2.8.
(and the -f switch is used for something else already)

This is disabled by default, don't panic! :-)


# 27910 05-Aug-1997 asami

Merge buildworld/installworld patch to Makefile from RELENG_2_2. Patch
a couple *.mk files to enable -current world building on really old
machines (e.g., 2.1.5).

Reviewed by: too many many people to list here, special thanks to bde


# 26760 21-Jun-1997 jkh

Change the distribute targets so that a given item in our source tree
can place itself into n distributions, where n >= 1.


# 26715 18-Jun-1997 asami

Add `B' to list of flags to pass through from C*FLAGS when using mkdep
(bsd.dep.mk) and compiling assembly language sources (bsd.lib.mk).
This doesn't change anything for our current source tree, but if you
want to use the -B switch in C*FLAGS to specify the location of
compiler subprograms, now you can do it.

Reviewed by: bde (implicitly)


# 26073 23-May-1997 dfr

Add "-assert pure-text" to the link line. The warnings about RRS
relocations in text sections are now dependant on this flag.


# 26051 23-May-1997 asami

Change CXXINCLUDES to use "g++" explicitly. CXXINCLUDES was defined
with ${CXX} at the end; the only problem was, the directory name is
"g++" and ${CXX} is defined as "c++" in sys.mk.


# 25468 04-May-1997 jdp

Use "gcc -shared" instead of "ld -Bshareable" for building shared
libraries. Remove the now-unneeded CPLUSPLUSLIB hack. I will also
remove the CPLUSPLUSLIB definitions from the Makefiles that use it,
after the dust settles.

Use gcc's LIBRARY_PATH environment variable to handle DESTDIR,
instead of -L flags in LDDESTDIR. LIBRARY_PATH is documented in
the gcc info pages. It is better than using -L flags, because it
modifies the search for start-up files as well as for libraries.
A new variable LDDESTDIRENV is used to contain the normally-empty
LIBRARY_PATH environment setting.

LDDESTDIR is no longer set in <bsd.lib.mk>. It is still honored for
the time being, because a couple of userland Makefiles still (wrongly)
set it. These should be fixed, and LDDESTDIR should vanish.

Removed the commented-out "LDDESTDIR+=-nostdlib", because "gcc -shared"
doesn't link in any standard libraries anyway.

Removed the ".if defined(LDADD)" around the _EXTRADEPEND target for
shared libraries. This target is always necessary now, because
c++rt0.o is linked into every shared library.

Don't merge this into -2.2 without first merging the support for
"gcc -shared".


# 25104 23-Apr-1997 bde

Fixed missing strip step in .S.o and .S.po rules.

Fixed back to front -X and -x strip flags in .m.o and .m.po rules.
Fixed disordered .m.o and .m.po rules. What is .m?

Stripping probably should be removed. It makes problems in library
functions hard to debug...


# 24861 13-Apr-1997 jkh

Support GLOBAL style tags.


# 24761 09-Apr-1997 jdp

Use "-pg" instead of "-p" for generating profiled object files.
The two options differ only when linking, but "-p" is incorrect
because it is associated with the old-style "prof" command, which we
do not support.


# 24750 09-Apr-1997 bde

Use `ld -f' (actually `cc -Wl,-f') at `make depend' time to generate
almost perfect dependencies on crt0's and libraries. DPADD and
bsd.libnames.mk should go away soon. Use a new _EXTRADEPEND target
to implement this and to avoid editing of .depend when .depend isn;t
being rebuilt. The afterdepend target doesn't seem to be good for
anything and is now unused.

Fixed LDDESTDIR for the DESTDIR case when ${SHLIBDIR} != /usr/lib.

Added commented-out -nostdlib to LDDESTDIR for the DESTDIR case.
The wrong libraries may be used without this; however it breaks
linkage to crt0 and libc.


# 22988 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 22689 13-Feb-1997 jmz

Fix a typo in the .s.o rule: asssembler -> assembler


# 22011 25-Jan-1997 pst

Don't use /tmp for afterdepend cleanup target


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 18529 28-Sep-1996 bde

Fixed dependencies on libraries which I broke in rev.1.39 of
bsd.prog.mk and didn't actually fix in rev.1.43 of bsd.lib.mk.
The library names must be defined before they are used in
dependencies.


# 18374 19-Sep-1996 peter

add -fgnu-runtime to the .m.o and .m.po rules, since we (will) have
the gnu libobjc rather than the NeXT one. I do not understand objc
so I don't know the implications of this, but the gcc-2.7.2 libobjc is
built with this.


# 18340 18-Sep-1996 swallace

.TARGETOBJDIR has been removed from make and CANONICALOBJDIR set in
bsd.obj.mk. Also, a make target called objwarn checks to see
if ${.OBJDIR} != ${.CURDIR} and ${.OBJDIR} != ${CANONICALOBJDIR}
and outputs a warning. (No warning for the latter if MAKEOBJDIR or MAKEOBJDIRP
REFIX is set). objwarn is called from all targets in bsd.prog.mk, bsd.kmod.mk,
and bsd.lib.mk.

Reviewed by: bde


# 18052 05-Sep-1996 bde

Moved definitions of library names from bsd.prog.mk to a new central
file bsd.libnames.mk and include this file where necessary. This fixes
null library names in ${DPADD}'s in library makefiles.


# 17819 25-Aug-1996 jkh

Back out the recent DEPEND changes - as Bruce points out, it's bogus.

I'll leave any future Makefile hackery to him since he's clearly thought
about this a great deal more than I have.


# 17800 23-Aug-1996 jkh

Make it possible to turn the depend pass off entirely with a NO_DEPEND
variable.
Requested-By: wollman


# 17793 23-Aug-1996 jkh

Add depend to all target so that it's explicit. It's only done once,
even if make all is run multiple times, since the depend rule looks for
an existing .depend file.


# 17510 11-Aug-1996 peter

Replace some leaky ``cpp | as'' pipelines with ``cc -x <lang>'' commands
to do the preprocessing and assembling.

(I've been running this for months, and had forgotten about it)


# 17400 03-Aug-1996 jkh

Use tsort -q


# 16826 29-Jun-1996 phk

Make cleandirs more safe
Suggested by: bde


# 16663 24-Jun-1996 jkh

Bring in my changes for removing the pestilent obj links (unless you
really want them) from /usr/src. This is the final version of the
patches, incorporating the feedback I've received from -current.


# 16437 17-Jun-1996 phk

Add support for ${CLEANDIRS} that will be rm -rf'ed during clean & cleandir.


# 16097 03-Jun-1996 jfieber

Fix incorrect handling of .cxx files in default rules.


# 15959 28-May-1996 phk

Avoid a ton of "mv" when making libs by using -O to ld.
Make lex rules reentrant.


# 15697 09-May-1996 phk

Make some rules reentrant, and mark the onces that cannot be.


# 15336 21-Apr-1996 jdp

Add "-x" to the linker command for building shared libraries. This
eliminates many local symbols that could not be removed by the "ld -r -x"
steps on the individual object files. It makes shared libraries
substantially smaller -- almost 11%, in the case of libc.so.3.0.


# 14779 23-Mar-1996 wosch

delete LIBDIR?= LINTLIBDIR?= LIBGRP?= LIBOWN?= LIBMODE?= SHLIBDIR?=
BINGRP?= BINOWN?= BINMODE?=


# 13535 21-Jan-1996 jdp

Back out my previous change, which caused c++rt0.o to be linked into
every shared library, until I can diagnose the problems it is causing
for certain programs such as awk and groff.


# 13473 16-Jan-1996 jdp

Always link /usr/lib/c++rt0.o into a shared library. CPLUSPLUSLIB is no
longer necessary, and can be removed from Makefiles.


# 11344 09-Oct-1995 bde

Don't run `ranlib -t' at install time. Our ld has never looked at the
timestamp on __.SYMDEF like ranlib.1 says it does, so changing the
timestamp has no benefits, and changing it breaks smart installs.


# 11136 02-Oct-1995 wollman

Compress manual pages (if desired) in the obj directory rather
than in the installation destination. Should make release-building
substantially faster. The msun Makefile changes simple adapt to the new
scheme.


# 9870 02-Aug-1995 dg

Use lorder/tsort for shared libraries. It might help group things better.
Suggested by Garrett Wollman.


# 7444 28-Mar-1995 nate

Do what should have been done in v1.14

*Really* strip out unused local symbols from shared objects.

This was a typo on my part caused by an assumption that the profiled
libraries stripped symbols that same way as the non-profiled libraries.

Cut-n-Paste strikes again.

Obtained from: NetBSD


# 6716 25-Feb-1995 phk

"make distribute" have changed, beware if you use it.


# 6252 08-Feb-1995 bde

More complete implementation of SUBDIR for programs, libraries and kmods.
`depend' wasn't supported. This seems to have only broken `make depend'
in gnu/usr.bin/ld.

bsd.prog.mk:
Build the man pages in ${MANDEPEND} at build time.


# 6032 30-Jan-1995 jkh

Add LN_FLAGS to all the places it makes sense.


# 5621 14-Jan-1995 wollman

Slightly more complete implementation of SUBDIR for libraries.


# 5620 14-Jan-1995 wollman

Add SUBDIR facility to bsd.lib.mk like in bsd.prog.mk.


# 5585 14-Jan-1995 jkh

Change DISTRIBUTION names. Also make bsd.doc.mk go to doc distribution,
not bin. Hmmm.


# 5386 04-Jan-1995 ache

Remove INSTALL, now into sys.mk


# 5253 27-Dec-1994 ache

Remove -T from ar, nm fixed now


# 5224 24-Dec-1994 ache

Add T option back to ar until nm will be fixed. Sorry, nate.


# 5212 23-Dec-1994 nate

Strip out unused local symbols from shared objects, and no longer
truncate archive members to 15 characters since it's no longer
necessary.


# 4453 14-Nov-1994 bde

This change was actually made in the previous revision:

Define SHLIBDIR?= ${LIBDIR} and install shared libraries in
${DESTDIR}${SHLIBDIR} instead of in ${DESTDIR}${LIBDIR}.
SHLIBDIR may be defined in /etc/make.conf to override the
default of /usr/lib (I use /lib). Other changes are required
for non-default shared library directories to actually work
(ld* and crtso have too many hard-coded paths).

Bruce


# 4450 14-Nov-1994 bde

Define `RANTOUCH?= ${RANLIB} -t' and use it instead of ${RANLIB} -t.

RANTOUCH may be defined in /etc/make.conf as
`${ECHO} skipping ${RANLIB} -t' to help stop `make install' from
changing the timestamps on unchanged libraries, thus making the
uninstalled binaries appear to be out of date... Other changes
are required to stop install from clobbering the timestamps.


# 4442 13-Nov-1994 phk

Add a new "distribute" target. This is a variant of install, which will
put the stuff into the right "distribution". As default things end up
in "bindist".

Normal (ie: most) makefiles know naught of this.

More commits will follow, which will direct various parts of the tree
into the distribution we want them in.

Some of the grief of being release-engineer is supposed to go away with this.


# 3859 25-Oct-1994 bde

Some profiled/shared objects were being built despite NOPROFILE/NOPIC
being set.


# 2870 18-Sep-1994 wollman

Emendation to previous commit: only create static INTERNALLIBs if
INTERNALSTATICLIB is also set.


# 2868 18-Sep-1994 wollman

It turns out that occasionally you want both shared and static versions
of INTERNALLIBs, so generate both.


# 2827 16-Sep-1994 jkh

Add support for DEBUG_FLAGS. If you say something like:

make DEBUG_FLAGS=-g2

You can compile something for debugging at debugging level 2.
It will also take care not to strip the resulting executable(s).


# 2353 28-Aug-1994 bde

Use ${ECHO} instead of `echo' so that `make -s' is fairly quiet.


# 2298 26-Aug-1994 wollman

Add support for two modifier variables which will be useful soon:

PRECIOUSLIB causes the shared library to be installed with the system
immutable flag (schg) set. (You can add other flags for shared-library
installation by modifying SHLINSTALLFLAGS.)

INTERNALLIB disables the generation of non-shared versions of the library.
This may be of use for programs like Taylor UUCP and GCC which have large
internal libraries shared among a number of programs.


# 1996 10-Aug-1994 wollman

Make the install targets obey the INSTALLFLAGS requests in the new
Makefiles.

DANGER WILL ROBINSON!

This will cause repeat installs of certain programs, such as `init' and
`rcp', to fail unless one of the two conditions is met:

1) You are in single-user mode.
2) Your security level is set to 0 or -1.

If you have compiled a kernel from the latest sources, your kernel
security level is set to -1 by default, which will keep `init' from
fiddling with it. You can increase it, but not decrease it, from the
command line with the command `sysctl -w kern.securelevel=<new value>'.
I believe that -1 is the most appropriate value to use while we are still
developing the code, although when we ship it should be changed back to 0.

See init(8) for more information.


# 1953 08-Aug-1994 wollman

Don't pass ${LDADD} to ${AR}. Use ${ARADD} for that.


# 1844 04-Aug-1994 wollman

Spplat our 1.1.5 `mk' ifiles over the top of the 4.4 ones. So far
as I can tell, this is ts the right thing to do.


# 1639 30-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1638,
which included commits to RCS files with non-trunk default branches.


# 1638 30-May-1994 rgrimes

BSD 4.4 Lite Share Sources