Commit Graph

192 Commits

Author SHA1 Message Date
lukem 130ab7336b Rework how MAKEVERBOSE operates:
*	Don't bother prefixing commands with a line of  ${_MKCMD}\
	and instead rely upon "make -s".  This is less intrusive on
	all the Makefiles than the former.  Idea from David Laight.

    *	Rename the variables use to print messages.  The scheme now is:
	    _MKMSG_FOO		Run  _MKMSG 'foo'
	    _MKTARGET_FOO	Run  _MKMSG_FOO ${.TARGET}
	From discussion with Alistair Crooks.
2003-10-21 10:01:19 +00:00
lukem 4ccb31e74a Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} "  ...  {$.TARGET}"  and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO
2003-10-19 03:00:55 +00:00
lukem 03b6213598 Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
    0	Minimal output ("quiet")
    1	Describe what is occurring
    2	Describe what is occurring and echo the actual command ("verbose")
	This is the default, and is equivalent to the previous behaviour.
2003-10-18 15:33:59 +00:00
lukem 0f9e6cf359 Add LIBSTDCXX (for usr/lib/libstdc++.a).
Sync LIB* documentation with reality.
2003-09-29 01:06:37 +00:00
martin 57b44eed3f Drop explicit medlow model and default to -O2 for sparc64. 2003-09-19 16:32:10 +00:00
lukem e71fc1cc14 Check ${SHLIBDIR} against "/usr/lib" instead of ${LIBDIR} when determining
if we need to add stuff (usually "/lib") to the rpath-link path before
"/usr/lib".  Otherwise, this barfs if LIBDIR != /usr/lib or /lib, and
we're cross-building (e.g., in src/x11)
2003-09-14 22:36:55 +00:00
erh 552531a249 Also support per-program LDFLAGS and LDSTATIC. 2003-09-13 03:44:20 +00:00
erh 056a75c41e Create a way to add additional flags to COPTS, CPPFLAGS, CXXFLAGS and LDADD
for particular libraries or programs by specifying the additions in mk.conf
instead of needing to go edit individual Makefiles.
2003-09-13 02:52:05 +00:00
lukem 7be275a0ed add infrastructure to support reach-over builds of xsrc 2003-09-12 07:44:10 +00:00
dsl a33723f245 Add a ${PROG}.ro target that does an 'ld -r' of the program object files.
Allows a much simplified build of 'crunched' binaries since crunchgen can
build prog.ro instead of having to deretmine the names of all the .o files.
2003-08-22 19:17:00 +00:00
lukem a93ea220fc Rework how dependency generation is performed:
* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
  This is a change of behaviour.  If a Makefile wants the clean semantics
  it must specifically append to CLEANFILES.
  Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
  that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d  depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
2003-08-01 17:03:41 +00:00
lukem e1ba5f323e simplify the ${PROG}: target to reduce duplication between the DESTDIR
and !DESTDIR cases...
2003-08-01 13:08:35 +00:00
lukem a504cd2911 bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.
2003-07-31 13:47:32 +00:00
lukem 6874712934 Don't need -R/usr/lib; it will be searched at the end by ld.elf_so anyway.
Noted by matt green <mrg@>
2003-07-31 06:31:38 +00:00
lukem 5aab21f43a be consistent when adding *.y and *.l to DPSRCS 2003-07-28 23:54:24 +00:00
lukem cc73d5607b replace MKCXXSUPCXX(!=no) with USE_LIBSTDCXX(==no) 2003-07-28 08:53:53 +00:00
lukem 0b96e890ae Change defined(CXX_SUPCXX) to MKCXXSUPCXX != "no".
Clarify that command-line overrides of the MKxxx variables should be
done via the environment rather than make(1) command-line variable
assignment, since the latter doesn't actually work as intended.
2003-07-28 07:03:43 +00:00
mrg 96d9a01177 introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes.  for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)
2003-07-27 14:49:22 +00:00
mrg badf45a38b add a new bsd.own.mk variable: CXX_SUPCXX. from bsd.README:
+ CXX_SUPCXX    If defined, the support libraries needed for this C++ program
+               are set to `-lsupc++ -lm', rather than `-lstdc++ -lm'.
2003-07-26 14:58:10 +00:00
lukem b6bdfc6774 Consistently support the different C++ file extensions: .cc .cpp .cxx .C
Noted by Andrew White in PR toolchain/18246
2003-07-20 17:01:58 +00:00
lukem f134f3dc38 Add MKUNPRIVED; if not no has the same semantics as if UNPRIVED was defined.
Replace defined(UNPRIVED) tests with ${MKUNPRIVED} != "no"

Add MKUPDATE; if not no has the same semantics as if UPDATE was defined.
Replace defined(UPDATE) tests with ${MKUPDATE} != "no"

Improve documentation for these and other make flags.
2003-07-18 08:26:01 +00:00
itojun e26b0e0cf5 stop installing install libtelnet. build under lib/libtelnet and reference
it from usr.bin/telnet and libexec/telnetd.
(reason for separate build: compiler flags)
2003-07-16 05:42:01 +00:00
drochner 03caf45b83 For consistency, use "-R" instead of "-Wl,-rpath" to pass
a runtime search path to the linker.
2003-06-27 17:30:16 +00:00
itojun ded3919389 define LIBEVENT 2003-06-13 04:04:18 +00:00
msaitoh 535480c5be catch signal 1,2,3,13 and 15 to clean /tmp/_dependXXX 2003-06-11 04:56:58 +00:00
thorpej 000836e000 If EXTERNAL_TOOLCHAIN is defined, allow the compiler to define the
location of crt{begin,end}{,S}.o and libgcc.a.  Encapsulate all of
this logic into the new bsd.gcc.mk, and use it in bsd.prog.mk and
bsd.lib.mk.
2003-05-31 20:33:15 +00:00
lukem 03a26b2c80 make this a no-op if HOSTPROG is defined 2003-05-18 07:36:23 +00:00
thorpej 44d9add676 If MACHINE_ARCH is powerpc and we HAVE_GCC3, add crtsaveres.o to the
endfile spec.
2003-03-30 00:35:07 +00:00
uwe c18a5386dc Typo in comment. 2003-02-22 04:46:08 +00:00
thorpej 14dfb2cab0 Add LIBPTHREAD, LIBPTHREAD_DB, and LIBRT. 2003-01-24 02:06:37 +00:00
thorpej 6dba3a7439 Split crtbegin/crtend into crti/crtbegin/crtend/crtn. NetBSD-specific
things like the .note.netbsd.ident section are provided by crti/crtn.
crti/crtn also provide the _init() and _fini() routines.

crtbegin/crtend now only provide support for ctors/dtors.  This paves
the way to using the "crtstuff" provided with GCC (when we upgrade to
GCC 3.3), which provides, among other things, much better C++/Java
exception handling.
2002-11-22 06:44:56 +00:00
itohy cbb1f0fb0f MKDYNAMICROOT for a.out 2002-11-12 14:33:48 +00:00
perry 8885724457 Pass 1 of SYSPKG changes to automatically add tags=pkgname_pkg to METALOG.
Not quite ready for prime time yet.
2002-10-22 18:48:27 +00:00
thorpej 09a0767aa9 Only use the MKDYNAMICROOT semantics (i.e. -rpath=/lib,/usr/lib and
-dynamic-linker=/libexec/ld.elf_so) if the BINDIR of the program being
built is /bin or /sbin.

The reason we do this is because now all programs *except* those in
/bin and /sbin (i.e. the "special cases") match the default the compiler
uses, which is what is used for things in e.g. xsrc, pkgsrc, and other
random 3rd party programs.

This is done by decoupling where a shlib is installed from how it
is located.  Two new variables, SHLIBINSTALLDIR and SHLINKINSTALLDIR,
contain the former information, and key off MKDYNAMICROOT only.  SHLIBDIR
and SHLINKDIR contain the latter, and key off MKDYNAMICROOT and BINDIR.

The SHLIBINSTALLDIR, SHLIBDIR, _LIBSODIR, SHLINKINSTALLDIR, and
SHLINKDIR parameters are moved to a new <bsd.shlib.mk>; see bsd.README
for usage details.
2002-09-27 21:37:50 +00:00
itojun d24389cf67 MDC2 is a patented algorithm; don't ship it in default libcrypto.
MKCRYPTO_MDC2 will build a separate library, libcrypto_mdc2.
2002-09-26 13:05:54 +00:00
thorpej 3e19f8e1f0 Build a .gdbinit in the objdir when building a program. The .gdbinit
file sets the shared library prefix to ${DESTDIR}, and adds "sources"
directives for each file listed in the GDBINIT Makefile variable.
2002-09-08 03:59:02 +00:00
thorpej 364a2bbe9c Add LIBPMC. 2002-08-09 00:21:22 +00:00
eeh f0a7e18ff6 Use the medium low model for sparc64 programs that don't 2GB of data segment. 2002-03-27 05:40:54 +00:00
mycroft 09819b05ef Don't use .PHONY for targets that are actually installed. Instead use force
dependencies.  (Among other things, `make -t install' does something vaguely
sensible now.)
2002-02-11 21:14:58 +00:00
pk 9d602b9ca3 Mark installed system libraries as .MADE only if we're actually establishing
their default variable values here.
2002-02-07 07:43:24 +00:00
christos e7f0a97835 s/.NOSUFF/.MADE/ 2002-02-04 17:25:44 +00:00
christos 944602ca01 Apply a .NOSUFF: directive to targets we don't want to have processed by
the suffix rules engine.
2002-02-03 21:40:14 +00:00
veego e2e1706f05 Ups, it is LIBUSBHID and not LIBUSBHIB. 2002-02-02 16:54:26 +00:00
veego 3de557e57f Change LIBUSB to LIBUSBHIB, reflecting the library name change. 2002-02-02 16:49:52 +00:00
enami d85411d9e1 Mark the targets clean{extra,objs} as PHONY. 2002-01-29 03:09:54 +00:00
thorpej 5da850da23 For PROG_CXX DESTDIR builds, pull in -lstdc++ and -lm regardless
of GCC version.
2002-01-04 19:07:18 +00:00
thorpej d68ee9d8e3 Per a suggestion from matthew green, PROG_CXX takes the place of
PROG for C++ programs.
2002-01-01 01:38:25 +00:00
thorpej 04520355fe * If PROG_CXX is set by the program's Makefile, use ${CXX} to link
the program rather than ${CC}.
* If HAVE_GCC3 is defined, pull in "-lstdc++ -lm" as additional C++
  support libraries for DESTDIR builds.
2002-01-01 00:27:06 +00:00
lukem efcc9a4c9d * Add user-controlled mk.conf variables
- SHLIBDIR	Location to install shared libraries if ${USE_SHLIBDIR}
			is "yes".  Defaults to "/usr/lib".

	- USE_SHLIBDIR	If "yes", install shared libraries in ${SHLIBDIR}
			instead of ${LIBDIR}.  Defaults to "no".
			Sets ${_LIBSODIR} to the appropriate value.
			This may be set by individual Makefiles as well.

	- SHLINKDIR	Location of shared linker.  Defaults to "/usr/libexec".
			If != "/usr/libexec", change the dynamic-linker
			encoded in shared programs

* Set USE_SHLIBDIR for libraries used by /bin and /sbin:
	libc libcrypt libcrypto libedit libipsec libkvm libm libmi387
	libtermcap libutil libz

* If ${_LIBSODIR} != ${LIBDIR}, add symlinks from ${LIBDIR}/${LIB}.so*
  to ${_LIBSODIR}/${LIB}.so* for compatibility.

* Always install /sbin/init statically (for now)


The net effect of these changes depends on how the variables are set:

  1.)	If nothing is set or changed, there is no change from the
	current behaviour:
		- Static /bin, /sbin, and bits of /usr/*
		- Dynamic rest
		- Shared linker is /usr/libexec/ld*so

  2.)	If the following make variables are set:
		LDSTATIC=
		SHLINKDIR=/lib
		SHLIBDIR=/lib
	Then the behaviour becomes:
		- Dynamic tools
		- .so libraries used by /bin and /sbin are installed to /lib,
		  with symlinks from /usr/lib/lib*so to -> /lib/lib*so
		  where appropriate
		- Shared linker is /lib/ld*so

  3.)	As per 2.), but add the following variable:
		USE_SHLIBDIR=yes
	This forces all .so's to be instaleld in /lib (with compat
	symlinks), not just those tagged by their Makefiles to be.
	Again, compat symlinks are installed
2001-12-28 01:32:37 +00:00
tv 4a1ad2db60 If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.
2001-11-28 04:38:29 +00:00