summaryrefslogtreecommitdiff
path: root/Rules.make
AgeCommit message (Collapse)Author
2002-12-14[PATCH] Remove Rules.make from Makefiles (3/3)Brian Gerst
Makefiles no longer need to include Rules.make, which is currently an empty file. This patch removes it from the remaining Makefiles, and removes the empty Rules.make file.
2002-10-23kbuild: Convert build and modversion phasesKai Germaschewski
Alright, so now actually all four phases are converted to new-style, i.e. we call make -f scripts/Makefile.<phase> which includes the actual subdir Makefile. The obvious drawback is some code duplication between the four scripts/Makefile.<phase>, which could easily be overcome including shared parts, but since I'm going for maximum performance, I did not for now. Rules.make is empty now ;) (Well, not quite, since if it was 0 bytes, make mrproper would remove it...)
2002-10-23kbuild: Remove some compatibility code, $(echo_target)Kai Germaschewski
Including Rules.make after make -C stopped working with the fixdep changes, so the other code trying to salvage backward compatibility should go as well.
2002-10-23kbuild: Split Rules.makeKai Germaschewski
Rules.make is used in 4 phases, o generate modversions o build o install modules o clean split out the code specific to the phase and move it into scripts/Makefile.<phase>
2002-10-16kbuild: another "make clean" micro-optimizationKai Germaschewski
Patch by Peter Samuelson, merged to current code, actually has a noticable impact on "make clean" speed.
2002-10-16kbuild: Speed up new "make clean/mrproper"Kai Germaschewski
Do as little as possible apart from calling sub-makes and calling 'rm', which makes things go quite a bit faster.
2002-10-13kbuild: More cleaning work...Kai Germaschewski
o Having .config depend on all Config.in's via a find is annoying, since it causes a long break before "make" actually gets going. Comment it out for now. o Fix some "make -j" issues with generating module versions. o Unify "make distclean" and "make mrproper", they were doing nearly the same thing anyway. o Use the new "make clean" infrastructure for arch/i386/boot/ and scripts/ o Reorganize the "make clean" stuff a little, do the find -name '*.[oas]' | xargs rm -f from the top-level Makefile again and only use the per-subdir rule for special cases like generated files, host-progs and the like.
2002-10-13Hand merged.Kai Germaschewski
2002-10-11kbuild: Distributed clean infrastructureSam Ravnborg
Today there is a huge list of files in the top-level Makefile that is deleted during make clean and make mrproper. This patch add infrastructure to get rid of this centralised list. Within a makefile simply use: clean-files := files-to-be-deleted or eventually clean-rule := command to be executed to delete files Files specified by host-progs and EXTRA_TARGETS are deleted during cleaning, and the same is all *.[oas] .*.cmd .*.tmp .*.d in the visited directories. Deleting core files is moved down to mrporper time Patches utilising this and the centralised list will dismiss. Based on a concept originally made by Kai Germaschewski
2002-10-08kbuild: Remove now unnecessary usages of $(TOPDIR)Kai Germaschewski
Since we now always have $(TOPDIR) = `pwd`, some usages of $(TOPDIR) can go away.
2002-10-07kbuild: Call scripts explicitly via shKai Germaschewski
Instead of recurring problems with non-executable permissions on files in scripts/, just call them as "sh <script>".
2002-10-05kbuild: Fix arch/i386/boot clean targetsKai Germaschewski
We removed some files which are long since dead, but on the other hand forgot some of the current ones. Also, add a missing ) in a warning (introduced and fixed by Sam Ravnborg ;)
2002-10-05kbuild: fix make -jN warningsKai Germaschewski
If you hide the sub-make in a function, 'make' needs a little help...
2002-10-05kbuild: Don't descend into arch/i386/bootKai Germaschewski
We don't descend anymore when building vmlinux, so don't do so for the i386 specific boot targets, either. Plus, more cleanup in arch/i386/Makefile
2002-10-05kbuild: Nicer warningsKai Germaschewski
Improve the warning messages when using obsolete features, kill one remaining user of $(list-multi) (by Sam Ravnborg) I also made O_TARGET != built-in.o an error, since compatibility code for that case has already been dropped
2002-10-04kbuild: Fix build with modversionsKai Germaschewski
Sam Ravnborg missed a place I missed converting, and I found another one, too.
2002-10-02kbuild: Don't cd into subdirs during buildKai Germaschewski
Instead of using make -C <subdir>, just use make -f <subdir>/Makefile. This means we now call gcc/ld/... always from the topdir. Advantages are: o We don't need to use -I$(TOPDIR)/include and the like, just -Iinclude works. o __FILE__ gives the correct relative path from the topdir instead of an absolute path, as it did before for included headers o gcc errors/warnings give the correct relative path from the topdir o takes us a step closer to a non-recursive build (though that's probably as close as it gets) The changes to Rules.make were done in a way which only uses the new way for the standard recursive build (which remains recursive, just without cd), all the archs do make -C arch/$(ARCH)/boot ..., which should keep working as before. However, of course this should be converted eventually, it's possible to do so piecemeal arch by arch. It seems to work fine for most of the standard kernel. Potential places which need changing are added -I flags to the command line, which now need to have the path relative to the topdir and explicit rules for generating files, which need to properly use $(obj) / $(src) to work correctly.
2002-10-02kbuild: Add some bug trapsKai Germaschewski
Makefiles which still use obsolete 2.4 constructs now give a warning.
2002-10-02kbuild: Remove xfs vpath hackKai Germaschewski
xfs.o is built as one modules out of objects distributed into multiple subdirs. That is okay with the current kbuild, you just have to include the path for objects which reside in a subdir, then. xfs used vpath instead of explicitly adding the paths, which is inconsistent and conflicts e.g. with proper module version generation.
2002-10-02kbuild: Small cleanupsKai Germaschewski
o Use a function "descend" for descending into subdirectories o Remove unused (?) "boot" target o Remove unnecessary intermediate "sub_dirs" target from Rules.make o Use /bin/true instead of echo -n to suppress spurious "nothing to be done for ..." output from make
2002-10-01Cset exclude: kai@tp1.ruhr-uni-bochum.de|ChangeSet|20020929194514|33195Kai Germaschewski
2002-09-29kbuild: Make KBUILD_VERBOSE=0 work better under emacsKai Germaschewski
(slightly modified to unconditionally add the relative path to the subdir) Rusty Russel wrote: "M-x compile" in emacs stars a compilation and can jump to the next error. With KBUILD_VERSBOSE=0 (as I have in my env, great work Kai) it can't figure out the directory, since it doesn't see the make[XXX] markers. This makes it work.
2002-09-12kbuild: Fix copying of shipped filesKai Germaschewski
When using cp to copy the shipped file to its actual name, permissions would be preserved, particularly the copy would be read-only when the original was (BitKeeper) read-only, leading to an error when executing the rule a second time. So now we use cat, which will generate a writable file.
2002-09-12kbuild: Fix up non-verbose modeKai Germaschewski
Just some cosmetical changes to align output in non-verbose mode.
2002-07-30[PATCH] kbuild: Add new define do_cmdSam Ravnborg
do_cmd is a nice shorthand when creating rules that in one line shall adhere to KBUILD_VERBOSE and make -s. So far the only user is (will be) the docbook makefile
2002-06-20kbuild: Put flags for ld into LDFLAGSKai Germaschewski
Some archs sneaked additional flags for ld into $(LD). This can be done cleaner now, by just using $(LDFLAGS).
2002-06-20kbuild: Assorted cleanupsKai Germaschewski
o Provide $(obj),$(objtree) and friends in the top-level Makefile as well for consistency (Sam Ravnborg) o Make $(call cmd,whatever) consistent with $(call if_changed,whatever), i.e. both will execute $(cmd_whatever) o Add $(echo_target), which will print the current target in a suitable way for the quiet output format (i.e. target name relative to the top-level directory) o Fix the dependencies for host compiled programs to work for files in subdirectories (missed converting them when introducing $(depfile)) o Add commands which will be useful when generating boot images.
2002-06-18kbuild: Shipped file fixesKai Germaschewski
To generate the module versions for 53c700.o, we need the included generated header already. Improve the rule to copy shipped files into place.
2002-06-17kbuild: Introduce $(obj), $(src)Kai Germaschewski
For separate source and object directories, Rules.make needs to know where the files live. For all the normal variables, $(obj-[ymn]) etc, it can figure that out by itself, but for explicit rules to generate files it needs help. So there $(obj)/target.o indicates that this file lives in the object directory, as opposed to $(src)/target.c, which lives in the source dir. For now $(obj) = $(src) = ., but convert some Makefiles to it already.
2002-06-17kbuild: cleanup drivers/scsi firmware generation, part 3Kai Germaschewski
Rename the shipped 53c.. firmware files to <name>_shipped. Add a default rule for shipped files, which will just call <name>_shipped to <name> if no specific rule to generate the target exists. Rename the aic7xxx firmware to fit into this naming scheme. For now 53c... defaults to just using the shipped firmware.
2002-06-17kbuild: Improve output and error behavior when making modversions.Kai Germaschewski
Reduce the amount of output in verbose (default) mode and stop immediately on error. (Sam Ravnborg/me)
2002-06-17kbuild: Handle removed headersKai Germaschewski
New and old way to handle dependencies would choke when a file #include'd by other files was removed, since the dependency on it was still recorded, but since it was gone, make has no idea what to do about it (and would complain with "No rule to make <file> ...") We now add targets for all the previously included files, so make will just ignore them if they disappear.
2002-06-16kbuild: modversions fixKai Germaschewski
As pointed out by Mikael Pettersson, we didn't generate checksums for all exporting objects, due to a thinko of mine.
2002-06-10kbuild: Add $(HOST_LOADLIBES) when compiling host programs directlyKai Germaschewski
When compiling a host program directly from the source without going via intermediate objects, we were missing $(HOST_LOADLIBES) on the command line. Pointed out by Keith Owens.
2002-06-10kbuild: Allow for ',' in file namesKai Germaschewski
The dependency generation broke on files with a comma in their name, i.e. 53c7,8xx.c This patches fixes the limitation. However, using commas in filenames is strongly discouraged, there are other places where this case cannot be handled cleanly (e.g. section names in include/linux/spinlock.h).
2002-06-09kbuild: Improve output alignmentKai Germaschewski
by Sam Ravnborg
2002-06-09kbuild: Track dependencies for .ver filesKai Germaschewski
Tracking dependencies for .ver files isn't really different from the dependency tracking for the other .[ois] targets we do, so just use the normal $(call if_changed_dep) framework. That makes speeds up re-running "make dep" a lot.
2002-06-09kbuild: Generate modversions only for selected objectsKai Germaschewski
Up to now, we generated module versions for all objects which were listed in $(export-objs). This had one advantage: A changed .config will not affect which .ver files are built, thus saving recompiles. However, it is fundamentally broken. To build .ver files, we preprocess the exporting sources - and the result can obviously depend on the current .config. Even worse, some files generate errors when preprocessed with the wrong .config - it doesn't matter a lot that drivers/sbus/* will generate errors on x86, since it won't be used anyway, but e.g. kernel/suspend.c cannot be preprocessed unless CONFIG_SOFTWARE_SUSPEND is set. - Up to now, we just silently ignore these errors. Actually, the whole point behind CONFIG_MODVERSIONS is to make sure we don't insert modules into a kernel which was configured differently, and as such the generation of symbols can only work when .config is known. So we now only generate symbols for objects which will actually be compiled - which means less work, and enforce the kernel to be configured before "make dep".
2002-06-09kbuild: Optimize include of .*.cmdKai Germaschewski
Keep track of possible targets while we add rules - Later, only include the command lines / dependencies as needed. E.g., when defining how to build multi-part objects listed in $(multi-used-y) and $(multi-used-m), add $(multi-used-y,m) to the variable targets. At the end of Rules.make, we then include the saved command lines for these targets (if they exist), needed to check whether the command changed and we hence need to rebuild.
2002-06-09kbuild: Put .cmd/.d files into the same directory as the targetKai Germaschewski
Previously, we always had put the .cmd/.d files into the local subdir - now we put them into the directory where the target lives, like some/dir/target.o <-> some/dir/.target.o.cmd It does not yet make a difference, since we always only generated targets in the local directory anyway, but that will change with tracking dependencies for .ver files.
2002-06-09kbuild: Rules.make cleanupKai Germaschewski
We use A/CFLAGS_KERNEL by default anyway, so no need to set them explicitly for built-in objects.
2002-06-09kbuild: Rearrange Rules.makeKai Germaschewski
This patch doesn't change anything but the order (and some comments) in Rules.make. The reason for that is that we use Rules.make for three different purposes, fastdep, modules_install and the actual building. As an example, we don't need all the dependencies and saved command lines when installing modules, so it'll speed up this pass to only include the rules which will actually get used.
2002-06-09kbuild: Generate dependencies for all targetsKai Germaschewski
So far, we had been lazy and not generated dependencies for debugging-only targets, like some/dir/foo.[is]. It actually cleans up Rules.make to handle them by the same mechanism, though. Additionally, make use of $(call if_changed) and $(call if_changed_dep) more consistent, the only difference now is post-processing of gcc -MD output, which is done for if_changed_dep but not for if_changed.
2002-06-09kbuild: Pass <target> to fixdepKai Germaschewski
cpp -MD guesses the target name from the source file name, but not always correctly, e.g. when compiling fixdep, it generates prequisites for fixdep.o instead of fixdep. fixdep now fixes up the -MD generated output to contain the right target, which is the one we pass on the command line.
2002-06-09kbuild: Small fixesKai Germaschewski
o When using "make -j<n>", the order in modversions.h could change, thus causing unnecessary rebuilds. o Move a comment in Rules.make which I forgot when I moved the associated code. o When descending into init/ during the final vmlinux link, add a '+' do tell make to use its normal "-j" jobserver handling. o It'd be nice to get the logic between make clean and make mrproper clearer. I think make clean should remove all targets used in the actual build, make mrproper should remove the rest, build-specific files, like e.g. the .*.cmd files used to save dependencies and command lines and other temporary files. A real small step in the direction: Remove .tmpversion/.tmp-export-objs at mrproper time.
2002-06-06kbuild: dependency generation fixesKai Germaschewski
o Fix a bug in fixdep.c, which could cause segfaults o Make sure that we build fixdep first of all, since we need it to build host programs.
2002-06-06kbuild: Add rules for compiling programs on the hostKai Germaschewski
At a couple of places, we need to build programs which run on the compile host during building the kernel. Add a new variable "host-progs" to declare such programs. Rules.make will automatically provide rules to compile these programs with appropriate command lines etc. Compared to having explicit rules spread around for doing so, this has the following advantages: o shorter o automatically figures out dependencies and handles changing command lines o Nicer output in quiet mode ;-) Compiling host programs from multiple sources is also possible, analogous to multi-part objects. E.g. scripts/Makefile has host-progs := tkparse tkparse-objs := tkparse.o tkcond.o tkgen.o
2002-06-05kbuild: Use -nostdinc with kernel sourcesKai Germaschewski
Kernel code should not include userspace headers. To avoid that happening by mistake, ask gcc not to look into the usual places when looking for headers. We still need to find gcc headers for vararg and similar, though - achieved by the "-iwithprefix include" which will look into <gcc-path>/include, as proposed by Russell King. A similar patch went into 2.4, so not much breakage expected.
2002-06-05kbuild: Build modules by defaultKai Germaschewski
So here we are: make vmlinux/bzImage/whatever will now also build modules as it goes. Other than that, everything works as usual. "make modules" builds only the modules (but you shouldn't need it anymore). If you don't want the modules built, you can do "make KBUILD_MODULES= vmlinux/whatever" to only compile built-in objects. If people want it, I can also allow for "make vmlinux/whatever nomodules" to do the same. Also, add ' ' in Rules.make to properly align output in quiet mode.
2002-06-05kbuild: modversions improvementsKai Germaschewski
If an object was changed to not export symbols anymore, the corresponding stale .ver file would have been left lying around and been picked up when generating modversions.h. The obvious solution to remove include/linux/modules/* at the beginning of "make dep" is not really good, since that means that .ver files would be regenerated unconditionally, thus causing a lot of possibly unnecessary rebuilds. So, instead, we build a temporary shadow tree of all export-objs (as empty files) during the recursive "make fastdep" phase, and use that to generate modversions.h. Ensure that we touch include/linux/modversions.h if any of the .ver files changes, that's our marker to rebuild all modversions affected files.