Commit Graph

212 Commits

Author SHA1 Message Date
mycroft 3e13200b73 Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.
2000-01-22 19:31:00 +00:00
abs a4cc9c62f3 remove duplicate += of OBJS, introduced in 1.158 - fixes PR #8487 2000-01-17 18:37:23 +00:00
simonb 3047c747cf Add a MKPICLIB variable. If set to "no", don't build an _pic.a library
and build shared objects from the .a library.  A symlink is installed
in /usr/lib so that the name "libfoo_pic.a" still exists for third party
software that explicitly wants an _pic.a library.
1999-11-28 04:50:41 +00:00
perry 9ad44ce879 Add a "dependall" target, which does a "make depend" and then "make all"
in a single directory. This is useful in "make build" because by doing
the build immediately after the depend, all sources will typically
still be in the buffer cache, thus saving significant time over doing
a "make depend" on all the directories and then a "make all".
1999-09-14 01:31:11 +00:00
christos 3d2671a09d sort the object file build so that we get better buffer cache behavior.
[from perry, with fixes from me]
1999-09-12 00:31:34 +00:00
fredb 1008436afc Permit "make all install", as well as "make foo install" (where foo would be
installed by "make install") without setting of BUILD. All cases where BUILD
is already set are unchanged from the old behavior.

"make all install" is now practically equivalent to "make BUILD= all install",
but without actually setting build.

Fixes pr's 8313, 3894.
1999-09-04 21:48:33 +00:00
simonb 7987e3b34d Add ${INSTPRIV} to ${INSTALL} commands. 1999-08-21 06:17:45 +00:00
wrstuden 5b112fce77 Re-arrange location of "-nostdlib" in DESTDIR case so that cross-ld's
won't name the output file "stdlib".
1999-07-14 20:18:07 +00:00
simonb 3a3605e823 Use ${SHLIB_VERSION_FILE} as the location of the shared library version
file.  Pass this to checkver with the new -v option as well.
1999-06-10 00:40:05 +00:00
christos 11cfd21df0 Don't strip symbols if -g is specified. We might want to be able to debug
libraries!
1999-06-07 01:37:00 +00:00
fair e1134b1863 Patched per PR 7283; this causes shared libraries which depend on
other shared libraries to load against the ones just built when
DESTDIR is set (i.e. -L${DESTDIR}${LIBDIR} ), rather than what's
installed in /usr/lib (previous behavior definitely violated the
Principle of Least Astonishment!).
1999-03-30 09:30:43 +00:00
drochner cf3c9d73cd add missing parts of the "mips"->"mipse?" transition 1999-02-24 14:42:36 +00:00
christos 7054064487 Add sparc/elf bits. 1999-02-14 19:12:09 +00:00
lukem 41510f9a2b for MKSHARE=no, set MKDOC=no MKMAN=no MKNLS=no, and for MKMAN=no, set
MKCATPAGES=no.  this simplifies various tests.
1999-02-12 12:38:44 +00:00
lukem 497d11782a * Add support for MKDOC MKLINKLIB MKLINT MKMAN MKNLS MKOBJ MKPIC MKPICINSTALL
MKPROFILE MKSHARE, which default to `yes' unless an equivalent NOxxx
  variable is defined.
* Add MKCATPAGES, which if "no" prevents catpages from being built or installed

Users should use "MKxxx=no" instead of "NOxxx=" in /etc/mk.conf, because
this allows easy override on the make(1) command line (e.g 'make MKSHARE=yes'
to override MKSHARE=no in /etc/mk.conf).
1999-02-12 01:10:06 +00:00
christos f16578a952 PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added ${RENAME} flag to install, which when set
to -r installs on a temporary file and then renames to the final destination.
${RENAME} is currently set to nothing in bsd.own.mk, but one can turn it
on in /etc/mk.conf.
1999-02-04 11:58:30 +00:00
thorpej adab608611 When installing a shared library, run /sbin/ldconfig -m ${LIBDIR} if
DESTDIR is not set and the object format is a.out.
1998-12-02 22:52:21 +00:00
erh 36f7c92000 Don't do the version check if we can't find the script. 1998-11-30 23:34:44 +00:00
erh 792cde2d0d Add ability to use either a file or the sets files when checking library version numbers. Added -d, -s and -f flags for check dir, check sets and check file. Suggested by Simon Burge. 1998-11-12 05:39:45 +00:00
erh 14b0d1f276 Add a checkver target to bsd.lib.mk. This target executes the checkver script to find installed shared libraries with major/minor versions that are too big. The realinstall target now depends upon this target so this check is done whenever a library is installed. The check may be disabled by setting NOCHECKVER. 1998-11-07 09:40:35 +00:00
jonathan e66cc6b3b1 Set SHLIB_LD{START,END}FILE to crt{begin,end}S.o for all ELF ports. 1998-11-05 00:52:02 +00:00
wrstuden 922332701f Make lintlib generation work with PATH'd source. We should pull in the
real source, not the implied names, so that we find things we PATH in from
other directories.
1998-10-07 17:49:15 +00:00
christos ddb60058ff Use preserve flag in install. 1998-09-28 08:13:37 +00:00
tv 1428a599bf Rethink the origins of LDSTATIC. Instead, use an option NOLINKLIB, which
builds and installs only what is necessary to link and run binaries, when
the library is not externally useable.
- NOPIC: Create and link against a static library.
- PIC: Create, link against, and install a shared object.
- PIC+LDSTATIC: Create and link against a static library; create and
  install a shared object.
1998-09-13 23:25:18 +00:00
tv aefeb9110b Fix the .c.a brokenness with libbfd the "right" way - nuke everything but
*o from .ALLSRC.
1998-08-22 18:59:40 +00:00
lukem 24bd0530c9 add distclean as a synonym for cleandir 1998-08-09 14:46:19 +00:00
christos 62017450ca fix lint library rule bug; use ${.ALLSRC} as suggested. 1998-05-02 15:19:04 +00:00
tv 8ab6713503 Fix symlinks creation in the build directory: create the symlinks there,
not in ${DESTDIR}.
1998-04-17 13:34:55 +00:00
tv aea014c22a Braindead pmake conditionals. 1998-04-15 12:07:10 +00:00
tv 820dd24a68 Create the ELF symbolic links in the build tree, too. Needed for libamu
and egcs libcc1 to make sure linking is done against the correct shared
object.
1998-04-15 02:39:53 +00:00
tv 7484409ac2 Compare ${LDSTATIC} against ""; don't check for definition. Make this
DTRT on setups with a global setting of LDSTATIC= (nothing)
1998-04-15 01:38:27 +00:00
tv c97729d6b8 Also build a static library regardless of NOSTATICLIB if LDSTATIC is
defined.  In situations where a "private library" is being built, a static
library is needed to link binaries statically (LDSTATIC=-static).
1998-04-12 21:22:20 +00:00
tv 854cea27cc New flag, NOSTATICLIB, prevents build and install of the standard static
library unless NOPIC is set.
1998-04-09 00:51:06 +00:00
tv 482063559a .y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.
1998-04-09 00:32:31 +00:00
tv 875f72aa79 Revert. This broke too much in the build tree, and a better solution
needs to be created.  (The existing situation breaks a lot too.)
1998-04-01 16:58:33 +00:00
tv 755c261508 Fix .y rules to DTRT with possibly generated .h files. See mail on
tech-toolchain for a very detailed explanation of this.  In short, add
a .y.h rule identical to the .y.c rule and make the .y.c rule rename
the .h file; also, clean the .h file in CLEANFILES.
1998-04-01 15:23:36 +00:00
jonathan 6fbfecba04 Use the new binutils-compatible ld commandline syntax to build
shared-library .so files on both ELf and  a.out platforms.
1998-03-07 02:02:58 +00:00
jonathan 5e0e8cec39 More table-driven changes for different toolchains:
* new bsd.own.mk variable OBJECT_FMT with values "a.out" or "ELF".
  * use OBJECT_FMT in Makefile tests that depend on toolchain.
  * Add new bsd.own.mk variable NOSHLIB that, if set indicates a given
    port doesnt yet do shared libraries. Set on powerpc.
  * Document new feature-test variables in src/share/mk/bsd.README.
Tested on i386, mips, fakedup Alpha environment.
1998-02-23 10:09:31 +00:00
jonathan b947725fbb Fix dyslexic typo. 1998-02-18 08:14:31 +00:00
jonathan 4cbc9ecd8e Make bsd.lib.mk rules to build ELF vs a.out shlibs more table-driven.
No more .if in solib link rule.
1998-02-18 03:14:31 +00:00
cgd 70fa7e3060 kill a couple of (insignificant but) bogus extra spaces 1997-12-24 05:15:54 +00:00
thorpej 42b5acd98e Fix .c.ln rule: use CPPFLAGS, not CFLAGS. 1997-11-05 05:34:24 +00:00
gwr 0919e2346b Use LORDER, TSORT 1997-11-04 20:33:11 +00:00
lukem 513a06e6f5 remove lint rules for objective c as lint can't cope 1997-10-30 07:25:32 +00:00
lukem 55209d604d add default rules for Objective C sources (`.m' suffix):
- sys.mk:
	add ${OBJC} and ${OBJCFLAGS} (equivalent to ${CC} and
	${CFLAGS} respectively), and ${COMPILE.m} and ${LINK.m} rules
- bsd.sys.mk:
	add .m, .m.o, and .m.ln rules (as per the C rules in sys.mk).
	it's here, rather than in sys.mk, because `.m' isn't
	exclusively used for Objective C files.
- bsd.lib.mk:
	add .m.o, .m.po, .m.so, and .m.ln rules (as per C)
1997-10-28 12:40:16 +00:00
mycroft 1e9e92665f Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)
1997-10-11 08:16:24 +00:00
pk 19d4236655 Put `-DPIC' back in CPICFLAGS (a.out section); at least one C source
file (sparc/include/profile.h) relies on this.
1997-06-04 08:38:45 +00:00
cjs 7a66732d34 Back out BUILDDIR and NOINSTALL changes. 1997-05-31 21:21:13 +00:00
cjs c6a0de99f8 Add NOINSTALL option for libraries that are used only during the build
of a program, and not installed into the final system.
1997-05-30 01:54:42 +00:00
veego 933397a44f Fix pr#3679 a little different.
Remove the '-nostdlib' flag for ELF systems and keep it for a.out systems.
1997-05-29 15:37:11 +00:00
veego 2fbf728651 Add '-nostdlib -L${BUILDDIR}/usr/lib' for ${LDADD} so it links a shared
library with the correct shared library.
1997-05-28 11:16:19 +00:00
mycroft d5e3cfc07a Add a missing / in SHLIB_LD*FILE. 1997-05-27 18:51:12 +00:00
cjs 058d54e069 Always look in usr/lib for crtbegin/crtend; LIBDIR is the destination
directory of the library we're currently compiling.
1997-05-27 18:21:16 +00:00
cjs 2fc3406301 Re-add other folks' changes that I accidently reverted when I did my
build system changes commit.
1997-05-27 17:45:57 +00:00
cjs 5fd7ce7066 These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.
1997-05-26 03:55:19 +00:00
jonathan 346af6eeff More table-driven changes: split CPICFLAGS into separate flags, to
support the two different incompatible rules for build .so files from
.S source on both NetBSD and binutils toolchains:

	 ${CPP} | ${AS} for syscalls
	 ${CC}   	for non-syscalls
for which the different toolchains's ${AS}  requires diffferent flags.
1997-05-24 01:42:36 +00:00
mycroft a9b9dbd457 Do LINKS and SYMLINKS after FILES and INCS. 1997-05-17 16:43:31 +00:00
mycroft e30142d40d Remove unneeded .SUFFIXES lines, and move .s and .S closer to .o to give the
right preferences.
1997-05-17 02:01:07 +00:00
mycroft 3ae4ef8d4c Fix typo in previous. 1997-05-09 13:40:34 +00:00
mycroft 4e5d05c9cc Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.
1997-05-09 13:25:46 +00:00
mycroft fde14a0e77 Remove cruft. 1997-05-09 07:56:00 +00:00
mycroft a6b93bb66a Don't empty the suffix list. 1997-05-09 06:19:55 +00:00
mycroft ca03cbbd4d Oops; rearrange dependencies to get things built early enough. 1997-05-09 05:43:41 +00:00
mycroft f0a00ea4d3 Make sure INCS and SRCS are built if necessary. 1997-05-09 05:17:29 +00:00
mycroft b2a77a6aa4 Don't use _SUBDIRUSE outside of bsd.subdir.mk. 1997-05-07 17:06:16 +00:00
mycroft bb8827f7d1 Various simplifications. 1997-05-07 15:53:28 +00:00
mycroft 1bd348b5f9 Shuffle some .PHONYs around, to work better with `-t'. 1997-05-07 08:42:18 +00:00
mycroft 2da111c521 Make most of the install targets .PRECIOUS. 1997-05-06 21:29:33 +00:00
mycroft 5acae7b6ea Add a pile of missing .PHONYs. 1997-05-06 20:54:31 +00:00
thorpej 2e6057dd39 Pass the program to use for nm(1) to lorder(1), helps cross-compiling. 1997-04-17 06:32:23 +00:00
mikel 76cfd073e9 merge lite-2 changes (mostly SCCSids) 1997-03-29 08:02:45 +00:00
christos cef52070f9 Put the FILES generated rules in a separate .mk file since both bsd.prog.mk
and bsd.lib.mk use them.
1997-03-27 17:33:34 +00:00
christos 7600672517 put the 'r' back in archive. 1997-03-24 23:19:12 +00:00
christos 25f6ec749f make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation
1997-03-24 21:54:12 +00:00
cgd d46cdace76 add SHLIB_LDSTARTFILE and SHLIB_LDENDFILE variables for a.out shared lib
architectures, for consistency.  (For a.out shared libs, they're empty.)
Make the shared library target depend on them.
1997-03-23 00:52:20 +00:00
perry 1d624f4f7e Fix SYMLINKS not to include DESTDIR in the link itself 1997-03-22 22:33:53 +00:00
jonathan d012191d6d Use table-driven rules for linking shared libraries on a.out or ELF systems. 1997-03-15 11:35:04 +00:00
cgd b7e0994151 pull crtbeginS.o and crtendS.o in from DESTDIR 1997-03-14 00:52:50 +00:00
perry de40e6afd4 add SYMLINKS, by analogy to LINKS. Vetted by Christos. 1997-03-13 02:45:58 +00:00
cgd f8c02ac2a7 clean up Alpha (ELF) shared library build and install rules. The latter
are now more like what's "normal" for ELF.
1997-02-17 19:24:47 +00:00
mikel ffba261ec0 add support for COPTS, as in bsd.prog.mk 1997-01-28 03:38:40 +00:00
cgd 1d20ab5d2e if 'clean' is not already defined, rather than simply defining it with
a bunch of rules, define a clean{kmod,lib,prog} target with the rules,
and have both clean and cleandir depend on that.  That eliminates a bug
where 'cleandir' in a directory which included e.g. bsd.prog.mk but which
also had subdirs would 'make clean' all the subdirs and then 'make cleandir'
all ofthe subdirs.  It also allows Makefiles to add more dependencies
to 'clean' after inclusion of the make template.

If 'clean' is already defined, the behaviour is the same as it used to be.
1997-01-22 01:34:11 +00:00
christos 398a0a033b Don't use @echo "${command}" to echo commands, because if ${command} contains
double quotes we generate shell syntax errors. Use @echo ${command:Q} instead
which properly quotes shell metacharacters.
1996-12-29 19:14:32 +00:00
cgd 6cd7e38583 change the afterdepend target so that its sed script adds <filename>.ln
for each <filename>.o as an object file which has the given dependencies
(in addition to <filename>.po and <filename>.so, which were already there).
1996-12-20 16:36:56 +00:00
cgd 2dbbba03f0 remove outdated XXX comment (mine) 1996-12-19 07:51:59 +00:00
cgd cbff9abf27 undo (or actually, do differently) that last: On the Alpha, build shared
libraries with LD, but add /usr/lib/crtbegin.o and /usr/lib/crtend.o
before and after the rest of the stuff being linked.  This is a losing
situation all-around: for correct 'DESTDIR' builds, it should be including
them from ${DESTDIR}/usr/lib.  However, since those objects should be
included for all shared libraries, including them from ${DESTDIR} won't work,
because they won't be installed by normal builds by the time they need to
be used.
1996-12-17 23:14:23 +00:00
cgd 47b997f2e0 build Alpha shared libraries with ${CC} rather than ${LD}, because cc
understands how to do the c run-time startup magic necessary for shared
libraries and ld doesn't.
1996-12-17 21:05:40 +00:00
jtc 43a3714539 Define GPROF when assembling *.S files 1996-11-30 02:18:54 +00:00
mikel 4620721b06 Remove extra ".o"s; fixes PR misc/2883. 1996-11-05 05:40:28 +00:00
thorpej 416caa144c Use ${INSTALL} rather than "install".
From Simon J. Gerraty <sjg@zen.void.oz.au>, PR #1458.
1996-10-18 02:34:42 +00:00
cgd a23bd4576c if ${MACHINE_ARCH} is "alpha" build shared libs with the 'normal' GNU
linker's command line args, rather than the NetBSD linker's command
line args.  This is a hack, and should go away in favor of something
more general when that something is developed.  In the mean time, it
might be appropriate for the various mips ports to do the same thing.
1996-10-13 20:39:36 +00:00
abrown 795306043d Add missing quote (") in @echo line of .S.o rule, to prevent sh from
getting confused in certain cases.
1996-09-23 20:23:05 +00:00
jtc a66b1cae00 Fix from Aaron Brown that fixes some typos 1996-09-23 18:15:48 +00:00
jtc 3d592bf5cd Use `${COMPILE.S}' instead of `${CPP} ..... | ${AS} ....' to compile
assembly language source.
1996-09-20 19:51:50 +00:00
cgd ea52c85b3a use -pg rather than -p when compiling profiled objects. 1996-09-05 19:12:33 +00:00
mycroft fceadcfbd1 Use the `-q' option to tsort(1). From der Mouse, PR 1204. 1996-01-17 20:39:26 +00:00
christos 70174eb6fe Added include file <bsd.sys.mk> that contains lex and yacc "parallel aware"
rules. These rules are not turned on by default; they are enabled by setting
the PARALLEL variable.
1995-10-22 00:45:53 +00:00
pk ba51c14e09 Use CPPFLAGS in .S rules. 1995-09-30 12:21:33 +00:00
christos 6e591491c3 - make sure the afterdepend rule fires `after' .depend gets created.
[fixed for parallel make]
- make depend prettier printing.
1995-09-27 01:15:09 +00:00
jtc 7065a25cef Fix .cc.o .C.o rule; PR #1522 1995-09-26 23:48:24 +00:00