Commit Graph

129 Commits

Author SHA1 Message Date
Maxime Henrion
361186e5d5 In the !DEBUG case, we were passing foo.ko two times on the
rm -f command line when doing a make clean.  Fix this.

Reviewed by:	ru
2002-11-06 17:40:13 +00:00
Sam Leffler
c4f9e3ae7f add crypto interface to the MFILES list 2002-10-04 20:36:39 +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
d2893b161b Drop support for COPY, -c has been the default mode of install(1)
for a long time now.

Approved by:	bde
2002-07-29 09:40:17 +00:00
Ruslan Ermilov
2b06260dfa Handle installation of links through bsd.links.mk.
Removed comments that no longer directly apply here.
2002-07-17 08:21:50 +00:00
Ruslan Ermilov
6dc6a04be5 Do not override the standard `distribute' target that is currently
available from bsd.obj.mk.

The native version was identical (and pretty much unused except in
the -DMODULES_WITH_WORLD case, which it is not for "make release")
except that the "bin" -> "base" change of the default DISTRIBUTION
name did not propagate here.
2002-07-11 14:13:37 +00:00
Nick Hibma
dba3dc7bdc Use OBJDIR instead of CURDIR. This unbreaks loading modules through
'make load' if an object dir was, like it is used in /sys/modules. I.e.

	cd /sys/modules/umass
	make obj
	make
	make load

works again without having to install the module.

If no objdir was used the module in the current directory is used.
2002-06-17 20:01:06 +00:00
Ruslan Ermilov
be1d673d24 Check that kldxref(8) exists before running it. 2002-05-14 07:49:12 +00:00
Warner Losh
3498b5ed09 We don't need no stinkin' echos here.
Instead, don't run kldxref if you don't have one on your system.
2002-05-01 19:24:26 +00:00
David E. O'Brien
9fa411ae4a Use makeobjops.awk rather than makeobjops.pl.
(with big thanks to Oliver Fromme <olli@fromme.com>)
2002-05-01 03:28:14 +00:00
Peter Wemm
06639be707 Catch any stray KMODDEPS entries to make sure they do not keep turning up. 2002-05-01 01:32:28 +00:00
David E. O'Brien
f3320cac13 Barrow something from the `nmap' port to help the ENOCLUE people upgrading
from releng4 and are not able to properly read make(1) output.
2002-04-29 06:35:25 +00:00
Ruslan Ermilov
2cbc81ffe4 The install.debug and reinstall.debug targets are needed solely
to build kernel and kernel modules so stop supporting them in
bsd.subdir.mk and reimplement them in kern.post.mk and kmod.mk
as special versions of the install and reinstall targets, and
only define them if DEBUG is also defined (when debug versions
are really built).

Prompted by:	bde
2002-04-24 11:26:19 +00:00
Ruslan Ermilov
b25a566d47 Merge bsd.obj.mk's version of the _SUBDIR target with bsd.subdir.mk.
Ensure all standard targets honor SUBDIR.  Now `make obj' descends into
SUBDIRs even if NOOBJ is set (some descendants may still need an object
directory, but we do not have such precedents).  Now `make install' in
non-bsd.subdir.mk makefiles runs `afterinstall' target _after_ `install'
in SUBDIRs, like we do in bsd.subdir.mk.  Nothing depended on the wrong
order anyway.

Fixed `distribute' targets (except for the bsd.subdir.mk version) so that
they do not depend on _SUBDIR; `distribute' calls `install' which already
depends on _SUBDIR.

De-standardize `maninstall', otherwise manpages would be installed twice.
(To be revised later.)
2002-04-23 09:03:56 +00:00
Ruslan Ermilov
05276e5f8c Back out remnants of revision 1.97: we don't need TARGET_ARCH here. 2002-04-22 15:53:04 +00:00
Ruslan Ermilov
0ac2fc87d2 Use standard bsd.init.mk prologue. 2002-04-22 15:47:11 +00:00
Ruslan Ermilov
bbb467cd9a lint the previous lint commit.
Reviewed by:	markm
2002-03-18 09:35:45 +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
David E. O'Brien
b7bbb709c2 Use vnode_if.awk rather than vnode_if.pl 2002-03-01 01:21:29 +00:00
Ruslan Ermilov
17d6c63672 Drop <bsd.man.mk> support from <bsd.kmod.mk>.
Not objected to by:	-current
2002-01-11 15:49:02 +00:00
Mike Smith
93f0354850 Reverse the sense of EXPORT_SYMS. If EXPORT_SYMS is not
defined, no symbols are exported from the module.  This is
the typical configuration for most device drivers and
standalone modules; only infrastructure modules or those with
special requirements typically need to export symbols.

Don't print the objcopy commands as they are run when converting
symbols; they're bulky and annoying in many cases.
2002-01-11 01:11:44 +00:00
Mike Smith
0b3178a45c Eliminate the use of commons in the kernel and modules,
simplifying the module linking process and eliminating the risks
associated with doubly-defined variables.

Cases where commons were legitimately used (detection of
compiled-in subsystems) have been converted to use sysinits, and
any new code should use this or an equivalent practice as a
matter of course.

Modules can override this behaviour by substituting -fno-common
out of ${CFLAGS} in cases where commons are necessary
(eg. third-party object modules).  Commons will be resolved and
allocated space when the kld is linked as part of the module
build process, so they will not pose a risk to the kernel or
other modules.

Provide a mechanism for controlling the export of symbols from
the module namespace.  The EXPORT_SYMS variable may be set in the
Makefile to NO (export no symbols), a list of symbols to export,
or the name of a file containing a newline-seperated list of
symbols to be exported.  Non-exported symbols are converted to
local symbols.  If EXPORT_SYMS is not set, all global symbols are
currently exported.  This behaviour is expected to change (to
exporting no symbols) once modules have been converted.

Reviewed by:	peter (in principle)
Obtained from:	green (kmod_syms.awk)
2002-01-10 03:52:01 +00:00
Dag-Erling Smørgrav
a4c0058691 Support the "install.debug" and "reinstall.debug" targets for kernel modules.
Small tweaks to kldxref may be necessary to avoid the surprising (but harm-
less) behaviour of 'kldload foo' loading foo.ko.debug instead of foo.ko if
it is present in the kernel directory.

Approved by:	a week of silence on -arch
MFC after:	2 weeks
2001-10-27 00:52:50 +00:00
Peter Wemm
ad7da9b460 On second thoughts, make kldxref failures non-fatal. 2001-09-11 01:13:49 +00:00
Peter Wemm
505222d35f Implement the long-awaited module->file cache database. A userland
tool (kldxref(8)) keeps a cache of what modules and versions are inside
what .ko files.  I have tested this on both Alpha and i386.

Submitted by:	bp
2001-09-11 01:09:24 +00:00
Brian Feldman
46877fb22c In the KLD "load" make target, don't load using the "absolute" path of
"./foo.ko".  Use "/full/path/foo.ko" instead so that when the path is
reported as being an absolute path to the "shared library", at least
it's not really a relative path.

Obtained from:	LOMAC/FreeBSD project
2001-08-08 13:51:10 +00:00
Sheldon Hearn
f66116083c When building a debugging kernel with modules, build modules with
debugging support as well.  Debugging module support is handled
identically to kernel debugging support, right down to poor
choice of make variable names.
2001-08-02 09:22:18 +00:00
Peter Pentchev
2f7538d646 Make sure that installing a module complains if the target modules
directory does not exist, instead of creating/overwriting a file
with the name of the (expected) directory.  Yes, this deviates a bit
from nearly all other install targets in the tree, but let's face it,
removing a modules directory is not all that uncommon a mistake,
and finding a file with the contents of the last module installed
is a baaad surprise at boot time..

PR:		26317
Submitted by:	"T. William Wells" <bill@twwells.com> (the PR)
		Gregory Bond <gnb@itga.com.au> (the actual patch)
Reviewed by:	silence on -arch and -audit for the last 10 days
MFC after:	2 weeks
2001-07-18 09:59:55 +00:00
Peter Wemm
f41325db5f With this commit, I hereby pronounce gensetdefs past its use-by date.
Replace the a.out emulation of 'struct linker_set' with something
a little more flexible.  <sys/linker_set.h> now provides macros for
accessing elements and completely hides the implementation.

The linker_set.h macros have been on the back burner in various
forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()),
John Polstra (ELF clue) and myself (cleaned up API and the conversion
of the rest of the kernel to use it).

The macros declare a strongly typed set.  They return elements with the
type that you declare the set with, rather than a generic void *.

For ELF, we use the magic ld symbols (__start_<setname> and
__stop_<setname>).  Thanks to Richard Henderson <rth@redhat.com> for the
trick about how to force ld to provide them for kld's.

For a.out, we use the old linker_set struct.

NOTE: the item lists are no longer null terminated.  This is why
the code impact is high in certain areas.

The runtime linker has a new method to find the linker set
boundaries depending on which backend format is in use.

linker sets are still module/kld unfriendly and should never be used
for anything that may be modular one day.

Reviewed by:	eivind
2001-06-13 10:58:39 +00:00
David E. O'Brien
ea87b3cb61 Don't install KO's with the "schg" flag.
We are way too inconsistent with our setting of the "schg" flag, and in
our default install, it doesn't really offer any additional security.

Reviewed by:	arch@
2001-04-25 20:56:15 +00:00
Boris Popov
6f2d8adb12 Add function prototypes and base module for kernel side iconv library.
Add simple "xlat" converter which performs 8to8 table based conversion.
Unicode converter will be added in the near future.

Reviewed by:			silence on arch@
Files placement reviewed by:	bde
Obtained from:			smbfs
2001-04-09 09:39:29 +00:00
Ruslan Ermilov
7da4bd3beb Reflect recent bsd.man.mk changes here, but do not assign the
default MAN=${KMOD}.4 value for now.  This feature was broken
before, and enabling it now would cause 92 Makefiles to fail.
2001-03-27 11:50:44 +00:00
David E. O'Brien
cce2a16325 Cleaner way of adding -fschg (ie, correctly implement).
"INSTALLFLAGS" belongs to individual Makefiles.
"_INSTALLFLAGS" is for global additions.

Submitted by:	bde
2001-03-24 08:31:45 +00:00
Warner Losh
985f41af12 Move beforedepend: outside of the loop.
# Note: we should remove the rm kludge soon.  It fails in many cases.

Submitted by: bde
2001-03-05 06:19:29 +00:00
David E. O'Brien
0d2e2e23c1 Set TARGET_ARCH and install files -fschg as we do the kernel module. 2001-03-04 05:29:10 +00:00
Peter Wemm
ed277dc979 Add pci/agp_if.m to the MFILES list so that we can auto depend on agp_if.h 2001-02-27 01:23:34 +00:00
Warner Losh
f3cc9575fd If the symbolic links @ or machine exist, do not depend on them.
This fixes the problem where if src/sys or src/sys/$MACHINE_ARCH/include
changed at all, all the modules would be rebuilt.

Reviewed by: bde
2001-02-23 04:49:31 +00:00
Peter Wemm
2fbfac2739 This time really fix the machine/lock.h thing. This time don't fool make
into thinking that the way to build a .o file is to "rm -f .depend".

Suggested by:	imp
2001-02-20 09:37:00 +00:00
Peter Wemm
9ccedbb11b Back out rev 1.92 2001-02-19 18:27:42 +00:00
Peter Wemm
146a90334d "Fix" the machine/lock.h problem in modules depend with a sledge hammer.
This forces bsd.dep.mk to rebuild the .depend file.
2001-02-18 20:23:22 +00:00
Marcel Moolenaar
8e739d9fa0 Revert gensetdefs.pl reversal. 2001-02-17 07:26:57 +00:00
Marcel Moolenaar
8e8cae2b0c Revert previous commit. I messed up my testing. 2001-01-28 21:24:05 +00:00
Marcel Moolenaar
136345c019 Improve kernel bootstrapping:
o  Use objdump instead of gensetdefs(1) to build the linker sets.
o  Allow overriding of nm and objdump in resp. genassym.sh and
   gensetdefs.pl for non-native toolchains.

Reviewed by: arch
Perl improvements: Jos Backus <josb@cncdsl.com>, benno
2001-01-28 06:39:56 +00:00
Cameron Grant
0f55ac6c1a kobjify.
this gives us several benefits, including:

* easier extensibility- new optional methods can be added to
  ac97/mixer/channel classes without having to fixup every driver.

* forward compatibility for drivers, provided no new mandatory methods are
  added.
2000-12-18 01:36:41 +00:00
Mike Smith
7e820aaa1e Next-phase PCI system update; move PCI core code to sys/dev and update
header include path to include sys/dev to avoid massive #include updates.
2000-12-08 22:26:48 +00:00
Jason Evans
aabafca098 Do not check for existence of ${_dir}/kern/ , because for modules that set
.PATH to ${.CURDIR}/[...]/kern , the "exists" expression will fail for the
form exists(${.CURDIR}/[...]/kern/).  This appears to be happening because
make is searching for the argument to "exists" by using .PATH rather than a
relative search, because .PATH and the argument match at the beginning.
Additionally, make appears to consider a path that starts with ${.CURDIR}
as relative, even though it expands to an absolute path.

The reason that most people aren't seeing this problem is that the absolute
paths of /usr/src/sys and /sys are also searched, so as long as the kernel
source can be found in at least one of those places, no problems surface.
This problem was inadvertently introduced on 1 December 2000, with the
addition of the sysvipc modules.
2000-12-08 20:36:32 +00:00
Takanori Watanabe
0df282c2e4 Add pcib_if location to list of *.m files. 2000-10-31 02:25:20 +00:00
Poul-Henning Kamp
26dac111f1 Add a hook for doing #include magic (for src/tools/tools/kerninclude). 2000-10-29 09:47:50 +00:00
David E. O'Brien
3bdfa9e589 The kernel is now known as `kernel.ko' and it and its matching modules
live in ``/boot/kernel/''.
2000-09-05 22:37:46 +00:00
Coleman Kane
48bd8a660c Fix the 'file not found' in the load target, someone
forgot to add the '.ko' to the end of the module filename.
2000-06-22 02:07:18 +00:00