Commit Graph

129 Commits

Author SHA1 Message Date
Bruce Evans
8d962594e1 Moved FreeBSD build pollution (/etc/make.conf) and zombie aout support
(OBJFORMAT) into a non-POSIX section.
2004-05-12 22:53:52 +00:00
Bruce Evans
88d2251a91 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.
2004-05-12 21:51:11 +00:00
Dag-Erling Smørgrav
611b4102ed -W{missing,strict}-prototypes do not make sense for C++, and gcc34 will
complain about them, so remove them from CXXFLAGS.
2004-05-10 12:14:18 +00:00
Ruslan Ermilov
d9d11bfd48 g++(1) is unhappy with -Wnested-externs.
Prodded by:	des
2004-04-20 15:16:07 +00:00
Bruce Evans
d17387acd4 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.
2004-02-04 14:40:44 +00:00
Ruslan Ermilov
37e419a131 A shorter version of keeping all -std= options out of CXXFLAGS. 2004-02-03 09:40:11 +00:00
Ruslan Ermilov
65d2bdc62c 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.
2004-01-27 23:22:15 +00:00
Ruslan Ermilov
64ba14f2c7 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)
2003-10-03 20:47:37 +00:00
Mark Murray
34d8158078 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.
2003-09-26 17:49:25 +00:00
Ruslan Ermilov
d58e932f04 Don't trust sys.mk,v 1.61 commit log, and make .asm alias for .S. 2003-07-02 17:03:28 +00:00
Ruslan Ermilov
a51613b6da 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
2003-07-01 15:15:45 +00:00
Ruslan Ermilov
fdcdec572a Propagate the ${AINC} knob (assembler include) to sys.mk,
and remove the .S.o transformation rule from bsd.lib.mk.
2003-06-30 20:02:46 +00:00
David E. O'Brien
28c3f28e32 Use a bigger hammer -- keep all -std= out of CXXFLAGS.
Also allow for "CSTD=" in a Makefile.
2003-06-01 22:13:45 +00:00
Ruslan Ermilov
2244cda2bc Axe CXXINCLUDES from CXXFLAGS, it serves no useful purpose anymore.
Reviewed by:	bde
2003-04-22 11:04:25 +00:00
Ruslan Ermilov
ccc4bab104 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
2002-10-17 13:48:13 +00:00
Mark Murray
5741a42f2f 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.
2002-09-20 19:32:51 +00:00
Peter Wemm
66422f5b7a 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
2002-09-17 01:49:00 +00:00
Ruslan Ermilov
72d5490744 Make .asm transformation rules synonyms to the .s rules. 2002-04-22 08:56:34 +00:00
David E. O'Brien
e517d11e8d Add .asm as an alias for .s. .asm is common in contribed sources.
Helps with:	gcc31 build.
2002-04-19 18:01:03 +00:00
Ruslan Ermilov
2bdaf7e81c 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.
2002-04-17 13:49:29 +00:00
Ruslan Ermilov
bd42830f0f 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).
2002-03-20 18:25:50 +00:00
Warner Losh
0af93efb4d __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@
2002-03-18 07:39:27 +00:00
Mark Murray
766f7d6e03 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.
2002-03-17 10:05:57 +00:00
Alexander Langer
0d0667b51b 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
2001-08-31 12:20:43 +00:00
Alexander Langer
32890b4216 Don't .error, if /etc/defaults/make.conf exists. This breaks -CURRENT
buildworlds on a -STABLE machine.

Reminded by:	ru
2001-08-31 11:18:24 +00:00
Alexander Langer
d33a962d07 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.
2001-08-30 22:44:51 +00:00
David E. O'Brien
3f5a93f6d3 Add the ".FreeBSD" symbol so we can do things like ".if define(.FreeBSD)"
in Makefile's shared with NetBSD.
2001-06-16 07:27:23 +00:00
David E. O'Brien
7b91cad987 Add the single suffix rules for FORTRAN. 2001-06-06 16:58:08 +00:00
David E. O'Brien
eb73cacd43 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>
2001-06-06 16:51:38 +00:00
Kris Kennaway
62d90fb793 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
2001-02-22 11:14:25 +00:00
Kris Kennaway
9cd5532f9c 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).
2001-02-20 08:37:51 +00:00
Kris Kennaway
4183193e52 Remove bogus setting of MACHINE_CPU here. There is no need for it.
Submitted by:	bde
2001-02-19 23:33:13 +00:00
Kris Kennaway
0937df81ca 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
2001-02-19 03:59:05 +00:00
Kris Kennaway
e926b4ee29 Correct a typo 2000-04-21 23:51:58 +00:00
Matthew Dillon
4111d344ce 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>
1999-10-27 19:24:49 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
David E. O'Brien
fc936cbd13 Revert to rev 1.41.
Some didn't like it.
1998-09-15 05:24:01 +00:00
David E. O'Brien
30173cb8aa Add ${RM} for compatability with SunOS.
Many use ${RM} in their ``clean'' targets.
1998-09-14 09:22:04 +00:00
Matthew Dillon
9eb10afece add support for /etc/make.conf.local 1998-08-29 01:30:13 +00:00
John Birrell
b1ecf4ef4b 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.
1998-08-08 02:08:37 +00:00
Bruce Evans
cf94fb2124 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.
1998-08-03 08:28:14 +00:00
Peter Wemm
e6b32a86af 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.
1998-06-12 10:52:52 +00:00
Dmitrij Tejblum
c7cbe79e18 Recognize ".cpp" as a C++ suffix.
PR:		3476
1998-06-05 18:38:55 +00:00
John Birrell
b658f1dec8 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.
1998-06-03 22:07:26 +00:00
John Birrell
a09e15f35c Uh, the NetBSD syscall define spam for alpha has to go after /etc/make.conf
so that it works all the time.
1998-06-03 08:51:39 +00:00
John Birrell
fdea3b6b0f 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.
1998-06-03 08:07:31 +00:00
Bruce Evans
5d9599c863 Oops, forgot references in previous commit.
Submitted by:	Brian Cully <shmit@erols.com>
PR:		6178
1998-05-15 09:34:48 +00:00
Bruce Evans
70a6e3314e 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.
1998-05-15 09:30:13 +00:00
Jordan K. Hubbard
94e9e9fdc2 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!
1998-05-01 11:36:59 +00:00
Eivind Eklund
1ed9b1c368 Support new version of global.
Submitted by:	Shigio Yamaguchi <shigio@wafu.netgate.net>
Tested by:	make buildworld
1998-03-23 14:58:30 +00:00
Bruce Evans
d14459324d Don't pass the undocumented flags `-se' to gtags (gtags ignores them for
compatibility).
1998-02-20 15:27:03 +00:00
John Birrell
5ec0ebbb0d 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 ??!!
1998-01-21 01:03:51 +00:00
John Birrell
5bd65ce6ad Choose the default binary format based on machine type.
Alpha is elf, not aout.
1998-01-13 06:00:56 +00:00
Peter Wemm
e782d0b55d 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.
1997-09-05 11:45:15 +00:00
Peter Wemm
3ec75cc6df 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.
1997-09-05 09:09:56 +00:00
Peter Wemm
8c05a446bf 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! :-)
1997-08-30 23:23:18 +00:00
Jordan K. Hubbard
6eb5e456f1 Support GLOBAL style tags. 1997-04-13 06:44:25 +00:00
Peter Wemm
b97fa2ef50 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
Jordan K. Hubbard
1130b656e5 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.
1997-01-14 07:20:47 +00:00
Steve Price
c3e3432cd3 Revert changes to make the .y.c rule 'make -j n' safe. 1997-01-12 04:01:25 +00:00
Steve Price
e10e3950fa Make the .y.c rule 'make -j n' friendly.
Inspired by: bde and brian@mediacity.com
1997-01-06 02:07:35 +00:00
Alexander Langer
32b97f0b55 Style changes: $(...) --> ${...}, consistent placement of -c.
Suggested by:	bde (via steve)
1996-11-07 01:46:47 +00:00
Steve Price
2be2be749b 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>
1996-11-03 03:25:50 +00:00
Poul-Henning Kamp
006f5fe068 Back out yacc change. 1996-06-02 17:04:08 +00:00
Poul-Henning Kamp
b2e2fd2801 Make the yacc rules reentrant
Suggested by:	peter
1996-05-30 20:39:45 +00:00
Poul-Henning Kamp
50ef9020fd Avoid a ton of "mv" when making libs by using -O to ld.
Make lex rules reentrant.
1996-05-28 16:20:13 +00:00
Poul-Henning Kamp
4a6a373a1c Make some rules reentrant, and mark the onces that cannot be. 1996-05-09 13:01:44 +00:00
Wolfram Schneider
9e6778d48f delete ``.if ${MACHINE} == "sparc"'' 1996-03-24 00:02:38 +00:00
Bruce Evans
a9076ea0bc 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.
1995-10-21 12:46:02 +00:00
David Greenman
5a5088f183 Changed default optimization from -O2 back to -O...gcc 2.6.* has serious
bugs when using -O2.
1995-08-11 11:47:30 +00:00
Andrey A. Chernov
c74995075b Move INSTALL?=install line duplicated into each .mk to sys.mk
instead
1994-12-28 03:51:03 +00:00
Poul-Henning Kamp
957c663526 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
1994-11-07 04:18:04 +00:00
Rodney W. Grimes
ea56956912 Add .S to SUFFIXES and add .S.o: rule.
Submitted by:	bde
1994-10-02 05:12:46 +00:00
Rodney W. Grimes
7199b0911b 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
1994-09-07 06:52:25 +00:00
Jordan K. Hubbard
74a3c65468 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
1994-09-04 02:52:27 +00:00
Paul Richards
443dced56c Changed g++ to c++
Reviewed by:
Submitted by:
1994-08-31 03:57:32 +00:00
Bruce Evans
415bccaa8d 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.
1994-08-28 14:56:07 +00:00
Garrett Wollman
3585b293d1 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.
1994-08-04 21:09:27 +00:00
Rodney W. Grimes
afe61c1516 BSD 4.4 Lite Share Sources 1994-05-30 19:09:18 +00:00