summaryrefslogtreecommitdiff
path: root/scripts/Makefile.lib
AgeCommit message (Collapse)Author
2005-12-26kbuild: set correct KBUILD_MODNAME when using well known kernel symbols as ↵Ustyugov Roman
module names This patch fixes a problem when we use well known kernel symbols as module names. For example, if module source name is current.c, idle_stack.c or etc., we have a bad KBUILD_MODNAME value. For example, KBUILD_MODNAME will be "get_current()" instead of "current", or "(init_thread_union.stack)" instead of "idle_task". The trick is to define a stringify macro on the commandline - named KBUILD_STR for namespace reasons - and then to stringify the module name. There are a few uses of KBUILD_MODNAME throughout the tree but the usage is for debug and will not be harmed by this change so left untouched for now. While at it KBUILD_BASENAME was changed too. Any spinlock usage in the unix module would have created wrong section names without it. Usage in spinlock.h fixed so it no longer stringify KBUILD_BASENAME. Original patch from Ustyogov Roman - all bugs introduced by me. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2005-07-25kbuild: introduce Kbuild.includeSam Ravnborg
Kbuild.include is a placeholder for definitions originally present in both the top-level Makefile and scripts/Makefile.build. There were a slight difference in the filechk definition, so the most videly used version was kept and usr/Makefile was adopted for this syntax. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> ---
2005-07-25kbuild: drop descend - converting existing usersSam Ravnborg
There was only two users left of descend. Fix them so they use $(clean)= and $(build)=. Drop definition of descend. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> ---
2005-02-02kbuild: Fix debugging leftoverSam Ravnborg
So now check for commandline options actually works again. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2005-01-30kbuild: Introdude KBUILD_NOCMDDEPSam Ravnborg
When tossing around with different gcc compilers there is no way to tell kbuild to ignore the new name of the compiler. The new option KBUILD_NOCMDDEP tell kbuild not to check the commandline for changes. This should be used with care because the resulting kernel may become inconsistent if one part is build with 2.96, and another part build with 3.3.4. So use only when you know what you are doing. Syntax: make KBUILD_NOCMDDEP=1 Original request for this feature came from hpa. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2005-01-29kbuild: Makefile.lib - small cleanupSam Ravnborg
Combine duplicate code in two smaller 'functions' Signed-off-by: Sam Ravnborg
2004-10-27kbuild/usr: initramfs list fixed and simplifiedSam Ravnborg
Moving logic to scripts/gen_initramfs_list.sh make a nice cleanup in usr/Makefile. A new initramfs image will be generated if the initramfs_list file changes. This patch also fixes the bug with make O=.. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2004-08-15kbuild: Generate *.lds instead of *.lds.sSam Ravnborg
When building a kernel on platforms where the filesytem do not distingush between upper and lower case the rule: .S -> .s did not work. In a normal build this is only used for linker scripts. So create a separate rule for .lds files, and use generic cpp flags. Patch from: Dan Aloni <da-x@colinux.org> Modified to use cpp flags + added documentation. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2004-08-11kbuild: Separate out host-progs handlingSam Ravnborg
Concentrating all host-progs functionality in one file made a more readable Makefile.lib - and allow for potential reuse of host-progs functionality. Processing of host-progs related stuff are avoided when no host-progs are specified. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2004-03-15[PATCH] Fix early parallel make failuresAndrew Morton
From: Sam Ravnborg <sam@ravnborg.org> Ingo said: Starting at around 2.6.4-rc2-mm1, I keep seeing 'scripts/fixdep: Text file busy' messages when doing a -j10 bzImage build - which seems to suggest that by the time fixdep is used by the build system it's not built yet. Sam said: I was pretty sure it was something I had caused, so I gave it a spin. What actually happened was that we tried to build the target 'silentoldconfig' in parrallel with 'scripts'. Since 'silentoldconfig' started a new make and then the config target needed 'scripts' we saw two parallel runs. The way I decided to fix it was to split scripts/ in two parts. The first part is now the very basic stuff - moved to scripts/basic/. The second part is dependent on kernel config etc. and kept in scripts/ In the 2.7 timeframe i will redo this initial stuff - it's becoming too messy for anyone to understand today. Description: Fix dependencies in early phases of kernel build. This solves a few problems nively: modpost is no longer rebuild twicewhen reaching the 'target' state 'make -j10' now works nicely again The patch is rather large due to the following file moves: mkdir scripts/basic mv scripts/fixdep.c scripts/basic mv scripts/split-include.c scripts/basic mv scripts/docproc.c scripts/basic
2004-02-03[PATCH] kbuild: Unmangle include options for gccAndrew Morton
From: Sam Ravnborg <sam@ravnborg.org> When utilising the make O=... option the include options for gcc were mangled even when absolute paths was used. Also remove duplication of CPPFLAGS. They were assigned twice. [It is still possible for architectures to modify CPPFLAGS]. This patch allows xconfig to be build with make O=... xconfig.It will also help development of external modules with absolute paths for their -I options. Note: As a side effect a full recompile of the kernel takes place due to changes in number of gcc options.
2003-09-21Merge mars.ravnborg.org:/home/sam/bk/kbuild-patchset-1Sam Ravnborg
into mars.ravnborg.org:/home/sam/bk/sepout
2003-09-20kbuild: Escape "'" in cmd macroSam Ravnborg
Building drivers/eisa were broken in non-verbose mode. This has been fixed by escaping "'" for cmd. It was used in $(call cmd,eisaid). Escaping "'" is already done by if_changed, so this brings cmd in line with if_changed
2003-09-11kbuild: Separate output directorySam Ravnborg
Separate output directory support enables the following (at least): o Building several configurations from the same SRC base, and in parrallel o Building from a RO media o More efficient build if files are retreived via NFS (files stored locally) Usage is simple: cd /path/to/kernel/src mkdir ~/build/kernel make O=~/build/kernel [Make options] Please note: The O= syntax must be used for ALL invocations of make. As an alternative you may set KBUILD_OUTPUT to the directory where to put the output files. The patch works for me, and I have tried with various configurations, including allnoconfig and defconfig. How it works: If the O= option is used, or KBUILD_OUTPUT is set then a second invocation of make happens in the output directory. The second invocation of make uses VPATH to tell make where to locate the files. Furthermore include options for gcc is modifyied to point both in the directory where the kernel src is located, and in the directory where the output files are located. The latter is used for generated .h files. When building the kernel the asm symlink is created. To support this a new 'include2' directory is created. Within include2/ asm is a symlink to the asm-$(ARCH) directory in the kernel src. Also when building the kernel the asm-offset.h file is created, and located in the include/asm-$(ARCH) directory, but included via <asm/asm-offset.h>. Therefore within include/ another asm symlink is created pointing to the asm-$(ARCH) directory located in the output directory. In Makefile.build the output directory is created if not already present. This was needed to support xfs, and oprofile. The patch is loosly based on ideas from Kai G. Roman Zippel introduced support for this in kconfig long time ago
2003-06-09Merge mars.ravnborg.org:/home/sam/src/linux/kernel/bk/linux-2.5Sam Ravnborg
into mars.ravnborg.org:/home/sam/src/linux/kernel/bk/kbuild
2003-06-09kbuild: kill do_cmdSam Ravnborg
The lonely two users of do_cmd has gone. Therefore we can now kill it for good
2003-06-07[PATCH] be more flexible about creating library archivesSam Ravnborg
New makefile variable introduced: lib-y The lib-y syntax allows you to do the usual tricks such as: lib-$(CONFIG_SMP) += percpu_counter.o A built-in.o is always present in a directory that list .o files in either obj-* or lib-*. In contrast, lib.a is made only when lib-y is defined. I also updated lib/Makefile, so that crc32.o is now always built-in if selected.
2003-03-11kbuild: build-targets replaced with alwaysSam Ravnborg
The former name "kbuild-targets" did not give the user the intuitive feeling that this target will be build regards less of any dependencies no matter if we compile modules or not. The new name "always" imply that this will be build always, and tus is more informative. Fixed the few users of build-targets, and added a warning in Makefile.build
2003-03-10kbuild: Introduced extra-y, as replacement for EXTRA_TARGETSSam Ravnborg
EXTRA_TARGETS has been overloaded with functionality. This is now split in two: targets := list targets kbuild did not know of otherwise extra-y := list targets to be build when not building modules only. extra-y is mainly used to list .o files that is not to be included in the fnal built-in.o file for a directory.
2003-03-10kbuild: Use targets := to tell kbuild about additional targetsSam Ravnborg
EXTRA_TARGETS served several purposes before: 1) List targets to be build (built-in only) 2) Inform kbuild of targets within the makefile Mixing the above are causing confusion, so for now on targets := is used to inform kbuild about targets in a Makefile - that it otherwise did not know about. kbuild uses the "targets :=" information to: a) read the dependency file .target.cmd b) delete the target file during make clean
2003-02-10kbuild: Allow for ',$ in commandsKai Germaschewski
Quote ',$ before passing them to the shell - ' must be escaped for echo, $$ will be converted to $ by make. This allows to use e.g. perl commands in the build with support from the generic $(call if_changed,...). by Konrad Eisele
2003-02-10kbuild: Customflags for cmd_objcopyKai Germaschewski
From Konrad Eisele: > like with cmd_ld in scripts/Makefile.lib having possibility to add > customflags with cmd_objcopy would be nice. When building a > ROMKernel I'd like to use: > OBJCOPYFLAGS_rompiggydata := --remove-section=.text > OBJCOPYFLAGS_$(MODEL)piggytext := --only-section=.text
2003-01-27kbuild: Made cmd_link_multi readableSam Ravnborg
Introduced ld_flags, and separated out the common parts of link_multi for normal and module objects. Added a bit of a comment as well
2003-01-24kbuild: Remove obsolete CONFIG_MODVERSIONS cruftKai Germaschewski
Though the CONFIG_MODVERSIONS option was removed with rusty's module rewrite and the associated code broken, a lot of that code was still living on here and there. Now it's gone for good.
2003-01-24kbuild: Remove -DEXPORT_SYMTAB switchKai Germaschewski
rusty's module rewrite removed the reference to EXPORT_SYMTAB from linux/module.h, and it's not used anywhere else, either.
2002-12-30kbuild: $(build) and $(clean) macros for make invocationSam Ravnborg
The former macro $(descend ...) hide for make the fact that a recursively make was invoked. The replacement $(Q)$(MAKE) -f scripts/Makefile.build obj=dir was too verbose. Introduced $(build) and $(clean) allowing the following syntax: $(Q)$(MAKE) $(build)=arch/i386/boot target and similar for clean. Introduced $(build) and $(clean) in general, and for i386 architecture.
2002-12-05kbuild: Fix spurious warningKai Germaschewski
As pointed out by Greg KH, kbuild gives spurious warnings in some cases, fixed by this patch.
2002-12-04kbuild: Build modules as '.ko'Kai Germaschewski
2002-12-01Merge http://linux-sam.bkbits.net/kbuildKai Germaschewski
into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make
2002-12-01[PATCH] module names fixRusty Russell
By Kai Germaschewski: "Well, I have another solution, which doesn't need additional Makefile magic or anything. I just put the module name into each .o file where <linux/module.h> is included. Putting it into the section .gnu.linkonce.modname has the effect that even for multi-part modules, we only end up with one copy of the name. Caveat: I'm using the preprocessor macro KBUILD_MODNAME to know what to put into .gnu.linkonce.modname. The following used to happen: (drivers/isdn/eicon/Makefile) divas-objs := common.o Divas_mod.o ... eicon-objs := common.o eicon_mod.o ... Divas_mod.o is compiled with -DKBUILD_MODNAME=divas eicon_mod.o is compiled with -DKBUILD_MODNAME=eicon common.o is compiled with -DKBUILD_MODNAME=divas_eicon So in the case above, both divas.o and eicon.o would end up with a .gnu.linkonce.modname section containing "divas_eicon" My fix to this is to not define KBUILD_MODNAME when compiling an object whilch will be linked into more than one module - so common.o gets no .gnu.linkonce.modname section at all. Works fine here. Now, doing this I remove one of the reasons why we would need modules linked as '.ko' ;), but it seems much cleaner than generating a temporary file, using objcopy etc."
2002-11-23kbuild: No longer use descend macro, added 'Kernel: xxx is ready' textSam Ravnborg
In the top-level Makefile and in the i386 architecture specific makefile no longer use descend. i386 is used as template for other architectures, so they shall be kept nice. Also added a little text: Kernel: arch/i386/boot/bzImage is ready A reminder of what target you did build, and where it is located
2002-11-22kbuild: Introduced build-targetsSam Ravnborg
build-targets is used to list targets that is always built. This allowed misuse of EXTRA_TARGETS to be deleted. built-in.o is now only created for directories defining a obj-* variable, avoiding this for scripts and lxdialog One Makefile needed a dummy obj- statement
2002-11-22kbuild: Move flags to Makefile.libSam Ravnborg
a_flags defined in Makefile.lib, and a set of flags made for host related rules. This avoided some duplication in Makefile.build
2002-11-20kbuild: Fix KBUILD_MODNAMEKai Germaschewski
The KBUILD_MODNAME patch which got included lately dated back a couple of months ago and thus got the following wrong: o multi-part components which don't live in the local subdir o using foo-y instead of foo-objs
2002-11-10[PATCH] KBUILD_MODNAME define for build systemRusty Russell
By Kai Germaschewski. This patch adds a -DKBUILD_MODNAME to the kernel compile, which contains the base of the module name which is being built. - Some sreorganization of the c_flags since they're needed for generating modversions (.ver) and compiling - Use the right KBUILD_MODNAME also when the user just wants a .i/.s/.lst file for debugging and also when generating modversions - It looks like with your current approach you can't have a ',' or '-' in KBUILD_MODNAME - however, that means that KBUILD_MODNAME is not quite right for passing module parameters for built-in modules on the command line, it would be confusing to pass parameters for ide-cd as ide_cd.foo=whatever. So that part could use a little more thought. - If you think your module_names trick makes a noticable difference, feel free to re-add it. - It's possible that objects are linked into more than one module - I suppose this shouldn't be a problem, since these objects hopefully don't have a module_init() nor do they export symbols. Not sure if your patch did handle this.
2002-10-29[PATCH] new kernel configuration 1/7Roman Zippel
This adds the needed kbuild changes: - support to compile host libraries and c++ programs - change config calls into kconfig
2002-10-27kbuild: scrits/Makefile.libSam Ravnborg
Moved generic definitions to Makefile.lib, This allows us to share all generic definitions between the different Makefiles. Performance impact has been measured to less than 1%