History log of /freebsd-10.1-release/share/mk/bsd.prog.mk
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

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

# 271274 08-Sep-2014 emaste

MFC r270976: Allow standalone debug for non-default ${PROG} targets

This allows WITH_DEBUG_FILES to produce standalone debug for the ELF
runtime linker.

We previously disabled standalone debug files for bsd.prog.mk consumers
that included a non-default ${PROG} target, but this is not required.

Consumers that do not support standalone debug are still handled by
disabling it for statically linked binaries, and for those that specify
a non-default binary format.

Sponsored by: DARPA, AFRL
Approved by: re


# 269946 13-Aug-2014 rpaulo

MFC r268300 r268541 r268544 r268565 r269775 r269838 r269839 r269840
r269842 r269844 r269899:

BSD make support for generating and compiling USDT DTrace probes.


# 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


# 255431 09-Sep-2013 des

Emit the correct standard library dependency line for C++ programs. In
the CLANG_IS_CC case, the default is now libc++. Only use libstdc++ if
!CLANG_IS_CC or it was explicitly requested in CXXFLAGS.

Submitted by: theraven
Approved by: re (gjb)


# 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)


# 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.


# 248753 26-Mar-2013 emaste

Always define and use PROGNAME

This avoids having separate cases in the install rule for PROGNAME set and
not set. This is a minor cleanup in advance of further support for
standalone debug files.


# 248742 26-Mar-2013 markj

Make sure to set OBJS consistently in the cases where SRCS is and isn't
already defined. Setting it with "+=" makes it possible for other make
scripts (e.g. bsd.dtrace.mk) to include additional object files in the
linker arguments.

Approved by: emaste (co-mentor)


# 245515 16-Jan-2013 brooks

Remove support for installing 1aout section manpages.


# 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)


# 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


# 239686 25-Aug-2012 dim

When using -stdlib=libc++, add the correct dependency to .depend in
bsd.prog.mk.

Submitted by: Yamaya Takashi <yamayan@kbh.biglobe.ne.jp>
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.


# 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@


# 212426 10-Sep-2010 rpaulo

Fix typo in previous commit.


# 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


# 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@


# 204027 18-Feb-2010 marcel

Also add DEBUG_FLAGS to CXXFLAGS if defined.


# 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.


# 172401 01-Oct-2007 ru

Fixed "make checkdpadd" (missing library dependencies).

Approved by: re (kensmith)


# 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?


# 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)


# 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


# 144893 11-Apr-2005 harti

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


# 140838 25-Jan-2005 jmallett

Linkage with -lobjc requires -lpthread nowadays.


# 139112 21-Dec-2004 ru

NOSHARED -> NO_SHARED


# 139111 21-Dec-2004 ru

NOFSCHG -> NO_FSCHG


# 139103 21-Dec-2004 ru

Start the dreaded NOFOO -> NO_FOO conversion.

OK'ed by: core


# 139068 20-Dec-2004 paul

If PORTNAME is set in a system Makefile then hook into the ports
mechanisms to allow a package to be created. This paves the way
for packaging the main tree.


# 137614 12-Nov-2004 ru

Install precious programs with -S.


# 137164 03-Nov-2004 ru

Introduce the PRECIOUSPROG knob in bsd.prog.mk, similar
to PRECIOUSLIB from bsd.lib.mk. The side effect of this
is making installing the world under jail(8) possible by
using another knob, NOFSCHG.

Reviewed by: oliver


# 133653 13-Aug-2004 ru

Removed COPTS support from kmod.mk and kern.pre.mk.
COPTS support in bsd.prog.mk is preserved but discouraged.


# 125620 09-Feb-2004 ru

Two changes to aid in cleaning up sys/boot/ makefiles:

- Don't put libc.a as a dependency if program is linked with -nostdlib.

- Added INTERNALPROG (by analogy to INTERNALLIB) for programs which are
built only for its side effect and shold not be installed.


# 125474 05-Feb-2004 ru

make(1) can now handle spaces surrounding parenthesis correctly.


# 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.


# 119607 31-Aug-2003 ru

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


# 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>


# 114580 03-May-2003 markm

Remove some games/ cruft that is no longer of relevance.


# 105327 17-Oct-2002 ru

Added the new variable CTAGS which, if set to "ctags", reverts
to creating the tags file using ctags(1). Defaults to "gtags".
Made GTAGSFLAGS and HTAGSFLAGS overrideable, added CTAGSFLAGS.
Folded bsd.prog.mk version of `tags' into bsd.dep.mk.

PR: bin/42852


# 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


# 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>


# 99257 02-Jul-2002 ru

Reimplemented bsd.nls.mk using bsd.files.mk and bsd.links.mk.

Provided the (previously missing) dependency on source files
for intermediate .msg files.

Provided the default for NLSSRCDIR (defaults to .CURDIR).

Slightly changed the API: NLS should now list plain locale
names, without the .msg suffix.

When included from bsd.prog.mk, NLSNAME defaults to PROG.


# 99256 02-Jul-2002 ru

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


# 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).


# 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.


# 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".


# 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


# 96163 07-May-2002 ru

Install PROG before SCRIPTS and FILES, but make sure
LINKS are still processed last. This backs out part
of the backout in previous revision.

Install the manpages before descending into SUBDIRs.


# 95734 29-Apr-2002 ru

Splitting "realinstall" into parts was a (failed) part of the work
in progress, and should not have been committed in revision 1.114.
This broke gnu/usr.bin/binutils/strip and usr.bin/strip makefiles;
they were now attempting to install and strip "strip" from objdir.

Pointed out by: bde

This has nothing to do with PR misc/37516.


# 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.)


# 95064 19-Apr-2002 obrien

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

Helps with: gcc31 build.


# 94954 17-Apr-2002 ru

${INSTALLFLAGS} aren't suitable for installing ${SCRIPTS} and ${FILES}.


# 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.


# 94518 12-Apr-2002 ru

Back out second part of the previous change. While this was
indeed a good change, I shouldn't have made it after testing
with the -DNOCLEAN buildworld. There are far too many users
of this misfeature under sys/boot/. I will reapply the change
after I fix these.

This change has been tested with the clean buildworld.


# 94501 12-Apr-2002 ru

Fixed the fatal breakage I introduced in the last commit.

Make the defined(SRCS) case similar to the !defined(SRCS)
case - only define ${PROG}: ${OBJS} if the ${PROG} target
does not exist. This has only one precedence in the entire
source tree, usr.bin/doscmd, and its Makefile is horribly
broken. I will temporarily unconnect it from build until
I'm working on the fix.


# 94497 12-Apr-2002 ru

Don't add -lstdc++ to LDADD, just let c++(1) link C++ programs.
Record the dependency on ${LIBSTDCPLUSPLUS} similar to ${LIBC}.

Suggested by: imp, obrien, peter


# 94424 11-Apr-2002 ru

Implement PROG_CXX for <bsd.prog.mk>.

Obtained from: NetBSD (with some mods)
Reviewed by: peter


# 94410 11-Apr-2002 ru

Really finish the removal of ${LDDESTDIR} in bsd.lib.mk,v 1.55.
bsd.lib.mk,v 1.101 only did that partly.


# 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


# 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


# 88055 17-Dec-2001 ru

FILES support for bsd.prog.mk. See bsd.README for details.

Stolen from: NetBSD


# 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.


# 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.


# 78203 14-Jun-2001 ru

Style nits:

GBINDIR -> ORIGBINDIR
GBINGRP -> ORIGBINGRP

Submitted by: bde


# 78174 13-Jun-2001 ru

Games ownership cleanup.

Urged by: bde


# 77527 31-May-2001 ru

Change the ownership of the symbolic link for hidden game
rather than /usr/games/dm wrapper.

Spotted by: bde
Reviewed by: bde


# 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


# 75713 19-Apr-2001 asmodai

Who ever came up with the ${CFLAGS} need to be passed to lint?

We can now run make lint on src/bin at least.

I am sure Mark Murray has way more interesting fixes up his sleeve.


# 75284 07-Apr-2001 ru

Introduce SCRIPTS for bsd.prog.mk. See bsd.README for details.
Idea stolen from NetBSD.

Reviewed by: bde


# 75083 02-Apr-2001 ru

Introduce ${PROGNAME}, the name that the program will be installed as,
if different from ${PROG}. (The name PROGNAME was stolen from NetBSD.)

Reviewed by: bde


# 74941 28-Mar-2001 ru

Define MAN to ${PROG}.1 if no manpages were specified, but still
provide MAN1 for backwards compatibility. Third party software
may still have dependancy lines of this form:

${MAN1}: foo.man


# 74842 27-Mar-2001 ru

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


# 74817 26-Mar-2001 ru

Backout botched attempt to introduce MANSECT feature; it
doesn't work in "developer" mode (single module checkout).


# 74806 26-Mar-2001 ru

Removed _MANPAGES, MANDEPEND and MANSRC.

Added MAN which will eventually replace MAN[0-9] and MAN1aout.
For now, the old syntax is still supported.

Reviewed by: bde


# 74527 20-Mar-2001 ru

If the MANSECT variable is specified, it will override the default
manual section. If, for example, MANSECT is set to 8, the default
MAN1=${PROG}.1 feature of bsd.prog.mk becomes MAN8=${PROG}.8.
Useful for games, libexec, sbin and usr.sbin subtrees.

Reviewed by: bde


# 58493 23-Mar-2000 ru

Check for MAN9 for consistency.


# 55670 09-Jan-2000 bde

Removed NOEXTRADEPEND hack. This was only for an old version of makeworld.


# 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.


# 46541 06-May-1999 bde

"Fixed" missing dependency of ${PROG} on ${LIBC} in the elf case.


# 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.


# 41562 06-Dec-1998 bde

Removed bitrotted code for setting OBJFORMAT.


# 40505 18-Oct-1998 obrien

Allow ``make BINDIR=/foo/games'' to work.


# 38898 07-Sep-1998 jb

Add a man section 1aout for the legacy man files to avoid them being
installed over the ones from binutils.


# 38655 30-Aug-1998 jb

BINFORMAT -> OBJFORMAT ready for E-day.


# 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


# 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.


# 35838 08-May-1998 bde

Moved lex and yacc source handling from bsd.prog.mk to bsd.dep.mk
so that it applies to libraries (and lkms) as well as programs.


# 35780 06-May-1998 bde

Regress to generating foo.c from foo.y via y.tab.c for crufty applications
that want a y.tab.h file. This want must be specified by putting y.tab.h
in SRCS (and defaulting to or putting -d in YFLAGS). This only works if
there is only one yacc parser, of course. One improvement: copy y.tab.c
to foo.c instead of renaming it, so that `#line...y.tab.c' statements in
it refer to an existing file.

Regress to not generating explicit rules for .l and .y sources containing
slashes. This case is unusual and hard to handle properly.

Don't generate an unused dependency when -d is not in YFLAGS.


# 35731 05-May-1998 bde

Oops, the symlink from y.tab.h doesn't work until its target exists.


# 35695 04-May-1998 bde

Fudge local variables better in the yacc rules so that multiple yacc
sources are handled properly.


# 35689 04-May-1998 bde

Generate explicit rules and other infrastructure for lex and yacc
sources. This will be used to fix `make -jN' races in many
Makefiles in /usr/src, and to simplify these and other Makefiles.

To get the fixes and simplifications, application Makefiles should
put the raw lex and yacc source names (foo.l and bar.y) in SRCS and
not put the names of any generated files in SRCS or CLEANFILES. A
few Makefiles already do this, although it didn't actually work before
(mkdep couldn't create complete dependencies because there is no
intermediate .c file for the .y.o and .l.o implicit rules).

Complications: if bar.y is in SRCS and -d is in YFLAGS, then bar.h
will be generated whether or not it is used, even if this clobbers a
real source file. This is so that bar.c can be generated using the
-j-safe and debugger-friendly -o option to YACC. There are smaller
warts for handling y.tab.h. y.tab.c and lex.yy.c are not supported.


# 34829 23-Mar-1998 eivind

Support new version of global.

Submitted by: Shigio Yamaguchi <shigio@wafu.netgate.net>
Tested by: make buildworld


# 34528 12-Mar-1998 eivind

Introduce the 'regress' target.

Silently approved by: -hackers, -current


# 34087 06-Mar-1998 bde

Removed support for now-unused FreeBSD misfeature DPSRCS.


# 34081 06-Mar-1998 bde

Fixed dependency of ${PROG} on ${DPSRCS}. There were various races
for `make -j'. There are one-off fixes for the problem in a few
Makefiles, e.g., amd/amq/Makefile.


# 33816 25-Feb-1998 bde

Removed clean target. Simply add to CLEANFILES so that the default target
in bsd.obj.mk works.


# 33624 19-Feb-1998 eivind

Limit check for target to smaller section of makefile.


# 33600 18-Feb-1998 eivind

Don't create a ${PROG} target if it already exists.


# 33153 07-Feb-1998 helbig

Postpone the test for non-emptiness of $PROG, $OBJS and $CLEANFILES
to ``shell time''. The previous version didn't work in
/usr/src7share/man/man4.
Reviewed by: bde


# 31842 18-Dec-1997 bde

Oops, the previous patch was botched.


# 31815 17-Dec-1997 bde

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


# 31810 17-Dec-1997 bde

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

Fixed style of empty test.

Include <bsd.libnames.mk> if `checkdpadd' is being made, so that it can
:e checked until it goes away.


# 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


# 27782 31-Jul-1997 asami

Do not set the application variable LDDESTDIR. Note that it is still honored
in a few places (in bsd.lib.mk and bsd.prog.mk); this merely fixed part of
the brokenness by not setting it here.

This fixes building of secure telnetd when DESTDIR is defined.
(Otherwise, it will try to link libtelnet from ${DESTDIR}/usr/lib.)

Reviewed by: bde, jkh


# 27028 28-Jun-1997 pst

Make NOSHARED = no / NOSHARED = NO do what you'd expect.


# 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.


# 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.


# 25110 23-Apr-1997 bde

Pass everything in ${LDADD} directly to the linker for `make depend'
to prevent complaints from the compiler about nonexistent libraries.


# 25024 19-Apr-1997 bde

Removed unused (and almost unusable) support for LDONLY. See ld/rtld
for how to use gcc to invoke the linker only.

Removed `.if 0'ed support for not creating intermediate object files.

Removed unused include of bsd.libnames.mk (LDONLY had the last reference
to it).

Removed stale misplaced comment about MANDEPEND.


# 24861 13-Apr-1997 jkh

Support GLOBAL style tags.


# 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.


# 23542 08-Mar-1997 bde

Don't use dot in a chown command. The chown command has been a no-op
for years since it is for a symlink.


# 22988 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 22828 17-Feb-1997 bde

Removed bogus NOOBJ ifdef which was added in rev.1.18-1.19. SRCS is
for C sources only and must not be set if you don't want C objects.

This should fix PR2748.

This should go in 2.2.


# 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.


# 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.


# 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.


# 16581 22-Jun-1996 phk

Add man-page section 'n' and LIBTCL macro.


# 16437 17-Jun-1996 phk

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


# 16425 17-Jun-1996 jkh

Add LIBFTPIO


# 14782 23-Mar-1996 wosch

remove BINGRP?= BINOWN?= BINMODE?=


# 14701 19-Mar-1996 bde

sysinstall/Makefile:
Fixed DPADD again.

mk/bsd.README
Don't list the LIBXXX identifiers here. Describe them better.

mk/bsd.prog.mk
Updated the list of LIBXXX identifiers.
- recently added library libdisk.a wasn't mentioned (required for sysinstall)
- old objects kz*.o weren't mentioned
- old libraries libc_pic.a, libcom_err.a, libf2c.a, libg++.a, libgcc_pic.a,
libgmp.a, libipx.a, libkeycap.a, libss.a and libxpg4.a weren't mentioned
- old libraries libgnumalloc.a and libftp.a no longer exist
- old library libmp.a was said to not exist
- deprecated links libfl.a and libln.a weren't mentioned


# 14444 09-Mar-1996 wosch

[Ee]rrs -> Errs errs, save one process for make clean


# 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.


# 8321 07-May-1995 bde

Submitted by: charnier@lirmm.fr (Philippe Charnier)

Fix comment on .else to match code.


# 8081 26-Apr-1995 jkh

Add LIBFTP.


# 6954 08-Mar-1995 olah

LIBPCAP -> ${DESTDIR}/usr/lib/libpcap.a


# 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.


# 6031 30-Jan-1995 jkh

Add new LN_FLAGS variable for making LINKS symbolic and whatnot.


# 5898 25-Jan-1995 ache

LIBFORMS & LIBSCSI added


# 5859 24-Jan-1995 jkh

NOOBJS was bogus - use the already extant `NOOBJ'.


# 5856 24-Jan-1995 jkh

Add the ability to say `NOOBJS' to indicate that the target has no object
files.


# 5607 14-Jan-1995 jkh

The enclosed patch is a cosmetic change to bsd.prog.mk. When
a program directory has subdirectories, make now prints "===> dir/subdir"
instead of "===> subdir". This is modeled after the rules contained in
bsd.subdir.mk.

Submitted by: Remy Card <Remy.Card@masi.ibp.fr>


# 5585 14-Jan-1995 jkh

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


# 5257 28-Dec-1994 ache

Move INSTALL?=install line duplicated into each .mk to sys.mk
instead


# 5188 22-Dec-1994 bde

Don't use `MKDEP= -p' even for the case of a single source file since we
always make an intermediate object file.


# 4449 14-Nov-1994 bde

Define LIBEDIT, LIBGCC, LIBKVM, LIBSCRYPT and LIBY.

Comment about missing libraries for LIBDES, LIBKDB, LIBKRB, LIBMP, LIBPC
and LIBPLOT.

Don't define LIBDBM since it was replaced by db in libc.

Remove duplication. ${DESTDIR}/usr/lib/... gives /usr/lib/... even when
DESTDIR is not defined.


# 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.


# 3860 25-Oct-1994 bde

Use += instead of ?= for setting LDDESTDIR. Some Makefiles, such as
cc/Makefile.inc use (abuse?) LDDESTDIR for their internal libraries
so "?=" hides non-default external libraries. Adding multiple paths
to LDDESTDIR works except it makes it even harder than usual to
decide which libraries will actually be linked against.


# 3701 18-Oct-1994 pst

Added libmd.a -> LIBMD


# 3520 11-Oct-1994 ache

LIBDIALOG added


# 3493 10-Oct-1994 rgrimes

SHAREDSTRINGS support was no longer used and just clutters things up,
removed.


# 3404 07-Oct-1994 ache

LIBMYTINFO and LIBNCURSES defines added


# 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).


# 2676 11-Sep-1994 rgrimes

Change all references to LIBTERM and -ltermlib to LIBTERMCAP and -ltermcap


# 2351 28-Aug-1994 bde

Fix spelling error in little-used target.

Build an intermediate object file even when there is only one source
file. This costs a little space but saves time if the target is rebuilt
a lot, and it stops the target varying with the name of temporary
intermediates.

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

Use ${ECHODIR} instead of echo for printing directory names so that
`make -ss' is very quiet.


# 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.


# 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