History log of /freebsd-current/share/mk/sys.mk
Revision Date Author Comments
# 3abd36c6 27-Mar-2024 Stephen J. Kiernan <stevek@FreeBSD.org>

sys.mk: Define HOST_CC as CC by default.

This allows for setting a different compiler for building hostprogs
when cross compiling.

Obtained from: Juniper Networks, Inc.
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D44536


# 55197ead 02-Jan-2024 Warner Losh <imp@FreeBSD.org>

sys.mk: Remove support for building with fmake on modern systems.

We used to exclude a lot of extra hooks to allow for local
customizations of the build which couldn't be done outside of sys.mk,
but excluded that support for fmake. Remove those hacks.

Sponsored by: Netflix
Reviewed by: brooks
Pull Request: https://github.com/freebsd/freebsd-src/pull/980


# 97759ccc 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

share: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# bee3d4bf 11-May-2023 Simon J. Gerraty <sjg@FreeBSD.org>

Move DIRDEPS_BUILD settings to sys.dirdeps.mk

When originally implemented, there was no distinction between
DIRDEPS_BUILD and META_MODE, they were one and the same.

META_MODE however is useful by itself, but since meta.sys.mk
had lots of settings related to DIRDEPS_BUILD its use was limited
to DIRDEPS_BUILD.

Move (most) DIRDEPS_BUILD related items to sys.dirdeps.mk
so that meta.sys.mk can be used for just META_MODE.
There is of course some bluring of the lines, so settings remain
in meta.sys.mk

Add MK_META_ERROR_TARGET to enable the META_MODE .ERROR target
independent of DIRDEPS_BUILD, it copies failed .meta files to ${SB}/error
to make it easier to identify the cause of build failures.

Since sys.dirdeps.mk should be included first, most of
local.meta.sys.mk becomes local.sys.dirdeps.mk
and some other bits need to move to local.sys.dirdeps.env.mk

Also fix dirdeps.mk to not add CURDIR to DIRDEPS when it is SRCTOP.

Reviewed by: bdrewery
Differential Revision: https://reviews.freebsd.org/D40053


# 1ca12bd9 12-Apr-2023 John Baldwin <jhb@FreeBSD.org>

Remove the riscv64sf architecture.

Reviewed by: jrtc27, arichardson, br, kp, imp, emaste
Differential Revision: https://reviews.freebsd.org/D39496


# 42e51b15 25-Jan-2022 John Baldwin <jhb@FreeBSD.org>

Stop trying to strip 'eb' suffixes from ARM MACHINE_ARCH.

armeb is no longer a supported MACHINE_ARCH.

Reviewed by: imp, emaste
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D34019


# b94ed3bc 01-Jan-2022 Warner Losh <imp@FreeBSD.org>

sys.mk: Stop rewriting mips* to get MACHINE_CPUARCH

With mips no longer supported, we can GC the substitution from here.

Sponsored by: Netflix


# 7bc797e3 02-Aug-2021 Alex Richardson <arichardson@FreeBSD.org>

Add build system support for ASAN+UBSAN instrumentation

This adds two new options WITH_ASAN/WITH_UBSAN that can be set to
enable instrumentation of all binaries with AddressSanitizer and/or
UndefinedBehaviourSanitizer. This current patch is almost sufficient
to get a complete buildworld with sanitizer instrumentation but in
order to actually build and boot a system it depends on a few more
follow-up commits.

Reviewed By: brooks, kib, markj
Differential Revision: https://reviews.freebsd.org/D31043


# c6081dea 21-May-2021 Marcin Wojtas <mw@FreeBSD.org>

Add elfctl to toolchain.

Add elfctl program to toolchain to allow modifying ELF feature flags
during system build.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D29552


# bb3b6995 22-Jan-2021 Mateusz Guzik <mjg@FreeBSD.org>

Revert "[mips] revert r366664 - flip mips back from -O2 to -O"

This reverts commit bd72252aace382921840ddbceea712b96f4ad242.

The commit at hand breaks the build for all mips targets and does not
have a one-liner fix.

make[5]: "/usr/src/share/mk/sys.mk" line 169: Malformed conditional (${MACHINE_CPUARCH} == "mips" && ${COMPILER_TYPE} == "gcc")


# bd72252a 12-Jan-2021 Adrian Chadd <adrian@FreeBSD.org>

[mips] revert r366664 - flip mips back from -O2 to -O

Now that I have -head fitting in 8MB of flash again, I can test
out freebsd-head on my home AP test setup. Unfortunately,
the introduction of -O2 in r366664 causes the following infinite
loop shortly after boot:

------

MAP: No valid partition found at map/rootfs.uzip
Warning: no time-of-day clock registered, system time will not be set accurately
start_init: trying /sbin/init
BAD_PAGE_FAULT: pid 1 tid 100001 (init), uid 0: pc 0x4042c320 got a read fault (type 0x2) at 0x2e3a0
Trapframe Register Dump:
zero: 0 at: 0 v0: 0 v1: 0
a0: 0x1af34 a1: 0 a2: 0 a3: 0x7fffeff0
t0: 0 t1: 0 t2: 0 t3: 0
t4: 0 t5: 0 t6: 0 t7: 0
t8: 0 t9: 0x152e8 s0: 0x7fffee84 s1: 0
s2: 0 s3: 0 s4: 0 s5: 0
s6: 0 s7: 0 k0: 0 k1: 0
gp: 0x362c0 sp: 0x7fffedf0 s8: 0 ra: 0x40417df0
sr: 0xf413 mullo: 0 mulhi: 0 badvaddr: 0x2e3a0
cause: 0xffffffff80000008 pc: 0x4042c31c
Page table info for pc address 0x4042c320: pde = 0x80712000, pte = 0xa002065a
Dumping 4 words starting at pc address 0x4042c320:
8f9980e0 80820000 10400067 00809825
Page table info for bad address 0x2e3a0: pde = 0, pte = 0

------

I'm not yet sure why, but until I figure it out with the mips64/cheri
folk this should be reverted.

This should only use -O on GCC generated code for MIPS platforms.

Tested:

* QCA934x (mips74k) - WDR-3600/WDR-4300 APs

Differential Revision: https://reviews.freebsd.org/D28122


# 3f8d55c6 13-Oct-2020 Brooks Davis <brooks@FreeBSD.org>

Remove --ld-path=* from _LDFLAGS

It makes no sense to pass --ld-path to direct ${LD} invocations.

This was missed in r366270 due to not doing a clean build.


# 2cef3afd 13-Oct-2020 Alex Richardson <arichardson@FreeBSD.org>

Stop using -O instead of -O2 for MIPS

Until clang 11 that was equivalent to -O2, but clang changed it to -O1 so
generated MIPS code will now be unnecessarily slow. It also removes a weird
special case from sys.mk.
This is similar to the D26471 change for debug kernels and should not change
anything since everything was previously building MIPS code at -O2 until the
clang 11 update.

Reviewed By: trasz
Differential Revision: https://reviews.freebsd.org/D26749


# b75abea4 22-Sep-2020 Brandon Bergren <bdragon@FreeBSD.org>

[PowerPC64LE] Set up powerpc.powerpc64le architecture

This is the initial set up for PowerPC64LE.

The current plan is for this arch to remain experimental for FreeBSD 13.

This started as a weekend learning project for me and kinda snowballed from
there.

(More to follow momentarily.)

Reviewed by: imp (earlier version), emaste
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D26399


# 0e1e341b 17-Sep-2020 Alex Richardson <arichardson@FreeBSD.org>

Stop using lorder and ranlib when building libraries

Use of ranlib or lorder is no longer necessary with current linkers
(probably anything newer than ~1990) and ar's ability to create an object
index and symbol table in the archive.
Currently the build system uses lorder+tsort to sort the .o files in
dependency order so that a single-pass linker can use them. However,
we can use the -s flag to ar to add an index to the .a file which makes
lorder unnecessary.
Running ar -s is equivalent to running ranlib afterwards, so we can also
skip the ranlib invocation.

Similarly, we don't have to pass the .o files for shared libraries in
dependency order since both ld.bfd and ld.lld will correctly resolve
references between the .o files.

This removes many fork()+execve calls for each library so should speed up
builds a bit. Additionally lorder.sh uses a regular expression that is not
supported by the macOS libc or glibc and results in many warnings when
cross-building (see D25989).

There is one functional change: lorder.sh removed duplicated .o files
from the linker command line which now no longer happens. I fixed the duplicates
in the base system in r364649. I also checked the ports tree for uses of
bsd.lib.mk and found one duplicate source file which I fixed in r548168.
Most ports use CMake/autotools rather than bsd.lib.mk but if this breaks any
ports that I missed in my search please let me know.

Avoiding the shell script actually speeds up the linking step noticeably: I
measured how long it takes to rebuild the .a and .so files for lib/libc using a
basic benchmark: `rm $LIBC_OBJDIR/*.so* $LIBC_OBJDIR/*.a* && /usr/bin/time make -DWITHOUT_TESTS -s > /dev/null`
Without this change ~4.5 seconds and afterwards ~3.1 seconds.
Looking at truss -cf output we can see that the number fork() system
calls goes down from 27 to 12 (and the speedup while tracing is more
noticeable: 81 seconds -> 65 seconds).

See also https://www.gnu.org/software/coreutils/manual/html_node/tsort-background.html
for some more background:
This whole procedure has been obsolete since about 1980, because Unix
archives now contain a symbol table (traditionally built by ranlib, now
generally built by ar itself), and the Unix linker uses the symbol table
to effectively make multiple passes over an archive file.

Or alternatively https://www.unix.com/man-page/osf1/1/lorder/:
The lorder command is essentially obsolete. Use the following command in
its place: % ar -ts file.a

Reviewed By: emaste, imp, dim
Differential Revision: https://reviews.freebsd.org/D26044


# 1a18ab42 11-Aug-2020 Alex Richardson <arichardson@FreeBSD.org>

Allow overriding the tool used for stripping binaries

Since the make variable STRIP is already used for other purposes, this
uses STRIPBIN (which is also used for the same purpose by install(1).
This allows using LLVM objcopy to strip binaries instead of the in-tree
elftoolchain objcopy. We make use of this in CheriBSD since passing
binaries generated by our toolchain to elftoolchain strip sometimes results
in assertion failures.

This allows working around https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248516
by specifying STRIPBIN=/path/to/llvm-strip

Obtained from: CheriBSD
Reviewed By: emaste, brooks
Differential Revision: https://reviews.freebsd.org/D25988


# a8b8edb2 06-Apr-2020 Maxim Sobolev <sobomax@FreeBSD.org>

Normalize deployment tools usage and definitions by putting into one place
instead of sprinkling them out over many disjoint files. This is a follow-up
to achieve the same goal in an incomplete rev.348521.

Approved by: imp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20520


# 7d63f8b6 22-Jul-2019 Emmanuel Vadot <manu@FreeBSD.org>

arm: Use -O2 instead of -O as optimization flag

When using Clang -O is equivalent to -O2, change it -O2 to make it
consistent with other platforms.

Reference: https://clang.llvm.org/docs/ClangCommandLineReference.html#optimization-level

Submitted by: Daniel Engberg (daniel.engberg.lists@pyret.net)
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D21021


# 6e6be2bb 20-Jun-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Reduce exec and fstat overhead for non-build targets.

This is mostly targetting 'make showconfig' and 'make test-system-*' for
the benefit of makeman and universe-one-clang work.

Sponsored by: Dell EMC


# a12a1b47 28-Feb-2018 Bryan Drewery <bdrewery@FreeBSD.org>

Allow overriding .MAKE.MAKEFILE_PREFERENCE.

This will be utilized by Ports tools to avoid some extra
stat(2) calls.

MFC after: 3 days


# 1cbb5888 17-Nov-2017 Warner Losh <imp@FreeBSD.org>

Remove build system support for lint.

Differential Revision: https://reviews.freebsd.org/D13124


# ed617948 13-Nov-2017 Alex Richardson <arichardson@FreeBSD.org>

Remove -fuse-ld= when creating _LDFLAGS from LDFLAGS

The -fuse-ld flag is only meant to be passed to the compiler driver so
direct linker invocations should not include it.

Reviewed by: emaste, jhb
Approved by: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D12910


# 42b16bca 10-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

AUTO_OBJ: Don't create .OBJDIR with 'make -n'.

Sponsored by: Dell EMC Isilon


# c9c9774c 05-Nov-2017 Enji Cooper <ngie@FreeBSD.org>

Revert r325443

Despite the fact that it's a working solution, it doesn't follow the design
philosophy of only doing TARGET_* in Makefile.inc1 and special locations in
the source tree.

PR: 222925
Requested by: imp


# 914a5ffc 04-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

AUTO_OBJ: Revert r325351 now that the fix is in auto.obj.mk in r325404.

Forcing MK_AUTO_OBJ to no is not really needed since bsd.obj.mk is protected
against 'rm -rf ${.CURDIR}' already. It was also flawed as if MK_AUTO_OBJ=yes
was in the .MAKEOVERRIDES already then it just remained on.

Sponsored by: Dell EMC Isilon


# 40a54c51 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

AUTO_OBJ: If the wanted .OBJDIR was not used then disable the feature.

This is to prevent downstream checks from assuming they can trust .OBJDIR when
MK_AUTO_OBJ is yes, such as the bsd.obj.mk checks.

Pointyhat to: bdrewery
Sponsored by: Dell EMC Isilon


# 615a1e70 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Enable AUTO_OBJ by default if the OBJDIR is writable, only for in-tree builds.

This can be disabled by putting WITHOUT_AUTO_OBJ=yes in /etc/src-env.conf, not
/etc/src.conf, or passing it in the environment.

The purpose of this rather than simply flipping the default of AUTO_OBJ to yes
is to avoid hassling users with auto.obj.mk failures if the wanted OBJDIR is
not writable. It will fallback to writing to the source directory like it does
today if MAKEOBJDIRPREFIX is not writable.

The act of enabling MK_AUTO_OBJ disables all 'make obj' treewalks since
previous work has made those not run if MK_AUTO_OBJ==yes in Makefile.inc1.

Relnotes: yes
Reviewed by: sjg
Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12841


# 718edb15 01-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Respect make -s.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon


# dfa09989 01-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Add option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.

This changes the build OBJDIR from the older style of /usr/obj/<srcdir> for
native builds, and /usr/obj/<target>.<target_arch>/<srcdir> for cross builds to
a new simpler format of /usr/obj/<srcdir>/<target>.<target_arch>. This
new format is used regardless of cross or native build. It allows
easier management of multiple source tree object directories.

The UNIFIED_OBJDIR option will be removed and its feature made permanent
for the 12.0 release.

Relnotes: yes (don't note UNIFIED_OBJDIR option since it will be removed)
Prior work: D3711 D874
Reviewed by: gjb, sjg
Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Discussed with: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12840


# 88d87eb6 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Handle host builds

If TARGET_ARCH isn't defined, fallback to MACHINE_ARCH.

This is a followup to r324873.

PR: 222925


# 69735ece 22-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

Define TARGET_CPUARCH and use in libclang_rt as the basis for CRTARCH

When cross-compiling, the wrong architecture was being embedded in the
libclang_rt binary filenames. It should be based on TARGET_ARCH (target), not
MACHINE_ARCH (host).

This is a draft commit against my project branch. Will fix on ^/head soon.

PR: 222925


# 0b972ac9 05-Oct-2017 Warner Losh <imp@FreeBSD.org>

Support armv7 builds for userland

Make armv7 as a new MACHINE_ARCH.

Copy all the places we do armv6 and add armv7 as basically an
alias. clang appears to generate code for armv7 by default. armv7 hard
float isn't supported by the the in-tree gcc, so it hasn't been
updated to have a new default.

Support armv7 as a new valid MACHINE_ARCH (and by extension
TARGET_ARCH).

Add armv7 to the universe build.

Differential Revision: https://reviews.freebsd.org/D12010


# 9208cbbd 12-Aug-2017 Warner Losh <imp@FreeBSD.org>

arm*hf is no longer a thing, remove it from the conversion now that it's easy.

Submitted by: andyt@


# 7709b2ae 12-Aug-2017 Warner Losh <imp@FreeBSD.org>

Make _TO_CPUARCH macro for ARCH to CPUARCH conversions

Consolidate all the regular expressions to convert from MACHINE_ARCH
to MACHINE_CPUARCH into a variable and use that variable in preference
to the almost identical copies in the tree (which should have been
identical).

Differential Revision: https://reviews.freebsd.org/D11986


# ecb77ea9 31-Jul-2017 Enji Cooper <ngie@FreeBSD.org>

Take a different approach to building with --coverage (WiP)

The .covo binaries didn't really make sense after reviewing some stackoverflow posts
and other related documentation -- in particular, it would complicate matters by having
"coverage-enabled binaries" link to "coverage-enabled libraries" (aka "covo" libraries).
It's best to install the full binaries/libraries to /usr/lib/cov instead.

In order to enable this (and make sure that libprofile_rt is built properly),
libprofile_rt must be built with cross-tools.

Also, don't explicitly disable MK_COVERAGE in _libraries -- coverage support needs to
be baked in to the libraries in order for it to be effective.

Pass through --coverage in the linking phase for shared libraries -- it's necessary
to ensure that libprofile_rt is resolved properly in the _libraries phase with 2nd
order libraries, like libcom_err.so.*.

This change reverses all of r320396 and partially reverses r321758. The first commit
was the WiP approach that was proven to incorrect with the reasoning given in the first
paragraph. The second commit reverses the MK_DEBUG_FILES change because I'll probably
run into friction when trying to merge it back in to head if I leave it in (despite
the fact that I find this behavior completely unnecessary).

TODO: see if libprofile_rt's symbols should be stripped out of debug files; they are
currently duplicated between the fat binaries installed to /usr/lib/cov and the debug
files installed to /usr/lib/debug .


# a0b87afa 21-Jun-2017 Enji Cooper <ngie@FreeBSD.org>

Add COV_CFLAGS and COV_CXXFLAGS for parity with PO_CFLAGS and PO_CXXFLAGS

These variables will help drive cc/c++ when generating coverage instrumented
binaries.


# 9369f357 12-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: NO_FILEMON should imply nofilemon.

This fixes NO_FILEMON to properly still use .depend.OBJ files
for dependency tracking.

MFC after: 1 week
Sponsored by: Dell EMC Isilon


# 1a9cc831 04-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Add framework to force rebuilding for major ABI changes.

Normally META_MODE ignores host files for "meta mode" decisions on whether a
file should be rebuilt or not. This is because a simple installworld can
update timestamps and cause the next build to rebuild all host tools, when the
previous ones may not have any changes in the source tree. These tools are
normally still ABI compatible. They are only rebuilt if NO_META_IGNORE_HOST is
set from the workaround/hack in r301467.

One of the major problems with this is when a host tool has objects spread
across many revisions that have mixed-ABI. For example, if struct stat were to
change on the host, some objects for a tool may have different ideas of that
struct's definition. If just 1 source file were modified and rebuilt and
linked into the tool, then that toll will have mixed-ABI objects and crash.
This exact thing happened with the ino64 commit in r301467 followed by a
trivial update to libbfd in r318750. The resulting binary would crash in
buildworld.

Sponsored by: Dell EMC Isilon


# ffe0978f 04-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Allow not ignoring host headers with NO_META_IGNORE_HOST_HEADERS.

See r301467 for more details on NO_META_IGNORE_HOST. Usually the full
list of host ignores should have no real impact on the host tools. The
headers however may reliably define what the ABI is for the host. It
may be useful to allow using the headers for the build but still not
caring about things like /bin/sh, /lib/libedit.so, etc.

Sponsored by: Dell EMC Isilon


# 53b3b059 01-Jun-2017 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Move ignoring of /usr/local/etc/libmap.d to proper place.

This was added in r318194 but local.meta.sys.mk is only used for
DIRDEPS_BUILD.


# ea22493a 07-Apr-2017 John Baldwin <jhb@FreeBSD.org>

Explicitly set the desired MIPS ABI in toolchain flags.

Specifically, set '-mabi=XX' in AFLAGS, CFLAGS, and LDFLAGS. This permits
building MIPS worlds and binaries with a toolchain whose default output
does not match the desired TARGET_ARCH.

_LDFLAGS (which is used with LD instead of with CC) required an update as
LD does not accept the -mabi flags (so they must be stripped from LDFLAGS
when generating _LDFLAGS). For bare uses of LD (rather than linking via
CC), the desired ABI must be set by setting an explicit linker emulation
as done in r316514 for kernels and kernel modules.

Reviewed by: imp
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D10085


# 7804dd52 16-Nov-2016 Ruslan Bukin <br@FreeBSD.org>

Add full softfloat and hardfloat support for RISC-V.

Hardfloat is now default (use riscv64sf as TARGET_ARCH
for softfloat).

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8529


# e4195e2e 01-Nov-2016 Jonathan Anderson <jonathan@FreeBSD.org>

Add rules to build LLVM IR binaries and libraries.

Running `make libfoo.ll` or `make libfoo.bc` within a library directory
will now give us an LLVM IR version of the library, and `make foo.full.ll`
or `make foo.full.bc` will give us an IR version of a binary.

As part of this change, we add an LLVM_LINK variable to sys.mk that can be
specified/overridden using an external toolchain.

Reviewed by: bdrewery, brooks
Approved by: rwatson (mentor)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8388


# 5bca2215 31-Oct-2016 Ruslan Bukin <br@FreeBSD.org>

Add full softfloat and hardfloat support for MIPS.

This adds new target architectures for hardfloat:
mipselhf mipshf mips64elhf mips64hf.

Tested in QEMU only.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D8376


# c4e24caf 27-Oct-2016 Dimitry Andric <dim@FreeBSD.org>

Revert r307823 (Use upstream suffixes for LLVM IR) for now. It causes a
number of ports to fail, which use bmake, and use .ll file extensions
(usually for for C++-based lex input).

Reported by: antoine


# ce1e4668 23-Oct-2016 Dimitry Andric <dim@FreeBSD.org>

Use upstream suffixes for LLVM IR

In r307676, several make rules were added for LLVM IR files, both in
text and binary format. Unfortunately these use different suffixes from
what upstream uses:
* Text IR has upstream suffix ".ll", while r307676 uses ".llo"
* Binary IR has upstream suffix ".bc", while r307676 uses ".bco"

Change these to what upstream uses instead.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D8326


# dc9b124d 21-Oct-2016 Justin Hibbits <jhibbits@FreeBSD.org>

Create a new MACHINE_ARCH for Freescale PowerPC e500v2

Summary:
The Freescale e500v2 PowerPC core does not use a standard FPU.
Instead, it uses a Signal Processing Engine (SPE)--a DSP-style vector processor
unit, which doubles as a FPU. The PowerPC SPE ABI is incompatible with the
stock powerpc ABI, so a new MACHINE_ARCH was created to deal with this.
Additionaly, the SPE opcodes overlap with Altivec, so these are mutually
exclusive. Taking advantage of this fact, a new file, powerpc/booke/spe.c, was
created with the same function set as in powerpc/powerpc/altivec.c, so it
becomes effectively a drop-in replacement. setjmp/longjmp were modified to save
the upper 32-bits of the now-64-bit GPRs (upper 32-bits are only accessible by
the SPE).

Note: This does _not_ support the SPE in the e500v1, as the e500v1 SPE does not
support double-precision floating point.

Also, without a new MACHINE_ARCH it would be impossible to provide binary
packages which utilize the SPE.

Additionally, no work has been done to support ports, work is needed for this.
This also means no newer gcc can yet be used. However, gcc's powerpc support
has been refactored which would make adding a powerpcspe-freebsd target very
easy.

Test Plan:
This was lightly tested on a RouterBoard RB800 and an AmigaOne A1222
(P1022-based) board, compiled against the new ABI. Base system utilities
(/bin/sh, /bin/ls, etc) still function appropriately, the system is able to boot
multiuser.

Reviewed By: bdrewery, imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D5683


# e5e40621 21-Oct-2016 Dimitry Andric <dim@FreeBSD.org>

Fix building of many ports that use make from base, such as devel/apr1,
after r307676, which added transformation rules for .llo and .bco files.

These suffixes also have to be added the the global .SUFFIXES target,
otherwise the various suffix-transformation rules would be interpreted
as literal targets. E.g.,

.c.bco:
... commands ...

would actually to build a file named ".c.bco".


# c867306e 20-Oct-2016 Jonathan Anderson <jonathan@FreeBSD.org>

Add make rules to build LLVM IR from C/C++ sources.

As a foundation for future work with LLVM's Intermediate Representation (IR),
add new suffix rules that can be used to build .llo (text) or .bco (bitcode)
files from C or C++ sources. This compilation step uses the same CFLAGS, etc.,
as are used for building .o files, with the exception of optimization flags.
Many of the things we would like to do with IR (e.g., instrumentation) work
better with unoptimized code, so our approach is to build .c->.bco without
optimization and then apply the optimization in post-analysis,
post-instrumentation linking.

The overall result of these changes is:

* one can "make foo.llo" or "make foo.bco" wherever "make foo.o" was supported
* new make variables IR_CFLAGS and IR_CXXFLAGS are available to inspect the
flags that are used by Clang to generate the IR

These new rules are added unconditionally to our non-POSIX suffix rule set,
since we cannot inspect COMPILER_TYPE in sys.mk. Future changes that depend
on these rules (e.g., building IR versions of binaries from bsd.prog.mk)
should use COMPILER_TYPE to determine when we can expect IR rules to succeed.

Reviewed by: emaste, imp
Approved by: rwatson (mentor)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D4339


# e7c08366 17-Oct-2016 Marcel Moolenaar <marcel@FreeBSD.org>

Add LORDER, TSORT and TSORTFLAGS variables and replace the
hardcoded utility names and tsort flags.


# 808b18e4 11-Oct-2016 Jonathan Anderson <jonathan@FreeBSD.org>

Extract suffix rules into bsd.suffixes[-posix].mk.

Refactor make suffix rules into separate files (one for POSIX and one not),
and rationalise the rules so that bsd.lib.mk can contain only those rules
that are library-specific (.c.po and .c.pico).

This can be accomplished by adding ${STATIC_CFLAGS} to the .c.o rule
unconditionally. STATIC_CFLAGS are only defined for use by sys.mk rules in
lib/libpam/Makefile.inc (see r227797), so it should be safe to include
them unconditionally in sys.mk's .c.o rule (tested by make universe and a
ports exp-run).

Reviewed by: bdrewery, sjg
Approved by: rwatson (mentor)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D6805


# 9e2f435f 31-Aug-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Add a 'make print-dir' that simply traverses all directories and prints them.

This is useful for finding connected directories.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division


# fd406aa3 27-Jul-2016 Ed Maste <emaste@FreeBSD.org>

Remove ${OBJDUMP} as it is not used by the base system

It was added to sys.mk relatively recently (r274503) for EFI builds
but is no longer used by the base system. The in-tree binutils are
outdated, will not be updated, and will be removed in the future.
Remove it from the toolchain build now to slightly simplify the build
and make sure we don't grow an accidental dependency.

Note that this affects only the toolchain build, and does not affect
/usr/bin/objdump in the built world.

Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6460


# b987685f 12-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Revert r302670 and r302671 for now.

MACHINE_CPUARCH smells like MACHINE except for arm64/aarch64 which
has it backwards.


# 8a6bdc13 12-Jul-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Create one list of replacements for MACHINE_CPUARCH as MACHINE_CPUARCH_SUB.

This also adds missing s/aarch64/arm64 to the sys.mk version and also
adds back armv6hf for universe since it was added to the sys.mk version
in r300438.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7159


# 799483e4 21-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Don't generate or read _EXTRADEPEND dependencies when using filemon.

The DPADD data in .depend will be redundant with what is in the .meta file.

Also extend NO_EXTRADEPEND support to bsd.prog.mk.

Approved by: re (blanket, META_MODE)
Sponsored by: EMC / Isilon Storage Division


# 3ea2c169 15-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Keep .MAKE.MODE/META_MODE clean

Due to META_MODE being passed into the environment it tends
to keep growing with the defaults.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division


# b8ef21b8 14-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Lessen the filemon(4) requirement scope.

- Move the sys.mk filemon requirement to bsd.init.mk as a warning.
This is intended only to show when building directly in a subdirectory
without filemon loaded.
- Move the error into Makefile and only apply it when building
from the META_TGT_WHITELIST target list.

-DNO_FILEMON can be used to suppress both the warning and the error but
makes WITH_META_MODE less useful. It will only compare build commands
in this mode rather than track all dependencies.

This fixes installing from a jail which doesn't need filemon in this
phase [1].

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com> [1]
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division


# 37250e48 14-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Set MK_META_MODE=no with -B.

Using -B already sets .MAKE.MODE=compat but it was leaving
MK_META_MODE set which could still cause other MK_META_MODE==yes
checks to trigger.

Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division


# ef4ce15d 08-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Don't force filemon for makeman/showconfig

Reported by: lidl


# 7f17cd1c 05-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Avoid host tool timestamps causing a rebuild.

Using buildworld, installworld, buildworld. It is expected that nothing
should rebuild. However any host tool used could have its timestamp
updated. Any library used by dynamic tools could have its timestamp
updated. The filemon(4) data in the .meta files captures all reads to
these files. This causes the 2nd buildworld to rebuild everything since
host tools and files have been updated.

Because the build is self-reliant and bootstraps itself, it should be
safe to ignore mtime changes on host files used during the build. Host
files should only impact the build of legacy, build-tools, bootstrap-tools,
cross-tools, but those are already intended to be reproducible from its
own bootstrapping. It is possible in a rare case that a bug in a host
file does produce a broken build tool. If that happens it will just
have to be communicated properly.

An alternative solution would be to update the mtime of all files in the
object directory after installworld so that the host files are not newer
than the object files. That also requires special care for read-only
obj directories and special care to not mess with any intended timestamps in
the build, such as done for reproducibility.

Reported by: many
Sponsored by: EMC / Isilon Storage Division


# 3681768c 05-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Enable bmake's missing meta rebuild feature


# 5852ae2d 03-Jun-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Revert r301079.

This breaks cross-building with WITH_META_MODE since it will rebuild
'build-tools' during the 'everything' phase.

A more proper fix is coming to bmake to implicitly require .META unless
.NOMETA (and other restrictions) are in place.


# c89283ce 31-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Require filemon(4) be loaded.

Since META_MODE is being sold and used as a working incremental build, it won't
make much sense if filemon data is excluded. There is no way to recover
from that in a subsequent build.

Sponsored by: EMC / Isilon Storage Division


# 28849c57 31-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

WITH_META_MODE: Mitigate switching from without to with META_MODE.

Adding .META to targets-to-build will ensure that they will rebuild if there
is no .meta file.

Adding it to all SUFFIXES and objects ensures that at least objects will
rebuild if there is no .meta file.

This will be reverted if bmake's behavior changes to rebuild on missing .meta
files.

Sponsored by: EMC / Isilon Storage Division


# 699f93b9 23-May-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Properly allow META_MODE to be set from environment.

Sponsored by: EMC / Isilon Storage Division


# aa1434ec 22-May-2016 Ian Lepore <ian@FreeBSD.org>

Restore the translation of armv6hf->arm when generating MACHINE_CPUARCH.
It turns out we need to leave this in place for a while so that people
running self-hosting armv6hf systems can do the builds necessary to update
to armv6 (which is now hardfloat by default).


# 2c0e9e2a 18-May-2016 Warner Losh <imp@FreeBSD.org>

Make armv6 hard float abi by default. Kill armv6hf.
Allow CPUTYPE=soft to build the current soft-float abi libraries.
Add UPDATING entry to announce this.

Approved by: re@ (gjb)


# b29980a6 26-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Default to the silent build.

Sponsored by: EMC / Isilon Storage Division


# 180a8487 26-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Track .meta files for .sh but don't preserve timestamp.

See r291320 for more information.

Sponsored by: EMC / Isilon Storage Division


# 64923b11 26-Feb-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Allow configuring .MAKE.MODE via META_MODE as meta.sys.mk does.

meta.sys.mk is only used for the DIRDEPS_BUILD.

Sponsored by: EMC / Isilon Storage Division


# 952de59d 19-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Ensure bmake does not use filemon if it is not loaded.

Sponsored by: EMC / Isilon Storage Division


# 0b6ba3f2 19-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Define .MAKE.MODE to normal to avoid the need for :U later.

Sponsored by: EMC / Isilon Storage Division


# 0e87e3cb 06-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Revert r293286. It was not intended to come in yet.


# 3ba0785a 06-Jan-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Move the MAKEOBJDIRPREFIX value guard to sys.mk and expand to MAKEOBJDIR.

This will ensure that the variable was not set as a make override, in
make.conf, src.conf or src-env.conf. It allows setting the value in
src-env.conf when using WITH_AUTO_OBJ since that case properly handles
changing .OBJDIR (except if MAKEOBJDIRPREFIX does not yet exist which is
being discussed to be changed).

This change allows setting a default MAKEOBJDIRPREFIX via local.sys.env.mk.

Sponsored by: EMC / Isilon Storage Division


# 67292978 25-Dec-2015 Colin Percival <cperciva@FreeBSD.org>

Document that make's .POSIX: handling is broken. In fact, it has been
broken ever since it was added in November 1996.


# 1fdcc5e5 11-Dec-2015 Ruslan Bukin <br@FreeBSD.org>

Start support for the RISC-V 64-bit architecture developed by UC Berkeley.

RISC-V is a new ISA designed to support computer research and education, and
is now become a standard open architecture for industry implementations.

This is a minimal set of changes required to run 'make kernel-toolchain'
using external (GNU) toolchain.

The FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv.

Reviewed by: andrew, bdrewery, emaste, imp
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D4445


# 682d8404 11-Dec-2015 Marcelo Araujo <araujo@FreeBSD.org>

Fix minor typos introduced on r292084.

Approved by: rodrigc (mentor)
Differential Revision: https://reviews.freebsd.org/D4495


# 9ca54343 10-Dec-2015 Warner Losh <imp@FreeBSD.org>

Move the inclusion of bsd.cpu.mk from sys.mk to bsd.opts.mk. However,
for historical behavior that ports depends on, include it if we're
inside the ports tree.

Differential Review: https://reviews.freebsd.org/D4383
Ports Exp run: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205021


# b791fbe6 25-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

META MODE: Don't create .meta files when symlinking sources into the obj directory.

Tracking these leads to situations where meta mode will consider the
file to be out of date if /bin/sh or /bin/ln are newer than the source
file. There's no reason for meta mode to do this as make is already
handling the rebuild dependency fine.

Sponsored by: EMC / Isilon Storage Division


# bb8cd0c6 25-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

META MODE: Revert r287879 so that 'make -V' still uses AUTO_OBJ.

This has caused much confusion for myself as there are quite a lot of
variables that depend on having a proper ${.OBJDIR}.

Sponsored by: EMC / Isilon Storage Division


# dba62d8d 16-Nov-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Default MK_META_MODE from MK_DIRDEPS_BUILD

This allows most of the build to simply consider MK_META_MODE

Update to latest dirdeps.mk so we can do:

make -f dirdeps.mk bin/cat.i386

Reviewed by: bdrewery


# 948f327e 13-Nov-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Rename META_MODE option to DIRDEPS_BUILD

This allows META_FILES option to be renamed META_MODE.
Also add META_COOKIE_TOUCH for use in targets that can benefit
from a cookie when in meta mode.

Differential Revision: https://reviews.freebsd.org/D4153
Reviewed by: bdrewery


# 9160419c 07-Nov-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add built-in ccache build support via WITH_CCACHE_BUILD option.

ccache is mostly beneficial for frequent builds where -DNO_CLEAN is not
used to achieve a safe pseudo-incremental build. This is explained in
more detail upstream [1] [2]. It incurs about a 20%-28% hit to populate the
cache, but with a full cache saves 30-50% in build times. When combined with
the WITH_FAST_DEPEND feature it saves up to 65% since ccache does cache the
resulting dependency file, which it does not do when using mkdep(1)/'CC
-E'. Stats are provided at the end of this message.

This removes the need to modify /etc/make.conf with the CC:= and CXX:=
lines which conflicted with external compiler support [3] (causing the
bootstrap compiler to not be built which lead to obscure failures [4]),
incorrectly invoked ccache in various stages, required CCACHE_CPP2 to avoid
Clang errors with parenthesis, and did not work with META_MODE.

The option name was picked to match the existing option in ports. This
feature is available for both in-src and out-of-src builds that use
/usr/share/mk.

Linking, assembly compiles, and pre-processing avoid using ccache since it is
only overhead. ccache does nothing special in these modes, although there is
no harm in calling it for them.

CCACHE_COMPILERCHECK is set to 'content' when using the in-tree bootstrap
compiler to hash the content of the compiler binary to determine if it
should be a cache miss. For external compilers the 'mtime' option is used
as it is more efficient and likely to be correct. Future work may optimize the
'content' check using the same checks as whether a bootstrap compiler is needed
to be built.

The CCACHE_CPP2 pessimization is currently default in our devel/ccache
port due to Clang requiring it. Clang's -Wparentheses-equality,
-Wtautological-compare, and -Wself-assign warnings do not mix well with
compiling already-pre-processed code that may have expanded macros that
trigger the warnings. GCC has so far not had this issue so it is allowed to
disable the CCACHE_CPP2 default in our port.

Sharing a cache between multiple checkouts, or systems, is explained in
the ccache manual. Sharing a cache over NFS would likely not be worth
it, but syncing cache directories between systems may be useful for an
organization. There is also a memcached backend available [5]. Due to using
an object directory outside of the source directory though you will need to
ensure that both are in the same prefix and all users use the same layout. A
possible working layout is as follows:
Source: /some/prefix/src1
Source: /some/prefix/src2
Source: /some/prefix/src3
Objdir: /some/prefix/obj
Environment: CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj'
This will use src*/../obj as the MAKEOBJDIRPREFIX and tells ccache to replace
all absolute paths to be relative. Using something like this is required due
to -I and -o flags containing both SRC and OBJDIR absolute paths that ccache
adds into its hash for the object without CCACHE_BASEDIR.

distcc can be hooked into by setting CCACHE_PREFIX=/usr/local/bin/distcc.
I have not personally tested this and assume it will not mix well with
using the bootstrap compiler.

The cache from buildworld can be reused in a subdir by first running
'make buildenv' (from r290424).

Note that the cache is currently different depending on whether -j is
used or not due to ccache enabling -fdiagnostics-color automatically if
stderr is a TTY, which bmake only does if not using -j.

The system I used for testing was:
WITNESS
Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_CCACHE_BUILD=yes
DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log.
The arc was fully populated with src tree files and ccache objects.
RAM: 76GiB
CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz
2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16

The WITH_FAST_DEPEND feature was used for comparison here as well to show
the dramatic time savings with a full cache.

buildworld:
x buildworld-before
+ buildworld-ccache-empty
* buildworld-ccache-full
% buildworld-ccache-full-fastdep
# buildworld-fastdep
+-------------------------------------------------------------------------------+
|% * # +|
|% * # +|
|% * # xxx +|
| |A |
| A|
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 3744.13 3794.31 3752.25 3763.5633 26.935139
+ 3 4519 4525.04 4520.73 4521.59 3.1104823
Difference at 95.0% confidence
758.027 +/- 43.4565
20.1412% +/- 1.15466%
(Student's t, pooled s = 19.1726)
* 3 1823.08 1827.2 1825.62 1825.3 2.0785572
Difference at 95.0% confidence
-1938.26 +/- 43.298
-51.5007% +/- 1.15045%
(Student's t, pooled s = 19.1026)
% 3 1266.96 1279.37 1270.47 1272.2667 6.3971113
Difference at 95.0% confidence
-2491.3 +/- 44.3704
-66.1952% +/- 1.17895%
(Student's t, pooled s = 19.5758)
# 3 3153.34 3155.16 3154.2 3154.2333 0.91045776
Difference at 95.0% confidence
-609.33 +/- 43.1943
-16.1902% +/- 1.1477%
(Student's t, pooled s = 19.0569)

buildkernel:
x buildkernel-before
+ buildkernel-ccache-empty
* buildkernel-ccache-empty-fastdep
% buildkernel-ccache-full
# buildkernel-ccache-full-fastdep
@ buildkernel-fastdep
+-------------------------------------------------------------------------------+
|# @ % * |
|# @ % * x + |
|# @ % * xx ++|
| MA |
| MA|
| A |
| A |
|A |
| A |
+-------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 3 571.57 573.94 571.79 572.43333 1.3094401
+ 3 727.97 731.91 728.06 729.31333 2.2492295
Difference at 95.0% confidence
156.88 +/- 4.17129
27.4058% +/- 0.728695%
(Student's t, pooled s = 1.84034)
* 3 527.1 528.29 528.08 527.82333 0.63516402
Difference at 95.0% confidence
-44.61 +/- 2.33254
-7.79305% +/- 0.407478%
(Student's t, pooled s = 1.02909)
% 3 400.4 401.05 400.62 400.69 0.3306055
Difference at 95.0% confidence
-171.743 +/- 2.16453
-30.0023% +/- 0.378128%
(Student's t, pooled s = 0.954969)
# 3 201.94 203.34 202.28 202.52 0.73020545
Difference at 95.0% confidence
-369.913 +/- 2.40293
-64.6212% +/- 0.419774%
(Student's t, pooled s = 1.06015)
@ 3 369.12 370.57 369.3 369.66333 0.79033748
Difference at 95.0% confidence
-202.77 +/- 2.45131
-35.4225% +/- 0.428227%
(Student's t, pooled s = 1.0815)

[1] https://ccache.samba.org/performance.html
[2] http://www.mail-archive.com/ccache@lists.samba.org/msg00576.html
[3] https://reviews.freebsd.org/D3484
[5] https://github.com/jrosdahl/ccache/pull/30

PR: 182944 [4]
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Relnotes: yes


# 56585ab5 17-Oct-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Rework the 'make -n -n' feature such that '-n' recurses and '-N' does not.

Bmake has a documented feature of '-N' to skip executing commands which is
specifically intended for debugging top-level builds and not recursing into
sub-directories. This matches the older 'make -n' behavior we added which made
'-n -n' the recursing target and '-n' a non-recursing target.

Removing the '-n -n' feature allows the build to work as documented in
the bmake manpage with '-n' and '-N'. The older '-n -n' feature was also
not documented anywhere that I could see.

Note that the ${_+_} var is still needed as currently bmake incorrectly
executes '+' commands when '-N' is specified.

The '-n' and '-n -n' features were broken for several reasons prior to this.
r251748 made '_+_' never expand with '-n -n' which resulted in many
sub-directories not being visited until fixed 2 years later in r288391, and
many targets were given .MAKE over the past few years which resulted in
non-sub-make commands, such as rm and ln and mtree, to be executed.

This should also allow removing some indirection hacks in bsd.subdir.mk and
other cases of .USE that have a .MAKE by using '+'.

Sponsored by: EMC / Isilon Storage Division
Discussed on: arch@ (mostly silence)


# c41b6218 25-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Explicitly enable .MAKE.ALWAYS_PASS_JOB_QUEUE for bmake.

This is a NOP as r254419 enabled this by default in bmake. Add it here though
to ensure it is known that we are using this as a default and in case a
bmake import removes the default we have.

This tells bmake to always pass job tokens into sub-commands. Otherwise
it would only do so if the target being built depended on the special
.MAKE target (which causes _all_ commands to be executed with -n as well)
or if the command matches '${MAKE}/${.MAKE}/$(MAKE)/$(.MAKE)/make' (before
expansion, so ${LIB32WMAKE} would not qualify). Using '+' on a command
(which runs the command with -n) would not pass the job token even though it
is a documented way to achieve the .MAKE effect on a command.

Sponsored by: EMC / Isilon Storage Division


# 533fbec5 23-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Follow-up r287879 and have 'make -V .OBJDIR' still invoke auto.obj.mk.

When inspecting this value it is more expected to have it show the
automatically-created directory value rather than CURDIR.

Sponsored by: EMC / Isilon Storage Division


# da6e996d 17-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

src.conf.5: Make it self-documenting that the mkopts are environment-only.

Sponsored by: EMC / Isilon Storage Division


# 232af795 17-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Include bsd.mkopt.mk after local.sys.env.mk (which includes /etc/src-env.conf).

This will allow setting WITH_META_MODE in that file rather that requiring
it to be set in the environment.

Sponsored by: EMC / Isilon Storage Division


# 66e5857b 17-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Fix makeman creating obj directories due to turning on WITH_AUTO_OBJ.

r284708 addressed this slightly but seems to have put the make(showconfig)
guard in the wrong place. Rather than guard setting the default obj directory,
guard inclusion of auto.obj.mk. This avoids creating SRCTOP/obj and
SRCTOP/release/obj when running makeman.

Sponsored by: EMC / Isilon Storage Division


# 8d4b8102 16-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

META_MODE: Don't create obj directories automatically when running make -V.

Sponsored by: EMC / Isilon Storage Division


# b9d0791f 26-Aug-2015 Warner Losh <imp@FreeBSD.org>

Make sys.mk more compatible with fmake by refraining from using :U
modifiers.

Differential Revision: https://reviews.freebsd.org/D3228


# 25ec8c92 14-Aug-2015 Rui Paulo <rpaulo@FreeBSD.org>

Introduce a new make variable: NMFLAGS.

As the name indicates, these are flags to pass to nm(1). The newer
binutils have a plugin mechanism so, to build something with LLVM's
LTO, we need to pass flags to nm(1). This commit also extends
lorder(1) to pass NMFLAGS to nm(1).


# daf514d0 19-Jun-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Move include of make.conf back to its old position.

This means moving include of local.sys.mk and src.sys.mk too.
Introduce new includes to take the early slot, for the purpose
of being able to influence toolchains and the like.

Differential Revision: D2860
Reviewed by: imp


# f5374544 10-Jun-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Building on fmake is no longer possible so removed tests for bmake.


# c4a81da0 26-May-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Include bsd.mkopt.mk before local.sys.mk

Also use __DEFAULT_DEPENDENT_OPTIONS for options that
generally depend on META_MODE.
Deal with MK_META_MODE and MK_AUTO_OBJ directly.
Also allow MK_META_FILES if no -B
this is very handy for getting meta files from say buildworld


# 9932374e 23-May-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Add options for auto obj and meta mode to sys.mk


# 0c76c8aa 07-Apr-2015 Mark Johnston <markj@FreeBSD.org>

Add a DTRACEFLAGS variable, which can be used to pass additional variables
to dtrace(1) invocations during a build. This change includes -C in the
default flags, which has dtrace(1) run input scripts through the
preprocessor. While here, sort the definitions of CP and CPP in sys.mk.

Differential Revision: https://reviews.freebsd.org/D2204
Reviewed by: imp, rpaulo (previous revision)


# cee9be49 13-Mar-2015 Dimitry Andric <dim@FreeBSD.org>

Allow relative pathnames in SRCS, so as to enable building software
which includes more than one file with the same name, in different
directories.

For example, setting:

SRCS+= foo/foo.c bar/foo.c baz/foo.c

will now create separate objdirs 'foo', 'bar' and 'baz' for each of the
sources in the list, and use those objdirs for the corresponding object
files.

Reviewed by: brooks, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D1984


# 7a37b5fc 16-Jan-2015 Will Andrews <will@FreeBSD.org>

Add a ${CP} alias for copying files in the build.

Some users build FreeBSD as non-root in Perforce workspaces. By default,
Perforce sets files read-only unless they're explicitly being edited.
As a result, the -f argument must be used to cp in order to override the
read-only flag when copying source files to object directories. Bare use of
'cp' should be avoided in the future.

Update all current users of 'cp' in the src tree.

Reviewed by: emaste
MFC after: 1 week
Sponsored by: Spectra Logic


# 124cd641 14-Nov-2014 Andrew Turner <andrew@FreeBSD.org>

Add OBJDUMP to sys.mk. The EFI loader uses it however without this it can
be set but empty.

Obtained from: ABT Systems
Sponsored by: The FreeBSD Foundation


# 78abccfc 10-Oct-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Make sure SIZE is defined early


# 5b6dc2ef 25-Jul-2014 Simon J. Gerraty <sjg@FreeBSD.org>

Reviewed by: imp

LDFLAGS is supposed to be given to CC not LD.
Define _LDFLAGS as a filtered version of LDFLAGS safe to give to LD


# 34bbee43 17-May-2014 Warner Losh <imp@FreeBSD.org>

Move inclusion of /etc/make.conf and others to old location (this also
moves local.sys.mk). The new location broke adding things to CXXFLAGS
in /etc/src.conf with +=. Move it back until that's sorted out...


# 6b14aaa4 16-May-2014 Warner Losh <imp@FreeBSD.org>

Read in SRCCONF early and consistently, if src.sys.mk exists, which is
should for all normal builds. Read /etc/make.conf earlier than before,
but consistently before SRCCONF and local.sys.mk.


# be4646cf 10-May-2014 Warner Losh <imp@FreeBSD.org>

Remove some useless, commented out code. Remove name space polution in
the POSIX case by moving more things under !Posix part of an if.


# e0919954 12-Apr-2014 Warner Losh <imp@FreeBSD.org>

Don't apply ctf conversions in POSIX mode. These can't happen there
because they pollute the POSIX environment, which doens't allow
for these extentions. ctf conversions are really only relevant when
used in coordination with the rest of the bsd*.mk system anyway.
Leave them in place for the normal, non-posix enviornment since
they are quite useful there.


# f1c8f60b 11-Apr-2014 Dag-Erling Smørgrav <des@FreeBSD.org>

Introduce RANLIBFLAGS to mirror ARFLAGS and add -D to both. This sets
all timestamps in static libraries to 0 so that consecutive builds
from the same source, even on different machines, produce identical
libraries.

MFC after: 3 weeks


# 73279d41 22-Mar-2014 Andrew Turner <andrew@FreeBSD.org>

Add a new ARM TARGET_ARCH, armv6hf. This is considered experimental.

This targets the existing ARMv6 and ARMv7 SoCs that contain a VFP unit.
This is an optional coprocessors may not be present in all devices, however
it appears to be in all current SoCs we support.

armv6hf targets the VFP variant of the ARM EABI and our copy of gcc is too
old to support this. Because of this there are a number of WITH/WITHOUT
options that are unsupported and must be left as the default value. The
options and their required value are:
* WITH_ARM_EABI
* WITHOUT_GCC
* WITHOUT_GNUCXX

In addition, without an external toolchain, the following need to be left
as their default:
* WITH_CLANG
* WITH_CLANG_IS_CC

As there is a different method of passing float and double values to
functions the ABI is incompatible with existing armv6 binaries. To use
this a full rebuild of world is required. Because no floating point values
are passed into the kernel an armv6 kernel with VFP enabled will work with
an armv6hf userland and vice versa.


# a0f1aa83 27-Aug-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Use .SHELL to tell bmake to use 'set -e' when running scripts
since most FreeBSD makefiles it is in effect.

Move the other bmake compatability knobs out of the POSIX block.

Reviewed by: obrien


# 2f466a97 23-Jun-2013 Eitan Adler <eadler@FreeBSD.org>

Remove variable added by ru@ in r94940 that is no longer used by source or ports in share/mk/sys.mk

PR: conf/155737
Reviewed by: ed (two years ago!)
Exp-Run by: bdrewery


# b37be1a5 14-Jun-2013 Simon J. Gerraty <sjg@FreeBSD.org>

We cannot remove the _+_ trick, until old make is completely deprecated.
But we don't want to set it to + for bmake since it breaks make -N
which is used to supress the normal handling of targets marked with .MAKE
(which seems broken in fmake and might be why _+_ was introduced).
Add some comments to explain what's gong on.

Reviewed by: obrien


# d58b0757 07-Jun-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Override bmake's default MAKEFILE_PREFERENCE


# 93556e96 03-Apr-2013 Simon J. Gerraty <sjg@FreeBSD.org>

Tell bmake to use the FreeBSD preferred makefile preference list.

PR: 177593
Reviewed by: obrien


# edd42017 10-Jan-2013 Dag-Erling Smørgrav <des@FreeBSD.org>

Remove all support for legacy NOFOO and NO_FOO build options.


# 44383aa3 17-Dec-2012 Ed Maste <emaste@FreeBSD.org>

Hide OBJCOPY and others in POSIX mode

Submitted by: Garrett Cooper


# e97696b5 14-Dec-2012 Ed Maste <emaste@FreeBSD.org>

Put shared library debug info into separate .symbols file

Sponsored by: ADARA Networks


# bffa4488 05-Dec-2012 Eitan Adler <eadler@FreeBSD.org>

Change the default to 'cru' for speed reasons.

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


# 0815243c 06-Oct-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Add support for bmake. This includes:
1. Don't do upgrade_checks when using bmake. As long as we have WITH_BMAKE,
there's a bootstrap complication in ths respect. Avoid it. Make the
necessary changes to have upgrade_checks work wth bmake anyway.
2. Remove the use of -E. It's not needed in our build because we use ?= for
the respective variables, which means that we'll take the environment
value (if any) anyway.
3. Properly declare phony targets as phony as bmake is a lot smarter (and
thus agressive) about build avoidance.
4. Make sure CLEANFILES is complete and use it on .NOPATH. bmake is a lot
smarter about build avoidance and should not find files we generate in
the source tree. We should not have files in the repository we want to
generate, but this is an easier way to cross this hurdle.
5. Have behavior under bmake the same as it is under make with respect to
halting when sub-commands fail. Add "set -e" to compound commands so
that bmake is informed when sub-commands fail.
6. Make sure crunchgen uses the same make as the rest of the build. This
is important when the make utility isn't called make (but bmake for
example).
7. While here, add support for using MAKEOBJDIR to set the object tree
location. It's the second alternative bmake looks for when determining
the actual object directory (= .OBJDIR).

Submitted by: Simon Gerraty <sjg@juniper.net>
Submitted by: John Van Horne <jvanhorne@juniper.net>


# 7750ad47 22-Aug-2012 Marcel Moolenaar <marcel@FreeBSD.org>

Sync FreeBSD's bmake branch with Juniper's internal bmake branch.

Requested by: Simon Gerraty <sjg@juniper.net>


# 4da573d9 14-Aug-2012 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Merging of projects/armv6, part 3

r238211:
Support TARGET_ARCH=armv6 and TARGET_ARCH=armv6eb

This adds a new TARGET_ARCH for building on ARM
processors that support the ARMv6K multiprocessor
extensions. In particular, these processors have
better support for TLS and mutex operations.

This mostly touches a lot of Makefiles to extend
existing patterns for inferring CPUARCH from ARCH.
It also configures:
* GCC to default to arm1176jz-s
* GCC to predefine __FreeBSD_ARCH_armv6__
* gas to default to ARM_ARCH_V6K
* uname -p to return 'armv6'
* make so that MACHINE_ARCH defaults to 'armv6'
It also changes a number of headers to use
the compiler __ARM_ARCH_XXX__ macros to configure
processor-specific support routines.

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


# 6f1d6967 22-Apr-2012 Warner Losh <imp@FreeBSD.org>

Sort nm in order.

Submitted by: bde


# edfe67ea 21-Apr-2012 Warner Losh <imp@FreeBSD.org>

Fix partially merged patch from my external compiler tree in r234546.
Define NM except when we're in strict POSIX mode.


# 84db023e 28-Mar-2012 Juli Mallett <jmallett@FreeBSD.org>

Assume a big-endian default on MIPS and drop the "eb" suffix from MACHINE_ARCH.
This makes our naming scheme more closely match other systems and the
expectations of much third-party software. MIPS builds which are little-endian
should require and exhibit no changes. Big-endian TARGET_ARCHes must be
changed:
From: To:
mipseb mips
mipsn32eb mipsn32
mips64eb mips64

An entry has been added to UPDATING and some foot-shooting protection (complete
with warnings which should become errors in the near future) to the top-level
base system Makefile.


# 78e7e3ec 29-Nov-2011 Max Khon <fjoe@FreeBSD.org>

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


# cd49c2e8 29-Nov-2011 Max Khon <fjoe@FreeBSD.org>

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.


# cd2ae253 07-Jan-2011 Warner Losh <imp@FreeBSD.org>

Retire TARGET_ABI.

Implement MACHINE_ARCH=mips64e[lb] to build N64 images. This replaces
MACHINE_ARCH=mipse[lb] TARGET_ABI=n64.

MACHINE_ARCH=mipsn32e[lb] has been added, but currently requires
WITHOUT_CDDL due to atomic issues in libzfs. I've not investigated
this much, but implemented this to preserve as much of the TARGET_ABI
functionality that I could. Since its presence doesn't affect the
working cases, I've kept it in for now.

Added mips64e[lb] to make universe, so more kernels build.

And I think this (finally) closes the curtain on the tbemd tree.


# 5ada7d99 07-Jan-2011 Konstantin Belousov <kib@FreeBSD.org>

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


# bd4473b8 11-Nov-2010 Dimitry Andric <dim@FreeBSD.org>

Fix typo, and re-wrap paragraph.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 9a1d1150 10-Sep-2010 Rui Paulo <rpaulo@FreeBSD.org>

Add the DTRACE variable that points to the executable.

Sponsored by: The FreeBSD Foundation


# 4be3feb2 12-Aug-2010 Will Andrews <will@FreeBSD.org>

Fix buildworld -DNO_CLEAN when using with Perforce, which marks files as
read-only by default, meaning files copied can't be overwritten next time.

Reviewed by: imp
Approved by: ken (mentor)


# 3a113499 30-Jul-2010 Rui Paulo <rpaulo@FreeBSD.org>

Fix previous commit: I forgot to include parenthesis.

Submitted by: anonymous


# 8a5216d5 29-Jul-2010 Rui Paulo <rpaulo@FreeBSD.org>

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


# 13109bdf 09-Jul-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Minor modifications to know what to do with powerpc64.


# 6fc3ead1 10-Jun-2010 Warner Losh <imp@FreeBSD.org>

Merge from tbemd branch:

Introduce MACHINE_CPUARCH. Many different MACHINE_ARCHs will be built
from one MACHINE_CPUARCH. This will allow us to move to a more
standard MACHINE_ARCH for mips and arm which exist in many different
endian variants, and for powerpc where both 32 and 64 bit binaries are
generated from the same sources.

Reviewed by: arch@ (mostly silence though)


# 21edb039 02-Apr-2010 Alexander Leidinger <netchild@FreeBSD.org>

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@


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 96f2d85e 17-Feb-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Unbreak WARNS=6 builds for C++ code: -Wold-style-definition is not accepted
by the C++ compiler. Filter it out.


# 424b4e66 22-Jan-2010 Stephane E. Potvin <sepotvin@FreeBSD.org>

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


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 770ac3b2 21-May-2008 John Birrell <jb@FreeBSD.org>

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.


# fd08931d 04-Apr-2008 Warner Losh <imp@FreeBSD.org>

MFp4 (mips2-jnpr):
o Default to -O on mips as well as arm. -O2 has been strongly implicated
in many problems in the past, so we're taking a conservative approach
until the problems are well understood.


# 20c46652 02-Apr-2008 David E. O'Brien <obrien@FreeBSD.org>

PR ports/121363 (& ports/73797) has been committed, so we can now go back
to JB's revision 1.96 change to remove -fno-strict-aliasing from CFLAGS.

This makes the default CFLAGS to match the simple defaults that the
tinderboxes use. By using -fno-strict-aliasing by default we are
choosing to ignore problems in code which had the potential to
shoot ourselves in the foot.


# 92aa7717 04-Mar-2008 David E. O'Brien <obrien@FreeBSD.org>

Temporarily back out revision 1.98 to give Portmgr some time to
address PR ports/121363 (current day re-opening of PR ports/73797)
to make ports CFLAGS more independent of src/'s CFLAGS WRT aliasing.

Discussed with: brooks


# b9b48271 04-Mar-2008 David E. O'Brien <obrien@FreeBSD.org>

Back out revision 1.97, which backed out part of revision 1.96.
Change the default CFLAGS to match the simple defaults that the
tinderboxes use. By using -fno-strict-aliasing by default we are
choosing to ignore problems in code which had the potential to
shoot ourselves in the foot.


# 221a97c1 26-Nov-2007 John Birrell <jb@FreeBSD.org>

Although the entire src tree builds cleanly now without -fno-strict-aliasing
in the default CFLAGS, we're in the middle of a ports freeze, so we can't
really go making the corresponding change to the ports mk files.

I'll take -fno-strict-aliasing out again when the ports freeze ends.


# cfb5b325 22-Nov-2007 John Birrell <jb@FreeBSD.org>

Re-enable -Werror again.

This time, change the default CFLAGS to match the simple defaults that
the tinderboxes use. That is, don't use -fno-strict-aliasing by default.

My last attempt to re-anable -Werror gave me a lesson in what strict
aliasing is all about. There was code in libthr that wasn't 64-bit clean.
The default use of -fno-strict-aliasing hid that.

By using -fno-strict-aliasing by default we were choosing to ignore
problems in code which had the potential to shoot ourselves in the
foot. Sometimes it would be the 64-bit foot. I have both feet. The left
ones are 32 bits and the right ones are 64 bits. Don't ask about my
endian orientation. :-)

The -fno-strict-aliasing compiler arg can still be used if NO_STRING_ALIASING
is define in make.

We are early in the FreeBSD 8 development, so we have the opportunity to
wait and see if this works for us. I am sure that people will complain.
We can easily revert this. All I ask is that we take sides: clean code or
not. YMMV.

Note that by using -fno-strict-aliasing the build won't actually break.
Only where WARNS is set (and -Werror is used) will a compiler warning break
the build. The use of WARNS levels implies (to me at least) that the
developer has taken some care to make the code pass basic checks. This
commit makes those checks just a little bit more strict.


# c117aee5 19-Nov-2007 John Birrell <jb@FreeBSD.org>

Weed out a warning argument that isn't applicable to C++ code.


# cdc162fe 05-Nov-2007 Olivier Houchard <cognet@FreeBSD.org>

Switch arm to -O until the -O2 issues are resolved.

MFC After: 3 days


# a39cea66 27-Oct-2007 Yaroslav Tykhiy <ytykhiy@gmail.com>

Allow the shell used by make(1) to be changed early via the
__MAKE_SHELL variable. This feature isn't supposed to be in wide
use, but it's needed now to make `installworld' independent of the
stock binaries and libs so that radical ABI changes can go in safely.

Reviewed by: ru


# 179dc282 14-Aug-2007 Xin LI <delphij@FreeBSD.org>

Restore -O2 optimization after gcc 4.2.1 import, which has
fixed the issue raised by gcc 4.2.0.

Tested with: test case found in gcc bug 32500
Approved by: re (kensmith), ache, kan


# 5f308feb 01-Jul-2007 Andrey A. Chernov <ache@FreeBSD.org>

Switch to "-O1 -pipe" as cross-build compatible gcc workaround.

"Looks like Alexander chimed in with "I'm comfortable with that until we
can import a fixed GCC"."

Approved by: re (kensmith)


# cf7e2eb0 28-Jun-2007 Andrey A. Chernov <ache@FreeBSD.org>

Back out gcc workaround per re@ request. Details:
"There seems to be some continuing discussion about how this is best fixed,
and we'd like to get Alexander (as our gcc guru) to opine on a final
solution before picking one. In the mean time, could you back out the
original commit (sys.mk:1.89)?"

Approved by: re (rwatson)


# 3f5b2c26 26-Jun-2007 Andrey A. Chernov <ache@FreeBSD.org>

This is temp workaround of nasty gcc 4.2.0 -O2 bug which may skip the rest
of the loop when arrays used inside.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32500

Approved by: re (kensmith)


# eb91fad6 06-Oct-2006 Dejan Lesjak <lesi@FreeBSD.org>

Remove X11BASE from here so the one from bsd.port.mk has a chance to set
default. Grepping through src shows only gnu/usr.bin/groff which doesn't
use it in src build and OpenSSH for which this was a NOOP.

Discussed with: des, ru
Approved by: ru


# d9423c1b 28-Sep-2005 Ruslan Ermilov <ru@FreeBSD.org>

We bootstrap make(1) if necessary during an upgrade, so checking
if MACHINE_ARCH is defined is no longer needed.


# dea3d870 29-Apr-2005 Hartmut Brandt <harti@FreeBSD.org>

Toggle on warnings. This resolves the problem with building old releases
(getting zillions of warnings). Building an old release uses that release's
sys.mk which does not switch on these warnings, so make will be silent.
They can be switch on on the command line with the -x option to make.
This has been tested by building RELENG_5_4 on CURRENT.


# a63b0146 28-Apr-2005 Darren Reed <darrenr@FreeBSD.org>

IPFIlter problems that prevented building should all now be resolved so
remove this temporary measure.


# 6230360e 27-Apr-2005 Scott Long <scottl@FreeBSD.org>

Disable the IPFILTER bits until they compile again. This can be overriden
by adding WANT_IPFILTER to /etc/make.conf. Note that this is only a partial
hack and only works when building the world and kernel the 'sanctioned' way.
I hope that this hack is only temporary and can be reverted soon.


# 52dbe95f 23-Dec-2004 Ruslan Ermilov <ru@FreeBSD.org>

Include bsd.compat.mk early from sys.mk, enough for makefiles
using conditional statements to see the new spellings of NO_*
knobs (in case user still uses old spellings).

Reported by: kris


# 96b85369 10-Nov-2004 David E. O'Brien <obrien@FreeBSD.org>

Compiling with 'strict-aliasing' optimization breaks some [notable] ports.
GCC turns on 'strict-aliasing' optimization at all levels above -O[1], so
explicitly turn it off when using compiling with the -O2 optimization level.


# ecdb24f5 25-Oct-2004 Dag-Erling Smørgrav <des@FreeBSD.org>

Switch the default CFLAGS to -O2 -pipe.

Submitted by: obrien


# acabf29a 09-Aug-2004 Hartmut Brandt <harti@FreeBSD.org>

Use the '+' flag to make make recurse into sub-directories even when
given -n. For POLA reasons this behaviour is switched on only when
at least two -n flags are given to make. One -n flag keeps the old behaviour
of showing the shell command that would recurse into the sub-directories.

Discussed with: ru


# 8d962594 12-May-2004 Bruce Evans <bde@FreeBSD.org>

Moved FreeBSD build pollution (/etc/make.conf) and zombie aout support
(OBJFORMAT) into a non-POSIX section.


# 88d2251a 12-May-2004 Bruce Evans <bde@FreeBSD.org>

Removed conditional include of /etc/make.conf.local and the error for the
existence of this file. This stopped working more than 4 years ago when
the generation of the error was added in rev.1.44. The .error directive
gives fatal errors, so stale /etc/make.conf.local files must have been
gone away more than 4 years on systems where make(1) works.


# 611b4102 09-May-2004 Dag-Erling Smørgrav <des@FreeBSD.org>

-W{missing,strict}-prototypes do not make sense for C++, and gcc34 will
complain about them, so remove them from CXXFLAGS.


# d9d11bfd 20-Apr-2004 Ruslan Ermilov <ru@FreeBSD.org>

g++(1) is unhappy with -Wnested-externs.

Prodded by: des


# d17387ac 04-Feb-2004 Bruce Evans <bde@FreeBSD.org>

Fixed breakage of POSIX support in rev.1.31. -pipe was added to
CFLAGS in all cases, but POSIX requires a default of -O. Adding
-pipe unconditionally still is still broken for non-gcc compilers
in the non-POSIX case.


# 37e419a1 03-Feb-2004 Ruslan Ermilov <ru@FreeBSD.org>

A shorter version of keeping all -std= options out of CXXFLAGS.


# 65d2bdc6 27-Jan-2004 Ruslan Ermilov <ru@FreeBSD.org>

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.


# 64ba14f2 03-Oct-2003 Ruslan Ermilov <ru@FreeBSD.org>

Removed the ancient .LIBS setting that causes non-existent
libraries to be reported as up-to-date.

Before:

# make -f /dev/null nonexistent.a
`nonexistent.a' is up to date.

After:

# make -f /dev/null nonexistent.a
make: don't know how to make nonexistent.a. Stop

PR: bin/44137 (part of)


# 34d81580 26-Sep-2003 Mark Murray <markm@FreeBSD.org>

Separate out userland linting and kernel linting a bit more. This
make things a bit easier for folks using lints other than the
"base" lint.


# d58e932f 02-Jul-2003 Ruslan Ermilov <ru@FreeBSD.org>

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


# a51613b6 01-Jul-2003 Ruslan Ermilov <ru@FreeBSD.org>

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


# fdcdec57 30-Jun-2003 Ruslan Ermilov <ru@FreeBSD.org>

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


# 28c3f28e 01-Jun-2003 David E. O'Brien <obrien@FreeBSD.org>

Use a bigger hammer -- keep all -std= out of CXXFLAGS.
Also allow for "CSTD=" in a Makefile.


# 2244cda2 22-Apr-2003 Ruslan Ermilov <ru@FreeBSD.org>

Axe CXXINCLUDES from CXXFLAGS, it serves no useful purpose anymore.

Reviewed by: bde


# ccc4bab1 17-Oct-2002 Ruslan Ermilov <ru@FreeBSD.org>

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


# 5741a42f 20-Sep-2002 Mark Murray <markm@FreeBSD.org>

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.


# 66422f5b 16-Sep-2002 Peter Wemm <peter@FreeBSD.org>

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


# 72d54907 22-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

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


# e517d11e 19-Apr-2002 David E. O'Brien <obrien@FreeBSD.org>

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

Helps with: gcc31 build.


# 2bdaf7e8 17-Apr-2002 Ruslan Ermilov <ru@FreeBSD.org>

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.


# bd42830f 20-Mar-2002 Ruslan Ermilov <ru@FreeBSD.org>

Make lint(1) a cross-tool.

(See commit log for usr.bin/xlint/Makefile,v 1.11 for what was wrong
with enabling build of lint libraries in rev. 1.12.)

This fixes cross-arch compiles (running binaries for a different arch
when generating lint.7 and lint libraries) and cross-branch compiles
(4.x -> 5.0 buildworld should be working again).


# 0af93efb 18-Mar-2002 Warner Losh <imp@FreeBSD.org>

__MAKE_CONF?=/etc/make.conf
Use this where we are now using /etc/make.conf.

This allows people to override the current default of always including
/etc/make.conf. Setting __MAKE_CONF to /dev/null disables it
completely, while setting it to something else allows one to override
what is on the system. This can be desirable in situations where a
machine has many users and some of them want different defaults, or
defaults appropriate to cross building to be different than those for
normal building.

Not objected to by: arch@


# 766f7d6e 17-Mar-2002 Mark Murray <markm@FreeBSD.org>

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.


# 0d0667b5 30-Aug-2001 Alexander Langer <alex@FreeBSD.org>

Final way: Don't include /etc/defaults/make.conf at all. It wasn't
supposed to be edited by the user and didn't define important things,
thus we can just skip it (that's where it differs from the make.conf.local
change).

Submitted by: ru


# 32890b42 31-Aug-2001 Alexander Langer <alex@FreeBSD.org>

Don't .error, if /etc/defaults/make.conf exists. This breaks -CURRENT
buildworlds on a -STABLE machine.

Reminded by: ru


# d33a962d 30-Aug-2001 Alexander Langer <alex@FreeBSD.org>

Move /etc/defaults/make.conf to /usr/share/examples/etc/make.conf as
discussed on the arch@ mailinglist (after repo-copy).

sys.mk will .error if it finds /etc/defaults/make.conf but include
it anyways (this is the same behaviour as with the make.conf.local
removal).

/usr/share/examples/etc/make.conf has BDEFLAGS commented out now,
since it's only an example file.

Adjust all textes that talk about make.conf or defaults/make.conf to
match the new situation.


# 3f5a93f6 16-Jun-2001 David E. O'Brien <obrien@FreeBSD.org>

Add the ".FreeBSD" symbol so we can do things like ".if define(.FreeBSD)"
in Makefile's shared with NetBSD.


# 7b91cad9 06-Jun-2001 David E. O'Brien <obrien@FreeBSD.org>

Add the single suffix rules for FORTRAN.


# eb73cacd 06-Jun-2001 David E. O'Brien <obrien@FreeBSD.org>

Add the single suffix rules for C++.
(While there, I also moved the single suffix C rules beside the double
suffix ones so they are easier to find)

PR: 24438
Submitted by: Georg-W. Koltermann <gwk@sgi.com>


# 62d90fb7 22-Feb-2001 Kris Kennaway <kris@FreeBSD.org>

Overhaul the MACHINE_CPU behaviour:

* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:

* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.

* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.

* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.

* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.

* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).

Reviewed by: jhb, obrien


# 9cd5532f 20-Feb-2001 Kris Kennaway <kris@FreeBSD.org>

Turns out we do need to do bootstrapping of MACHINE_CPU here: make(1) won't
set the variable until you rebuild it, and the alternative is to be stuck
playing games with ``.if defined(MACHINE_CPU) && ... '' for all eternity.
We now set up the reasonable default for i386 and alpha here -- given this
it probably makes sense to remove the corresponding code from make(1).


# 4183193e 19-Feb-2001 Kris Kennaway <kris@FreeBSD.org>

Remove bogus setting of MACHINE_CPU here. There is no need for it.

Submitted by: bde


# 0937df81 18-Feb-2001 Kris Kennaway <kris@FreeBSD.org>

Introduce support for using OpenSSL ASM optimizations. This is done
through the use of a new build directive, MACHINE_CPU, which contains a
list of the CPU generations/features for which optimizations are desired.
This feature will be extended to cover the ports tree in the future.

Currently OpenSSL provides optimizations for i386, i586 and i686-class
CPUs. Currently it has not been tested on an i386 or i486.

Teach make(1) to provide sensible defaults for MACHINE_CPU if it is not
defined (namely, the lowest common denominator CPU we support for each
architecture). Currently this is i386 for the i386 architecture and ev4
for the alpha. sys.mk also sets the variable as a last resort for
consistency with MACHINE_ARCH and bootstrapping from very old versions of
make.

Benchmarks show a significant speed increase even in the i386 case, with
additional improvements for i586 and i686 systems. For maximum performance
define MACHINE_CPU=i686 i586 i386 in /etc/make.conf.

Based on a patch submitted by: Mike Silbersack <silby@silby.com>
Reviewed by: current


# e926b4ee 21-Apr-2000 Kris Kennaway <kris@FreeBSD.org>

Correct a typo


# 4111d344 27-Oct-1999 Matthew Dillon <dillon@FreeBSD.org>

make.conf is being made to conform to the /etc/defaults/ standard that
was settled on a few months ago.

Approved by: "Jordan K. Hubbard" <jkh@zippy.cdrom.com>


# 7f3dea24 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# fc936cbd 14-Sep-1998 David E. O'Brien <obrien@FreeBSD.org>

Revert to rev 1.41.
Some didn't like it.


# 30173cb8 14-Sep-1998 David E. O'Brien <obrien@FreeBSD.org>

Add ${RM} for compatability with SunOS.
Many use ${RM} in their ``clean'' targets.


# 9eb10afe 28-Aug-1998 Matthew Dillon <dillon@FreeBSD.org>

add support for /etc/make.conf.local


# b1ecf4ef 07-Aug-1998 John Birrell <jb@FreeBSD.org>

Remove the alpha specific __NETBSD_SYSCALLS from CFLAGS. This can still
be added in /etc/make.conf. Yes folks, the alpha kernel is coming to
a screen (and hopefully a disk) near you. Thanks to Doug.


# cf94fb21 03-Aug-1998 Bruce Evans <bde@FreeBSD.org>

Fixed building -current under 2.2.6 using `make world'. Moved some
recently added definitions from sys.mk to bsd.own.mk. Include the
src-relative bsd.own.mk in src/Makefile to pick up all new definitions.
Don't check that MACHINE_ARCH is defined in src/Makefile, since it is
(and should have been) guaranteed to be defined.


# e6b32a86 12-Jun-1998 Peter Wemm <peter@FreeBSD.org>

Move bsd.own.mk after make.conf, this allows BINFORMAT to be set in
/etc/make.conf - it changes LIBDIR in bsd.own.mk. Note that there are
still problems with this, individual Makefiles cannot override BINFORMAT.


# c7cbe79e 05-Jun-1998 Dmitrij Tejblum <dt@FreeBSD.org>

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

PR: 3476


# b658f1de 03-Jun-1998 John Birrell <jb@FreeBSD.org>

Fix my last commit which got caught in the cvs/cvsup cycle.
I'm told that I botched the tabs too. I'm not sure they are fixed now
because I find that rather tedious.


# a09e15f3 03-Jun-1998 John Birrell <jb@FreeBSD.org>

Uh, the NetBSD syscall define spam for alpha has to go after /etc/make.conf
so that it works all the time.


# fdea3b6b 03-Jun-1998 John Birrell <jb@FreeBSD.org>

In the case of alpha (only), more than just libc needs to know that
NetBSD syscalls are being used, so spam all compiles with the define
that indicates this.


# 5d9599c8 15-May-1998 Bruce Evans <bde@FreeBSD.org>

Oops, forgot references in previous commit.

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


# 70a6e331 15-May-1998 Bruce Evans <bde@FreeBSD.org>

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.


# 94e9e9fd 01-May-1998 Jordan K. Hubbard <jkh@FreeBSD.org>

Add -pipe to default CFLAGS. The optimization it provides is cheap
and does not require any special action on the part of the user to
take advantage of it. And no, it probably won't work with c89. Cry me
a river!


# 1ed9b1c3 23-Mar-1998 Eivind Eklund <eivind@FreeBSD.org>

Support new version of global.

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


# d1445932 20-Feb-1998 Bruce Evans <bde@FreeBSD.org>

Don't pass the undocumented flags `-se' to gtags (gtags ignores them for
compatibility).


# 5ec0ebbb 20-Jan-1998 John Birrell <jb@FreeBSD.org>

FreeBSD's make knows about the MACHINE, but not the MACHINE_ARCH unless
it is built with this defined (which it isn't by default). This change
to sys.mk treats the absence of MACHINE_ARCH as i386 on the assumption
that it will be appropriately defined (as something else) on any other
architecture. When building FreeBSD's make with NetBSD tools, both
MACHINE and MACHINE_ARCH are correctly set (e.g. when bootstrapping
FreeBSD's make on NetBSD/mvme68k, MACHINE=mvme68k and
MACHINE_ARCH=m68k). This isn't really needed for the alpha which
has both defined as 'alpha', but I thought it was worth getting the
distinction between a MACHINE and a MACHINE_ARCH correct now.

Now, shouldn't PC98 have MACHINE=pc98 and MACHINE_ARCH=i386 ??!!


# 5bd65ce6 12-Jan-1998 John Birrell <jb@FreeBSD.org>

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


# e782d0b5 05-Sep-1997 Peter Wemm <peter@FreeBSD.org>

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.


# 3ec75cc6 05-Sep-1997 Peter Wemm <peter@FreeBSD.org>

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.


# 8c05a446 30-Aug-1997 Peter Wemm <peter@FreeBSD.org>

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! :-)


# 6eb5e456 13-Apr-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Support GLOBAL style tags.


# b97fa2ef 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

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.


# c3e3432c 11-Jan-1997 Steve Price <steve@FreeBSD.org>

Revert changes to make the .y.c rule 'make -j n' safe.


# e10e3950 05-Jan-1997 Steve Price <steve@FreeBSD.org>

Make the .y.c rule 'make -j n' friendly.

Inspired by: bde and brian@mediacity.com


# 32b97f0b 06-Nov-1996 Alexander Langer <alex@FreeBSD.org>

Style changes: $(...) --> ${...}, consistent placement of -c.

Suggested by: bde (via steve)


# 2be2be74 02-Nov-1996 Steve Price <steve@FreeBSD.org>

Add in POSIX 1003.2 mandated rules. NOTE: these
will only be enabled when the first non-comment line
of the Makefile contains the .POSIX directive.

Submitted by: Joerg Wunsch <joerg@freebsd.org>


# 006f5fe0 02-Jun-1996 Poul-Henning Kamp <phk@FreeBSD.org>

Back out yacc change.


# b2e2fd28 30-May-1996 Poul-Henning Kamp <phk@FreeBSD.org>

Make the yacc rules reentrant
Suggested by: peter


# 50ef9020 28-May-1996 Poul-Henning Kamp <phk@FreeBSD.org>

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


# 4a6a373a 09-May-1996 Poul-Henning Kamp <phk@FreeBSD.org>

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


# 9e6778d4 23-Mar-1996 Wolfram Schneider <wosch@FreeBSD.org>

delete ``.if ${MACHINE} == "sparc"''


# a9076ea0 20-Oct-1995 Bruce Evans <bde@FreeBSD.org>

Add `.sh' suffix and rule.

Enable `.c' rule. (Null suffix rules were disabled because of bugs in old
versions of make.)

Add ${LDFLAGS} to all rules that involve linking.


# 5a5088f1 11-Aug-1995 David Greenman <dg@FreeBSD.org>

Changed default optimization from -O2 back to -O...gcc 2.6.* has serious
bugs when using -O2.


# c7499507 27-Dec-1994 Andrey A. Chernov <ache@FreeBSD.org>

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


# 957c6635 06-Nov-1994 Poul-Henning Kamp <phk@FreeBSD.org>

Update make.conf and sys.mk to reflect the most recent advances in
civilization: Use -O2 and MSUN as default, and X11 is in /usr/X11R6


# ea569569 01-Oct-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

Add .S to SUFFIXES and add .S.o: rule.
Submitted by: bde


# 7199b091 07-Sep-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

The .c: rule added by Bruce, but as yet unused, causes serious problems
for the 1.1.5 FreeBSD make. For now just comment it out until a fix for
make can be found.

Reviewed by: bde
Submitted by: rgrimes


# 74a3c654 03-Sep-1994 Jordan K. Hubbard <jkh@FreeBSD.org>

Add an X11BASE variable that currently points to /usr/X386 but will
be easy to change to /usr/X11R6 if and when the time comes. This is
to deal with things like xditview which otherwise had hardcoded assumptions
about where X lived. Yuck.
Submitted by: jkh


# 443dced5 30-Aug-1994 Paul Richards <paul@FreeBSD.org>

Changed g++ to c++
Reviewed by:
Submitted by:


# 415bccaa 28-Aug-1994 Bruce Evans <bde@FreeBSD.org>

Recover improvements in 4.4lite version that were clobbered by the
previous commit:
+ Everything is initialized using ?= instead of =.
+ Nicer formatting (more white space).
+ .c: rule.

Add macros ECHO and ECHODIR. Both are normally `echo', but when
the make flags include -s, ECHO is set to `true' and when the make
flags include two or more -s's ECHODIR is set to `true'. @${ECHO}
should be used instead of @echo in most cases. ${ECHODIR} is
intended to be used mainly for messages about directory names.


# 3585b293 04-Aug-1994 Garrett Wollman <wollman@FreeBSD.org>

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.


# afe61c15 30-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Share Sources