Commit Graph

74 Commits

Author SHA1 Message Date
lukem 84a4748659 Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.
2004-01-29 01:48:45 +00:00
lukem af85ccad70 Replace
:M-[IDU]*
with
	:C/-([IDU])[  ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)
2004-01-27 03:31:48 +00:00
matt a14c93f141 Export the symbols in addition to the relocation records when making LKMs. 2004-01-16 00:36:39 +00:00
scw b4816bc53a Use MACHINE_CPU instead of MACHINE_ARCH to select the appropriate
architecture directory under sys/lkm/arch. This permits a single
directory to be used for bi-endian architectures.
2003-11-04 14:52:22 +00:00
jdolecek 5951c8215b if S is not already defined, use ${NETBSDSRCDIR}/sys or ${BSDSRCDIR}/sys to set
top of kernel source tree
2003-10-11 07:15:59 +00:00
lukem 959cbfd166 revert previous; there's too much hairy crap in sys/lkm/compat involving
the order that Makefile.inc is pulled in to get this to work.

this stuff needs a rototill (for another day). for example, having every
sys/lkm/** directory make their own  machine ${MACHINE_CPU} and possibly
${SHARED_MACHINE_CPU} (e.g, x86 for i386/x86_64) is not the most optimal
situation ...
2003-09-04 08:27:08 +00:00
lukem f212488840 simplify include symlink creation with LNFILES 2003-09-04 07:15:43 +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 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 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
lukem 87610a53a9 whitespace cleanup 2003-07-18 04:04:03 +00:00
fvdl 6fd55b60ac Add -mcmodel=kernel to CFLAGS for amd64. 2003-05-07 22:36:06 +00:00
fvdl e937aee3c1 another x86_64 -> amd64 2003-04-26 20:55:40 +00:00
fvdl 0945a6df17 x86_64 -> amd64 2003-04-26 19:02:50 +00:00
matt 275eeea6c9 The __wrap_* symbols need to become local symbols. If you have module
x which is dependent y but they both have __wrap_foo, if the __wrap_foo
is not localized, you will get linker truncation messages.
2003-04-23 18:34:20 +00:00
christos 9453ca1e91 add x86 to the cleanfiles for i386 and x86_64 (Hi Frank!) 2003-03-27 17:05:14 +00:00
fvdl 9f9a0457aa Add more special cases to create include directory symlinks, for archs
that take include files from a subdir != ${MACHINE_ARCH} (ew).
2003-02-27 11:09:59 +00:00
matt f65e1190f5 When making a LKM for powerpc, add function trampolines to undefined
functions.  This makes LKMs functional for powerpc.
2003-02-19 19:03:41 +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
jdolecek 6dbfb914a2 add 'sun68k' to CLEANFILES for sun2/sun3
add 'sparc' to CLEANFILES for sparc64
2002-07-29 07:42:52 +00:00
mrg eca4d02c51 be sure to link "sparc" dir as well, for sparc64 2002-07-20 11:44:31 +00:00
jdolecek a4fee01be9 Only attempt to make the machine links for targets 'depend', 'all',
'dependall'.
This fixes misc/16227 by Stoned Elipot.

XXX this solution is not ideal
2002-04-09 17:14:38 +00:00
jdolecek a5abace5e2 Do what rev. 1.50 intented using .BEGIN, g/c target 'machine-links'.
Making ${OBJS} and ${DPSRC} depend on target which is always out of date is
_really_ bad idea.
2002-04-06 17:49:02 +00:00
fredette ba0d9b105c In the machine-links target, the sun2 also needs a sun68k symlink.
Plan ahead and make it on the sun3 also.
2002-03-26 23:13:08 +00:00
pk 2918ae233f Target dependencies again: `machine-links' must be made before $DPSRCS.
We now have
	all => $PROG => $OBJS => $DPSRCS (if present) => machine-links
2002-03-21 12:54:21 +00:00
pk 721880b0bc Fix target order: the machine links must be present before compiling object
files.
2002-02-28 15:55:50 +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
thorpej 73b83787ee Don't put CPP flags in CFLAGS. 2001-12-28 07:49:26 +00:00
thorpej 5e53e8bb6a Add -ffreestanding to CFLAGS. 2001-12-28 07:48:39 +00:00
tv 8f2c8e583f Fix the :U's used with ${UPDATE} so that stray values don't get put into
the .PHONY: target.
2001-11-28 20:19:08 +00:00
tv a9c913616b Put -Is in CPPFLAGS, not CFLAGS; change -I to -isystem as appropriate. 2001-11-14 22:01:40 +00:00
tv 1129ed4afe Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments.  The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ.  Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.
2001-11-02 05:21:47 +00:00
simonb 6247b48489 Use ${MACHINE_CPU} instead of ${MACHINE_ARCH} in the machine-links
target; needed for MIPS and probably arm ports.
.include the full path name of machine/Makefile.inc so that this works
  if the machine-links target hasn't been run yet.
.include ${MACHINE_CPU}/include/Makefile.inc too.
2001-10-05 15:30:06 +00:00
jdolecek 20a3387bdb don't include explicit -e for modload in 'load' target - it's redundant
This addresses bin/4701 by Hauke Fath, but does opposite thing than
suggested there.
2001-09-29 20:10:07 +00:00
tv d0f9e45413 Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").
2001-08-14 07:02:13 +00:00
tv dd70bf30ad Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).
2001-06-01 17:49:32 +00:00
mycroft b124cdf163 Abuse .USE some more. 2000-06-06 09:53:29 +00:00
mycroft befa5650d3 Minor rearrangement. 2000-06-06 09:22:00 +00:00
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
jdolecek 13c9f44ec9 don't depend on ${PROG} for ``unload'' target - we don't need the lkm compiled
to do the unload
1999-11-02 22:42:51 +00:00
wrstuden 9229eeaa2b Add KMOD_LOADFLAGS to the load target. With this, lkm's in /sys/lkm/... can
more readily depend on each other.

An lkm which depends on another lkm now only needs to set

KMOD_LOADFLAGS= -A../../path/to/other/lkm's/${KMOD}

and the lkm will link against the other lkm's symbols. Obviously the other
lkm had better be loaded. ;-) Note: the -A option to modload was pre-
existing. This change makes it possible for users of this file to take
advantage of it.
1999-09-22 18:06:21 +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
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
ross 88fbb254d4 If it exists, include machine/Makefile.inc 1999-03-10 06:34:19 +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
christos ddb60058ff Use preserve flag in install. 1998-09-28 08:13:37 +00:00
lukem 24bd0530c9 add distclean as a synonym for cleandir 1998-08-09 14:46:19 +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