Commit Graph

125 Commits

Author SHA1 Message Date
Warner Losh
a0a67cf0c8 Truncate the ctfmerge command line, like we do with SYSTEM_LD. 2014-08-12 23:48:37 +00:00
Simon J. Gerraty
3d2bc9e872 Some objects - such as *_genassym.o are not hooked into
SRCS OBJS or anything else, yet have a dependency on symlinks
such as machine/

Reviewed by: obrien
2013-08-14 22:19:29 +00:00
Warner Losh
7e527d6d70 Remove the links: target. It too is homelessly outdated since it
relies on the outdated defines list.  It likely hasn't been useful in
15 years, and certainly not in the last decade.
2012-10-25 04:55:04 +00:00
Brooks Davis
12a14de08e MFP4 change 214967:
Make the process of embedding MDROOT images less perilous by
	makeing the target that links kernel and embedding the image
	depend on the image.  This means, if the image doesn't exist you
	find out before you try to boot from it and that if you change
	the image you don't have to touch some random source file to
	cause a rebuild.

	Don't hide that we're embedding the image.
2012-08-06 21:24:43 +00:00
David E. O'Brien
cd95660f26 Revert r222186 per instructions for FreeBSD 10.
(a 10-CURRENT share/mk is already required to build a 10-CURRENT kernel
 on 9-STABLE)
2012-07-03 05:01:00 +00:00
Doug Barton
1e8e2a9d7d Unfortunately the change in r237958 resulted in s/install/instclean/ due to
the aggressive pattern matching of the :C modifier. I tested build and
install in 2 phases, however with different solutions, resulting in the
breakage. Mea culpa.

The solution is to break out the all: target. This causes a few lines of
code duplication, but now the all: target works as it should, and the
other targets continue to work as they did before.

While I'm here, add a ===> header line to the start of each port build
to make it easier to find/more clear in the logs.
2012-07-02 22:14:58 +00:00
Doug Barton
cea039dae1 For the ports modules building code, clean WRKDIR before building. This is
important for those that use -DNO_CLEAN routinely, since it will prevent
installing stale stuff, and even more important when the port is upgraded
to a newer version. When the user doesn't use -DNO_CLEAN, this will create
an infinitesimal amount of extra work, but won't hurt anything.

This is necessary because the ports tree has flags that prevent the ususal
'update the build if newer source files exist' logic from doing what it
would do in the base.
2012-07-02 06:22:20 +00:00
Doug Barton
24a5cfd2c7 Improve the functionality of the PORTS_MODULES knob by adding
LOCALBASE/bin and sbin to PATH, allowing dependencies to be found;
adding SRC_BASE and OSVERSION to match the new kernel, and putting
the related builds under MAKEOBJDIRPREFIX so that they only need
to be built once per kernel.

In addition to the PR this includes ideas/contributions from crees
and matthew.

PR:		ports/161452
Submitted by:	Garrett Cooper <yanegomi@gmail.com>
2012-06-14 19:30:31 +00:00
Peter Wemm
88c7c4348b Allow (with a license warning) "options ZFS" to work in static kernels.
The 'make depend' rules have to use custom -I paths for the special compat
includes for the opensolaris/zfs headers.

This option will pull in the couple of files that are shared with dtrace,
but they appear to correctly use the MODULE_VERSION/MODULE_DEPEND rules
so loader should do the right thing, as should kldload.

Reviewed by:	pjd (glanced at)
2012-03-27 21:23:56 +00:00
Max Khon
83cb5bae96 - CTF knob is now implemented using common scheme: MK_CTF=yes/no is
defined based on WITH/WITHOUT_CTF settings, default is WITHOUT_CTF,
NO_CTF overrides WITH_CTF (used by Makefile.inc1)
- CTFCONVERT_CMD/NORMAL_CTFCONVERT are now defined to empty string
if make(1) can handle empty commands
2011-11-30 18:11:49 +00:00
Max Khon
78e7e3ecb5 - 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]
2011-11-29 16:34:44 +00:00
Max Khon
cd49c2e840 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.
2011-11-29 08:38:47 +00:00
Warner Losh
ff239280c6 Test against "no" rather than "yes" for MK_KERNEL_SYMBOLS
Also, change DEBUG back to DEBUG_FLAGS in kmod.mk.  The latter accidentally
snuck in with my backwards compat fix.

Submitted by:	ru,gcooper
2011-05-23 21:32:45 +00:00
Warner Losh
adcdcb73a4 Backwards compatibility hacks to allow kernels to be built via config
wihtout updating world (good transition aide for -current, but also
allows kernels to be built on -stable the old way too).  This likely
should go away around FreeBSD 10.0 or so.
2011-05-22 18:09:51 +00:00
Warner Losh
d380e0d209 Start to usher INSTALL_NODEBUG hack out the door. Add new
WITH{OUT,}_KERNEL_SYMBOLS (defaulting to WITH).  In the fullness of
time, likely around 2020, INSTALL_NODEBUG will be removed.  For now,
don't print a warning when using INSTALL_NODEBUG, but that will be
coming soon.
2011-05-22 18:01:52 +00:00
John Baldwin
544de89de0 Add an x86/include directory to the kernel to hold headers that are common
to amd64, i386, and pc98.  The headers are installed to /usr/include/x86
during an installworld, and an 'x86' symlink is created for kernel builds
similar to 'machine' so that the headers can be included as <x86/foo.h>.

Reviewed by:	imp
2010-11-01 17:34:04 +00:00
Warner Losh
25faff346c MFtbemd:
Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.
2010-08-23 22:24:11 +00:00
Nathan Whitehorn
915b4b093c Convert several instances of MACHINE_ARCH to MACHINE_CPUARCH and use the
correct compiler flags on 64-bit PowerPC.
2010-07-13 13:11:18 +00:00
Alexander Leidinger
21edb039c6 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@
2010-04-02 06:55:31 +00:00
Alexander Leidinger
627693305a Propagate CONF_CFLAGS (from makeoptions) to the module build too.
Discussed with:	jhb (on arch@)
2010-03-25 13:47:21 +00:00
John Baldwin
8859442e76 Always compute the root of the kernel source tree and explicitly pass it
to module builds.  This avoids having to have the module builds walk up
the tree to find the kernel sources.  It also allows a kernel + module
build to succeed when a new level of module subdirectories is added without
requiring that the /usr/share/mk/bsd.kmod.mk file on the machine be patched.

MFC after:	1 week
2009-05-04 20:25:56 +00:00
Bjoern A. Zeeb
b63fbf28cb Using KMODOWN/KMODGRP rather than hard coding root/wheel for
installing the kernel allows one, like with modules, to override
the default user/group and install as non-su to a temporary
directory to test, create images or seed a tftp dir.

Reviewed by:	Andrzej Tobola <ato@iem.pw.edu.pl>
MFC after:	4 weeks
2009-01-07 09:56:54 +00:00
John Birrell
3a877a1d93 Add CTF conversion to the objects compiled from generated code.
This allows DTrace scripts to access variables like 'ostype'.
2008-07-05 06:12:14 +00:00
John Birrell
ef74ab5a41 Add support for generating CTF data for the kernel. 2008-05-23 03:53:49 +00:00
Rafal Jaworowski
fcfdd827d0 Introduce a standalone shell script for embedding MFS image.
This allows to fix a problem with ARM kernel.bin not having the MFS image
embedded: it is objcopied from the kernel.noheader temporary ELF file, which
was not subject to embedding the MFS image previously.

Reviewed by:	imp
Approved by:	cognet (mentor)
2008-02-05 10:46:30 +00:00
Warner Losh
92d0be02b0 If KERNEL_EXTRA is defined, make kernel-all target depend on it.
If KERNEL_EXTRA_INSTALL is defined, install it into ${DESTDIR}${KODIR}.
2007-03-23 21:55:59 +00:00
John-Mark Gurney
83616b3aff now that MFS_IMAGE is in the FULLKERNEL section, use FULLKERNEL instead of
KERNEL_KO, this fixes MFS_IMAGE on a debugging kernel...

Submitted by:	Neelkanth Natu
2006-12-30 20:27:24 +00:00
Ruslan Ermilov
a10892b064 MF kmod.mk 1.176: Properly handle vnode_if.h dependencies.
Instructed by:	bde
2006-10-26 19:04:20 +00:00
Ruslan Ermilov
74465532f6 - Remove include links only when .depend is also removed, so that
"make depend; make clean; make -n" works.

- Preseve kernel's .depend if it already exists and its creation
  is interrupted.

Reported/reviewed by:	bde
2006-10-13 22:28:14 +00:00
Dag-Erling Smørgrav
8b3ae668b1 Don't use touch when what is really meant is :> (create an empty file, or
truncate it if it exists) or :>> (ensure the file exists, but don't change
it if it already does)

Reviewed by:	ru
MFC after:	2 weeks
2006-08-14 13:28:53 +00:00
Warner Losh
f36c2bbe0c Remove the insistance on having a device.hints. This was a seat belt
for those upgrading from 4.x -> 5.x.  It is therefore no longer
necessary because it is installed on 5.x and 6.x and one has to
upgrade from 6.x -> current, or at the very least 5.x (although not
supported, it can be made to work).
2006-06-18 17:48:45 +00:00
Olivier Houchard
de5f056a10 Handle MFS_IMAGE in the ${FULLKERNEL} target, so that we can build kernel
with MFS root without debugging.
2006-06-13 00:57:10 +00:00
John-Mark Gurney
c53113c8bc add support for makeoptions MFS_IMAGE="<file>" in the config file which
will automaticly populate the kernel w/ the mfs image...
2006-05-12 02:45:12 +00:00
Ruslan Ermilov
ee439c43ae Remove .depend when doing "make cleandir". 2006-02-07 13:37:26 +00:00
Ruslan Ermilov
150636cae7 I couldn't find any traces of what the tags1 file was supposed to do. 2006-01-16 16:25:17 +00:00
Ruslan Ermilov
a90232e1f7 Teach this to create the "machine" and ${MACHINE_ARCH} (for pc98
only now) symbolic links in the kernel compile directory, rather
than relying on config(8) to do this.  (The changes to config(8)
will be committed separately.)  This is aimed towards making the
config(8) as lightweight as possible.

Idea by:	bde (all bugs are mine)
2005-11-30 18:15:06 +00:00
Ruslan Ermilov
1558abf6ce Rename the .dbg extension to .symbols, which matches "symbol-file"
gdb(1) command better, though I must admit it's confusing: these
files have not only [debugging] symbols, but much more than that.

Requested by:	obrien
2005-10-27 17:39:03 +00:00
Ruslan Ermilov
bebb05211f Use ${S} to pass ${SYSDIR} to ports. This makes PORTS_MODULES
feature work when compiling a kernel via "make buildkernel".

Noticed and tested by:	nork
2005-10-27 14:33:08 +00:00
Ruslan Ermilov
98b45a8ff8 Installing debug modules was a bad idea -- I bogusly assumed that
our kernel linker will only load PT_LOAD segments, apparently not.
Instead, produce .dbg objects from .debug objects, and install
them together with non-debug objects, as described in objcopy(1).

Original code by:	obrien
2005-10-27 14:24:45 +00:00
Ruslan Ermilov
d24864f785 Refactor (some more) installation of kernel and module objects.
Try to make everyone happy: David (to have debug kernels installed
by default), Warner (to be able to override that), and myself (for
actually making it all work and to be consistent).

Now, if kernel was configured for debugging (through DEBUG=-g in
the kernel config file or "config -g"), doing "make install" will
install debug versions of kernel and module objects with their
canonical names,

	kernel.debug -> /boot/kernel/kernel
	if_fxp.ko.debug -> /boot/kernel/if_fxp.ko

Installing a kernel not configured for debugging, or debug kernel
with INSTALL_NODEBUG variable defined, will install non-debug
kernel and module objects.

Also, restore the install.debug and reinstall.debug targets that
are part of the existing API (they cause some additional gdb(1)
scripts to be installed).
2005-10-25 09:05:07 +00:00
Warner Losh
697ca17bb0 Back out most of 1.84. It was unwise to force debug kernels to always
be installed.  It should have been optional to install a non-debug
one, just like it was formerly optional to install a debug one.  In
order to do that, most of 1.84 had to go.

Instead, make installing the debug kernel the default, but create a
new option INSTALL_NODEBUG for those people that have small /
partitions and good source control habits.

This preserves the behavior of 1.84 while allowing it to be overriden
for people (like me) that do not have the time to upgrade to get a
bigger / and also don't have time for stupid makefile tricks when
upgrading their older system, but still want a kernel.debug around if
things go south.
2005-10-24 23:54:39 +00:00
David E. O'Brien
e319790c0c For HEAD, install a kernel with debug information if DEBUG is a kernel
config option.  It is too easy to loose the build directory and not have
symbols for kgdb to read.
2005-09-11 00:22:21 +00:00
Warner Losh
9f74b22210 Don't build PORTS_MODULES if NO_MODULES is defined 2005-06-09 05:38:18 +00:00
Maxime Henrion
5c25ebd529 Install ports defined in PORTS_MODULES at make reinstall time too.
Reviewed by:	imp
2005-06-05 18:34:16 +00:00
Ruslan Ermilov
1afc807b33 Be resistant to DESTDIR being set to some unkosher value, e.g. "/".
Noticed by:	Steve Ames
2005-04-28 14:45:57 +00:00
Ruslan Ermilov
3365523e54 Clean all generated vnode_if* files. 2005-04-22 19:58:22 +00:00
Ruslan Ermilov
a13914f600 Fix "make depend" to not redundantly rebuild the .depend file.
Reviewed by:	bde (I think so)
2005-04-22 17:36:25 +00:00
Warner Losh
cfaacd7f0f Now that we have proper links, no need to fake up ones as part of
depend.  Now that we no longer need this hack, remove it.

Forgotten by: imp
Reminded by: nyan
2005-04-03 04:33:42 +00:00
Poul-Henning Kamp
92daf6f9ac Don't generate major.c anymore. 2005-03-29 11:23:25 +00:00
Warner Losh
f747977691 Get SYSDIR set correctly for building ports.
On install, do deinstall reinstall
2005-02-25 05:34:45 +00:00