summaryrefslogtreecommitdiff
path: root/Rules.make
AgeCommit message (Collapse)Author
2002-06-05kbuild: Clean up descending into subdirsKai Germaschewski
Rules.make now has three targets: o default (a.k.a first_rule): The actual build. Deciding whether to build built-in or modular or both is decided by $(KBUILD_MODULES) and $(KBUILD_BUILTIN) now, instead of using different targets o fastdep: doesn't actually dependencies anymore, only generates modversions o modules_install: Well, you guess what that does. Cleaned up descending, and no more differentiating between $(subdir-y) and $(subdir-m). That means $(mod-subdirs) can go away now.
2002-06-05kbuild: Use deep directory structure for include/linux/modulesKai Germaschewski
We used to force the obvious deep structure of all objects which export symbols into a flat list in include/linux/modules. This initially caused the restriction the no two exporting objects could have the same name (Ever wondered why there's ksyms.c and i386_ksyms.c?) With the ALSA merge this restriction was mostly lifted by some hack, but some cases still don't work right (Hi XFS). As it's much cleaner to just use a normal tree under include/linux/modules, reflecting the source tree, we now do just that.
2002-06-05kbuild: Make dependencies at compile timeKai Germaschewski
Making dependencies once up front is not ideal. For one, you don't need them initially, since when you don't have the .o file, you bet you have to build it no matter what the dependencies say - dependencies are about deciding when to *re*build. There's more reasons, like: o you don't even know which files you'll build, so you have to go over all files (even over drivers/{sbus,s390,...} on i386) o generated files don't exist yet, so you cannot pick up dependencies on them o even if dependencies are right initially, they change when you work on your tree or patch it, and nobody will notice unless you run "make dep" explicitly again Anyway, gcc knows hows to emit a correct dependency list, so we just use that. Well, a little bit of hacking is necessary to remove the dependency on autoconf.h and put in individual CONFIG_WHAT_EVER dependencies instead, since otherwise changing one config option would cause everything to be rebuilt. I should add that I didn't come up with this all by myself, most work is actually done in gcc and there were discussions about using -MD on kbuild-devel way back, so I should mention Keith Owens and Michael Elizabeth Chastain, and probably others that I forgot, so I apologize just in case.
2002-06-05kbuild: Fix 'make some/dir/foo.lst'Kai Germaschewski
Just use 'make some/dir/foo.lst' to produce mixed source code and assembly for debugging. (If the object gets linked in and you have a System.map, it'll relocate appropriately) Apart from the needed Makefile bits, also clean up the script "makelst".
2002-06-05kbuild: Fix make -s (silent) and add a quiet modeKai Germaschewski
Suppress echoing of commands when using "make -s", so that make -s does indeed have the effect one would expect. Add a quiet mode, which will print not the entire command but only one line per rule. To turn it on, use make KBUILD_VERBOSE=0 vmlinux/whatever or set KBUILD_VERBOSE=0 in your environment. For now, the verbose mode is default, which gives you the old behavior of printing all commands. The output in quiet mode is based on what Keith Owens' kbuild-2.5 does, I like, I did not want to invent yet another output format.
2002-06-01kbuild: Get rid of -DMODVERSIONS, further cleanupKai Germaschewski
-DMODVERSIONS isn't used anymore, so it can go. Also, after cleaning up include/linux/module.h, it's obvious that we don't need include/linux/modversions.h at all if CONFIG_MODVERSIONS not set, no need to generate it. Rules.make explicitly lists files which depend on modversions.h, since make dep cannot know about the "-include include/linux/modversions.h" which gets added to the command line. Now that we understand when it is needed, we can even get that list right ;-) Oh well, nice theory. .hdepend will touch module.h when modversions.h changes, so we still get unnecessary recompiles. We really need to switch to the new way of dependency generation, it gets all that right without even thinking about these special cases. We don't track dependencies for .ver files. In fact, we relied on that checksum would only change if the corresponding exporting C source changes. That's not true, of course, all of the included headers have say as well. So we better force the hash to be checked unconditionally every time "make dep" is run.
2002-06-01kbuild: clean up generation of modversions.hKai Germaschewski
There's no good reason why we would generate include/linux/modversions.h from the top-level Makefile when CONFIG_MODVERSION=y and from Rules.make otherwise. Nor is there a good reason to call the target to do so "update-modverfile" - "include/linux/modversions.h" makes much more sense.
2002-05-28kbuild: beautify Makefile / Rules.make...Kai Germaschewski
Basically only cosmetics, and move the 'update-modverfile:' rule from Rules.make to the top-level Makefile, since that's the only place where it's used.
2002-05-28kbuild: built-in and modules in one passKai Germaschewski
Use "make BUILD_MODULES=1 {,bzImage,zImage,vmlinux,...}" to build your kernel - and it'll also build the modules as you go.
2002-05-28kbuild: Add EXTRA_TARGETS variableKai Germaschewski
99% of the Makefiles are very simple target-wise: o build modules as listed in $(obj-m) and o build $(L_TARGET)/$(O_TARGET) as a composite object containing $(obj-y) However, there is one exception: typically arch/$ARCH/kernel Makefile wants the same as above, plus o build init_task.o, head.o, using the standard rules for built-in targets - i.e. they are supposed to be built in the same way as all the other targets listed in $(obj-y), but they should not be linked into arch/$ARCH/kernel/$(O_TARGET). Instead they'll be linked in directly in the final vmlinux link. Currently this is achieved by overriding Rules.make's first_rule in arch/$ARCH/kernel/Makefile. This rather ad-hoc way relies on the knowing how Rules.make works internally and at the same time does things behind Rules.make's back. To clean this up, I'm introducing a new variable, supposed to be only used in arch/$ARCH/kernel/Makefile: $(EXTRA_TARGETS) can be used to declare additional objects which shall be built in the current directory (using the flags for built-in objects), but not linked into $(O_TARGET)/$(L_TARGET) This patch only converts arch/i386/kernel/Makefile at this time, other archs work the same way as before. Apart from this, this patch also removes some "unexport ..." statements, which are unnecessary since not exporting variables is the default and renames the internal "all_targets" to "vmlinux", since it's actually need for building vmlinux.
2002-05-24kbuild: Use consistently FORCE instead of dummyKai Germaschewski
FORCE is the de-facto standard name for a prequisite to force recompilation, so instead of using a mix of 'dummy','FORCE' and 'FORCE_RECOMPILE' use 'FORCE' everywhere. Also, move figuring out the path relative to the top level dir into Rules.make, instead of calling an external script.
2002-05-24kbuild: Figure out flags independently from passKai Germaschewski
We now have the information which objects are being built modular / built-in in Rules.make, so use this information instead of passing flags to the sub makes.
2002-05-24kbuild: Make O_TARGET default to 'built-in.o'Kai Germaschewski
If a Makefile defines neither O_TARGET nor L_TARGET, let's assume a default of 'built-in.o'. The goal of this is, of course, to eventually get rid of O_TARGET completely.
2002-05-23kbuild: Small cleanupsKai Germaschewski
o Use a shorter expression to transform 'foo.o' -> 'foo-objs' o Define EXPORT_FLAGS (as -DEXPORT_SYMTAB) in the main Makefile o Small rearrangement of code in Rules.make
2002-05-22kbuild: Rearrange Rules.makeKai Germaschewski
Group the variable-processing part together, which figures out what needs to be done. (Nothing actually changes in this cset)
2002-05-22Merge http://linux-isdn.bkbits.net/linux-2.5.makeLinus Torvalds
into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
2002-05-22kbuild: Fix command line printingKai Germaschewski
If our command line contains an ';', we'd only print half of it and execute the other half - not good.
2002-05-22Merge linux-isdn@linux-isdn.bkbits.net:linux-2.5.makeKai Germaschewski
into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make-built-in
2002-05-22Simplify linking/building objects in subdirectoriesKai Germaschewski
New-style Makefiles have a nice way of declaring objects which need to be built either built-in or as modules: obj-$(CONFIG_EEPRO100) += eepro100.o However, handling objects in subdirectories, which need to be built and linked is not as nice: subdir-$(CONFIG_E100) += e100 ifeq ($(CONFIG_E100),y) obj-y += e100/built-in.o endif This means we descend into the subdirectory when building vmlinux / modules, depending on CONFIG_XXX. When we are building vmlinux we also need to link whatever has been built in the subdirectory, so we add it to $(obj-y) at the appropriate place (link order is important). Now, the extension below allows to rewrite the second case into obj-$(CONFIG_E100) += e100/ which looks much nicer ;-) Existing behavior is not changed, and the only prerequisite to using the extension above is that the O_TARGET in the subdir is named "built-in.o".
2002-05-21Merge http://linux-isdn.bkbits.net/linux-2.5.makeLinus Torvalds
into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
2002-05-21Merge http://linux-isdn.bkbits.net/linux-2.5.make-asLinus Torvalds
into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
2002-05-20kbuild: Stop immediately on errorKai Germaschewski
This patch restores the previous behavior of stopping the build immediately on error (unless the -k option is given to make) Before this patch, we would do the echo command no matter if the compile failed, thus returning success always. (Jan Harkes)
2002-05-20Merge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5Kai Germaschewski
into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make-as
2002-05-20kbuild: Make USE_STANDARD_AS_RULE defaultKai Germaschewski
2002-05-20Fix building .i / .s files for testingKai Germaschewski
E.g. make arch/i386/kernel/process.[is] used to work at least in the cases where the object wouldn't need any additional command line flags defined in the local subdir. Get back this behavior, I think I know how to do this correctly, too, but that's for later.
2002-05-20kbuild: Speed up vmlinux buildKai Germaschewski
The recursive build used to do the following: On entering a directory, we would first call make in the subdirectories listed in $(subdir-y), and then call make in the current directory again, with the target 'all_targets'. The second invocation was used to make sure that the subdir makes completed before trying to build the O_TARGET/L_TARGET in the current dir, since this would link in objects in these subdirectories. However, using correct dependencies achieves the same, i.e. just make the objects in $(obj-y) which are not in the local subdirectory depend on 'sub_dirs', which is the rule to descend into subdirs. This patch actually halves the time "make vmlinux" takes when there's nothing to do (which makes sense, as we save half of the make invocations)
2002-05-19kbuild: Suppress printing of '$(MAKE) -C command' lineKai Germaschewski
Don't print the actual command to call make in a subdir, make will print 'Entering directory <foo>' anyway, so we don't lose that information.
2002-05-19kbuild: Fix object-specific CFLAGS_foo.oKai Germaschewski
Make CFLAGS_foo.o work also when generating preprocessed (.i) and assembler (.s) files. Same for AFLAGS_foo.o.
2002-05-12Rules.make: Remove special rule for $(export-objs)Kai Germaschewski
We can now remove the extra rule for $(export-objs) and instead just use $(export-objs): export_flags := -DEXPORT_SYMTAB to set a variable $(export_flags) for targets listed in $(export-objs)
2002-05-12Rules.make: check for changed command lineKai Germaschewski
2002-05-12Rules.make: Use variables for commandsKai Germaschewski
2002-05-12Rules.make cleanup: introduce c_flags, a_flagsKai Germaschewski
2002-05-12Small Rules.make cleanupKai Germaschewski
Add some comments to explain the magic, use $(if), which will be needed for other places anyway. That means we up the make requirements to 3.78, which is a couple of years old, so basically anybody should have it already.
2002-04-30Small Rules.make cleanupKai Germaschewski
Get rid of long obsolete (and unused) MOD_IN_SUBDIRS and unnecessary MOD_DIRS variable.
2002-04-25Rules.make cleanupKai Germaschewski
Get rid of traces of the old-style ALL_MOBJS variable. This also fixes the following issue, which could cause a warning with certain configs: Makefiles (legally) do: obj-$(CONFIG_SND_AD1848) += snd-pcm.o snd-timer.o snd.o obj-$(CONFIG_SND_CS4231) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o so when the first option is set to y, the second to m, we have e.g. snd-pcm.o on both $(obj-y) and $(obj-m). We correctly don't build the modular version in this case. However, if snd-pcm.o was a multi-part object, we did automatically generate a link rule for both the modular and the built-in version, which caused a warning - that's now fixed.
2002-04-24Remove the now unused MOD_TARGET hackKai Germaschewski
2002-04-22Make objects in $(export-objs) only depend on themselvesKai Germaschewski
Currently, if dependencies for one object file listed in $(export-objs) change, we will rebuild all $(export-objs) files in the same subdirectory, which may take a noticable amount of time and thus is annoying during development, and, of course, unnecessary. The patch is originally from Russell King and has been tested in the ARM kernel tree for a long time.
2002-04-12Handle $(export-objs) ambiguityKai Germaschewski
We use the makefile variable $(foo-objs) to list the objects a composed module foo.o is supposed to be composed of. We use the special varible $(export-objs) to list the object files which export symbols. This oviously clashes in the case of foo == export. There's basically two ways to handle it: (1) rename one of these options, like foo-objs to foo-parts or something, or (2) simply disallow a composite object called export.o, so you never need $(export-objs) to list its parts. As (1) would affect basically all Makefiles in the tree and (2) doesn't seem much of a limitation, I went for (2).
2002-04-03Merge linux-isdn@linux-isdn.bkbits.net:linux-2.5.makeKai Germaschewski
into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make
2002-04-02[PATCH] Define KBUILD_BASENAME for .i * .sDave Jones
originally from John Levon <levon@movementarian.org>
2002-04-01Fix the kernel build when we have multi-part objects both in $(obj-y)Kai Germaschewski
and $(obj-m). Before, we would have built (though not linked) the individual objects for multi-part modules even when building vmlinux and vice versa.
2002-03-15Improve Rules.make to automatically generate link rules for compositeKai Germaschewski
objects. Current behavior is not changed at all, but see the next cset for what it's good for.
2002-02-12[PATCH] ALSA patch for 2.5.4Jaroslav Kysela
Integrate ALSA into v2.5.4 Jaroslav
2002-02-08[PATCH] text.lock -> subsection changes.Dave Jones
Make spinlocks etc use subsections of their parent sections instead of an ELF section of their own - needed for newer binutils when the parent sector is removed.
2002-02-04v2.4.2.2 -> v2.4.2.3Linus Torvalds
- Alan Cox: continued merging - Urban Widmark: smbfs fix (d_add on already hashed dentry - no-no). - Andrew Morton: 3c59x update - Jeff Garzik: network driver cleanups and fixes - Gérard Roudier: sym-ncr drivers update - Jens Axboe: more loop cleanups and fixes - David Miller: sparc update, some networking fixes
2002-02-04v2.4.2.1 -> v2.4.2.2Linus Torvalds
- Jens Axboe: fix loop device deadlocks - Greg KH: USB updates - Alan Cox: continued merging - Tim Waugh: parport and documentation updates - Cort Dougan: PowerPC merge - Jeff Garzik: network driver updates - Justin Gibbs: new and much improved aic7xxx driver 6.1.5
2002-02-04Import changesetLinus Torvalds