diff options
| author | Sam Ravnborg <sam@mars.ravnborg.org> | 2005-03-12 10:49:12 +0100 |
|---|---|---|
| committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2005-03-12 10:49:12 +0100 |
| commit | 0e6affc5a27c00c2f740f149b6b491e268d2396c (patch) | |
| tree | cdc44a8fb35336e6655c824da4c94948e41b3820 | |
| parent | 12dd2ea4409a7b2829641b5af9ec14f68295d718 (diff) | |
| parent | d605b1d3fef0abb0c76798101859b26e04e3e51a (diff) | |
Merge mars.ravnborg.org:/home/sam/bk/linux-2.6
into mars.ravnborg.org:/home/sam/bk/kbuild
| -rw-r--r-- | Makefile | 51 | ||||
| -rw-r--r-- | arch/i386/Makefile | 5 | ||||
| -rw-r--r-- | arch/i386/kernel/Makefile | 2 | ||||
| -rw-r--r-- | drivers/net/wireless/prism54/Makefile | 2 | ||||
| -rw-r--r-- | drivers/video/console/Makefile | 4 | ||||
| -rw-r--r-- | include/linux/module.h | 13 | ||||
| -rw-r--r-- | include/linux/moduleparam.h | 19 | ||||
| -rw-r--r-- | kernel/Makefile | 2 | ||||
| -rw-r--r-- | kernel/kallsyms.c | 4 | ||||
| -rw-r--r-- | scripts/Makefile.lib | 28 | ||||
| -rw-r--r-- | scripts/Makefile.modinst | 5 | ||||
| -rw-r--r-- | scripts/genksyms/genksyms.h | 16 | ||||
| -rw-r--r-- | scripts/kconfig/Makefile | 8 | ||||
| -rw-r--r-- | scripts/mod/modpost.c | 5 | ||||
| -rw-r--r-- | scripts/mod/modpost.h | 4 | ||||
| -rw-r--r-- | scripts/namespace.pl | 5 |
16 files changed, 110 insertions, 63 deletions
@@ -18,7 +18,7 @@ MAKEFLAGS += --no-print-directory # # Most importantly: sub-Makefiles should only ever modify files in # their own directory. If in some directory we have a dependency on -# a file in another dir (which doesn't happen often, but it's of +# a file in another dir (which doesn't happen often, but it's often # unavoidable when linking the built-in.o targets which finally # turn into vmlinux), we will call a sub make in that other dir, and # after that we are sure that everything which is in that other dir @@ -67,7 +67,7 @@ endif # kbuild supports saving output files in a separate directory. -# To locate output files in a separate directory two syntax'es are supported. +# To locate output files in a separate directory two syntaxes are supported. # In both cases the working directory must be the root of the kernel src. # 1) O= # Use "make O=dir/to/store/output/files/" @@ -78,7 +78,8 @@ endif # export KBUILD_OUTPUT=dir/to/store/output/files/ # make # -# The O= assigment takes precedence over the KBUILD_OUTPUT environment variable. +# The O= assignment takes precedence over the KBUILD_OUTPUT environment +# variable. # KBUILD_SRC is set on invocation of make in OBJ directory @@ -539,16 +540,14 @@ CFLAGS += $(call cc-option,-Wno-pointer-sign,) # Default kernel image to build when no specific target is given. # KBUILD_IMAGE may be overruled on the commandline or # set in the environment -# Also any assingments in arch/$(ARCH)/Makefiel take precedence over +# Also any assignments in arch/$(ARCH)/Makefile take precedence over # this default value export KBUILD_IMAGE ?= vmlinux # # INSTALL_PATH specifies where to place the updated kernel and system map -# images. Uncomment if you want to place them anywhere other than root. -# - -#export INSTALL_PATH=/boot +# images. Default is /boot, but you can set it to other values +export INSTALL_PATH ?= /boot # # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory @@ -898,7 +897,7 @@ depmod_opts := -b $(INSTALL_MOD_PATH) -r endif .PHONY: _modinst_post _modinst_post: _modinst_ - if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi + if [ -r System.map -a -x $(DEPMOD) ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi else # CONFIG_MODULES @@ -1096,9 +1095,17 @@ KBUILD_MODULES := 1 crmodverdir: $(Q)mkdir -p $(MODVERDIR) +.PHONY: $(objtree)/Module.symvers +$(objtree)/Module.symvers: + @test -e $(objtree)/Module.symvers || ( \ + echo; \ + echo " WARNING: Symbol version dump $(objtree)/Module.symvers"; \ + echo " is missing; modules will have no dependencies and modversions."; \ + echo ) + module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) .PHONY: $(module-dirs) modules -$(module-dirs): crmodverdir +$(module-dirs): crmodverdir $(objtree)/Module.symvers $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) modules: $(module-dirs) @@ -1136,20 +1143,30 @@ endif # KBUILD_EXTMOD # Generate tags for editors # --------------------------------------------------------------------------- +#We want __srctree to totally vanish out when KBUILD_OUTPUT is not set +#(which is the most common case IMHO) to avoid unneeded clutter in the big tags file. +#Adding $(srctree) adds about 20M on i386 to the size of the output file! + +ifeq ($(KBUILD_OUTPUT),) +__srctree = +else +__srctree = $(srctree)/ +endif + define all-sources - ( find $(srctree) $(RCS_FIND_IGNORE) \ + ( find $(__srctree) $(RCS_FIND_IGNORE) \ \( -name include -o -name arch \) -prune -o \ -name '*.[chS]' -print; \ - find $(srctree)/arch/$(ARCH) $(RCS_FIND_IGNORE) \ + find $(__srctree)arch/$(ARCH) $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print; \ - find $(srctree)/security/selinux/include $(RCS_FIND_IGNORE) \ + find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print; \ - find $(srctree)/include $(RCS_FIND_IGNORE) \ + find $(__srctree)include $(RCS_FIND_IGNORE) \ \( -name config -o -name 'asm-*' \) -prune \ -o -name '*.[chS]' -print; \ - find $(srctree)/include/asm-$(ARCH) $(RCS_FIND_IGNORE) \ + find $(__srctree)include/asm-$(ARCH) $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print; \ - find $(srctree)/include/asm-generic $(RCS_FIND_IGNORE) \ + find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ -name '*.[chS]' -print ) endef @@ -1172,7 +1189,7 @@ quiet_cmd_tags = MAKE $@ define cmd_tags rm -f $@; \ CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL"`; \ - $(all-sources) | xargs ctags $$CTAGSF -a + $(all-sources) | xargs ctags $$CTAGSF -a --extra=+f endef TAGS: FORCE diff --git a/arch/i386/Makefile b/arch/i386/Makefile index 408eda602561..314c7146e9bf 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile @@ -142,7 +142,10 @@ zlilo bzlilo: vmlinux zdisk bzdisk: vmlinux $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk -install fdimage fdimage144 fdimage288: vmlinux +fdimage fdimage144 fdimage288: vmlinux + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ + +install: $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ prepare: include/asm-$(ARCH)/asm_offsets.h diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index 711a5249f105..933787a46b4c 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile @@ -46,7 +46,7 @@ targets += vsyscall.lds # The DSO images are built using a special linker script. quiet_cmd_syscall = SYSCALL $@ - cmd_syscall = $(CC) -nostdlib $(SYSCFLAGS_$(@F)) \ + cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \ -Wl,-T,$(filter-out FORCE,$^) -o $@ export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH) diff --git a/drivers/net/wireless/prism54/Makefile b/drivers/net/wireless/prism54/Makefile index ab2ea14c51e6..fad305c76737 100644 --- a/drivers/net/wireless/prism54/Makefile +++ b/drivers/net/wireless/prism54/Makefile @@ -6,5 +6,3 @@ prism54-objs := islpci_eth.o islpci_mgt.o \ obj-$(CONFIG_PRISM54) += prism54.o -EXTRA_CFLAGS = -I$(PWD) #-DCONFIG_PRISM54_WDS - diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile index 7aa4373e06e0..451696dd843d 100644 --- a/drivers/video/console/Makefile +++ b/drivers/video/console/Makefile @@ -39,5 +39,5 @@ quiet_cmd_conmakehash = CNMKHSH $@ sed -e '/\#include <[^>]*>/p' -e 's/types/init/' \ -e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@ -$(obj)/promcon_tbl.c: $(src)/prom.uni FORCE - $(call if_changed,conmakehash) +$(obj)/promcon_tbl.c: $(src)/prom.uni + $(call cmd,conmakehash) diff --git a/include/linux/module.h b/include/linux/module.h index 7c66600fc66b..d0ae6dbdd3f5 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -77,24 +77,14 @@ void sort_main_extable(void); extern struct subsystem module_subsys; #ifdef MODULE -#define ___module_cat(a,b) __mod_ ## a ## b -#define __module_cat(a,b) ___module_cat(a,b) -#define __MODULE_INFO(tag, name, info) \ -static const char __module_cat(name,__LINE__)[] \ - __attribute_used__ \ - __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info - #define MODULE_GENERIC_TABLE(gtype,name) \ extern const struct gtype##_id __mod_##gtype##_table \ __attribute__ ((unused, alias(__stringify(name)))) extern struct module __this_module; #define THIS_MODULE (&__this_module) - #else /* !MODULE */ - #define MODULE_GENERIC_TABLE(gtype,name) -#define __MODULE_INFO(tag, name, info) #define THIS_MODULE ((struct module *)0) #endif @@ -560,7 +550,8 @@ static inline void MODULE_PARM_(void) { } /* DEPRECATED: Do not use. */ #define MODULE_PARM(var,type) \ struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \ -{ __stringify(var), type, &MODULE_PARM_ }; +{ __stringify(var), type, &MODULE_PARM_ }; \ +__MODULE_PARM_TYPE(var, type); #else #define MODULE_PARM(var,type) static void __attribute__((__unused__)) *__parm_##var = &MODULE_PARM_; #endif diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 685eab959c49..368ec8e45bd0 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -13,6 +13,19 @@ #define MODULE_PARAM_PREFIX __stringify(KBUILD_MODNAME) "." #endif +#ifdef MODULE +#define ___module_cat(a,b) __mod_ ## a ## b +#define __module_cat(a,b) ___module_cat(a,b) +#define __MODULE_INFO(tag, name, info) \ +static const char __module_cat(name,__LINE__)[] \ + __attribute_used__ \ + __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info +#else /* !MODULE */ +#define __MODULE_INFO(tag, name, info) +#endif +#define __MODULE_PARM_TYPE(name, _type) \ + __MODULE_INFO(parmtype, name##type, #name ":" _type) + struct kernel_param; /* Returns 0, or -errno. arg is in kp->arg. */ @@ -65,7 +78,7 @@ struct kparam_array #define module_param_named(name, value, type, perm) \ param_check_##type(name, &(value)); \ module_param_call(name, param_set_##type, param_get_##type, &value, perm); \ - __MODULE_INFO(parmtype, name##type, #name ":" #type) + __MODULE_PARM_TYPE(name, #type) #define module_param(name, type, perm) \ module_param_named(name, name, type, perm) @@ -76,7 +89,7 @@ struct kparam_array = { len, string }; \ module_param_call(name, param_set_copystring, param_get_string, \ &__param_string_##name, perm); \ - __MODULE_INFO(parmtype, name##type, #name ":string") + __MODULE_PARM_TYPE(name, "string") /* Called on module insert or kernel boot */ extern int parse_args(const char *name, @@ -138,7 +151,7 @@ extern int param_get_invbool(char *buffer, struct kernel_param *kp); sizeof(array[0]), array }; \ module_param_call(name, param_array_set, param_array_get, \ &__param_arr_##name, perm); \ - __MODULE_INFO(parmtype, name##type, #name ":array of " #type) + __MODULE_PARM_TYPE(name, "array of " #type) #define module_param_array(name, type, nump, perm) \ module_param_array_named(name, name, type, nump, perm) diff --git a/kernel/Makefile b/kernel/Makefile index d1a273ee6db6..eb88b446c2cc 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -47,7 +47,7 @@ $(obj)/config_data.gz: .config FORCE $(call if_changed,gzip) quiet_cmd_ikconfiggz = IKCFG $@ - cmd_ikconfiggz = (echo "const char kernel_config_data[] = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@ + cmd_ikconfiggz = (echo "static const char kernel_config_data[] = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@ targets += config_data.h $(obj)/config_data.h: $(obj)/config_data.gz FORCE $(call if_changed,ikconfiggz) diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index c8a276cfb173..1627f8d6e0cd 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -355,7 +355,7 @@ static int s_show(struct seq_file *m, void *p) return 0; } -struct seq_operations kallsyms_op = { +static struct seq_operations kallsyms_op = { .start = s_start, .next = s_next, .stop = s_stop, @@ -397,7 +397,7 @@ static struct file_operations kallsyms_operations = { .release = kallsyms_release, }; -int __init kallsyms_init(void) +static int __init kallsyms_init(void) { struct proc_dir_entry *entry; diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 6e75ced8b583..7cf75cc4f849 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -183,15 +183,24 @@ cmd_gzip = gzip -f -9 < $< > $@ # Generic stuff # =========================================================================== +ifneq ($(KBUILD_NOCMDDEP),1) +# Check if both arguments has same arguments. Result in empty string if equal +# User may override this check using make KBUILD_NOCMDDEP=1 +arg-check = $(strip $(filter-out $(1), $(2)) $(filter-out $(2), $(1)) ) + +endif + +# echo command. Short version is $(quiet) equals quiet, otherwise full command +echo-cmd = $(if $($(quiet)cmd_$(1)), \ + echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) + # function to only execute the passed command if necessary # >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file # note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars - -if_changed = $(if $(strip $? \ - $(filter-out $(cmd_$(1)),$(cmd_$@))\ - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ +# +if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ @set -e; \ - $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ + $(echo-cmd) \ $(cmd_$(1)); \ echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd) @@ -200,10 +209,9 @@ if_changed = $(if $(strip $? \ # file if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ - $(filter-out $(cmd_$(1)),$(cmd_$@))\ - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ + $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ @set -e; \ - $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ + $(echo-cmd) \ $(cmd_$(1)); \ scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ rm -f $(depfile); \ @@ -213,9 +221,7 @@ if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ # will check if $(cmd_foo) changed, or any of the prequisites changed, # and if so will execute $(rule_foo) -if_changed_rule = $(if $(strip $? \ - $(filter-out $(cmd_$(1)),$(cmd_$@))\ - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ +if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ @set -e; \ $(rule_$(1))) diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index ba47b7fcb140..85d6494e3c24 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -21,8 +21,9 @@ quiet_cmd_modules_install = INSTALL $@ # Modules built outside the kernel source tree go into extra by default INSTALL_MOD_DIR ?= extra +ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(KBUILD_EXTMOD),,$(@D)) -modinst_dir = $(MODLIB)/$(if $(filter ../% /%,$@),$(INSTALL_MOD_DIR)/,kernel/$(@D)) +modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D)) $(modules): - $(call cmd,modules_install,$(modinst_dir)) + $(call cmd,modules_install,$(MODLIB)/$(modinst_dir)) diff --git a/scripts/genksyms/genksyms.h b/scripts/genksyms/genksyms.h index 7b711731abf2..f09af47ab281 100644 --- a/scripts/genksyms/genksyms.h +++ b/scripts/genksyms/genksyms.h @@ -25,7 +25,6 @@ #define MODUTILS_GENKSYMS_H 1 #include <stdio.h> -#include <assert.h> enum symbol_type @@ -89,8 +88,17 @@ void error_with_pos(const char *, ...); #define MODUTILS_VERSION "<in-kernel>" -#define xmalloc(size) ({ void *__ptr = malloc(size); assert(__ptr || size == 0); __ptr; }) -#define xstrdup(str) ({ char *__str = strdup(str); assert(__str); __str; }) - +#define xmalloc(size) ({ void *__ptr = malloc(size); \ + if(!__ptr && size != 0) { \ + fprintf(stderr, "out of memory\n"); \ + exit(1); \ + } \ + __ptr; }) +#define xstrdup(str) ({ char *__str = strdup(str); \ + if (!__str) { \ + fprintf(stderr, "out of memory\n"); \ + exit(1); \ + } \ + __str; }) #endif /* genksyms.h */ diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 51492ba6fbcd..5a5ddc40f36c 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -50,10 +50,12 @@ endif # Help text used by make help help: - @echo ' oldconfig - Update current config utilising a line-oriented program' + @echo ' config - Update current config utilising a line-oriented program' @echo ' menuconfig - Update current config utilising a menu based program' @echo ' xconfig - Update current config utilising a QT based front-end' @echo ' gconfig - Update current config utilising a GTK based front-end' + @echo ' oldconfig - Update current config utilising a provided .config as base' + @echo ' randconfig - New config with random answer to all options' @echo ' defconfig - New config with default answer to all options' @echo ' allmodconfig - New config selecting modules when possible' @echo ' allyesconfig - New config where all options are accepted with yes' @@ -107,6 +109,10 @@ HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h +$(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped +$(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped +$(obj)/lex.zconf.c: $(src)/lex.zconf.c_shipped + $(obj)/qconf.o: $(obj)/.tmp_qtcheck ifeq ($(qconf-target),1) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 347549c35d6c..9b9f94c915d2 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -47,11 +47,10 @@ warn(const char *fmt, ...) va_end(arglist); } -void *do_nofail(void *ptr, const char *file, int line, const char *expr) +void *do_nofail(void *ptr, const char *expr) { if (!ptr) { - fatal("Memory allocation failure %s line %d: %s.\n", - file, line, expr); + fatal("modpost: Memory allocation failure: %s.\n", expr); } return ptr; } diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index eb8815ae209e..7334d839145d 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h @@ -53,8 +53,8 @@ static inline void __endian(const void *src, void *dest, unsigned int size) #endif -#define NOFAIL(ptr) do_nofail((ptr), __FILE__, __LINE__, #ptr) -void *do_nofail(void *ptr, const char *file, int line, const char *expr); +#define NOFAIL(ptr) do_nofail((ptr), #ptr) +void *do_nofail(void *ptr, const char *expr); struct buffer { char *p; diff --git a/scripts/namespace.pl b/scripts/namespace.pl index 399c831e5d12..88e30e82f1ca 100644 --- a/scripts/namespace.pl +++ b/scripts/namespace.pl @@ -406,6 +406,11 @@ sub resolve_external_references && $name !~ /^__.*per_cpu_end/ && $name !~ /^__alt_instructions/ && $name !~ /^__setup_/ + && $name !~ /^jiffies/ + && $name !~ /^__mod_timer/ + && $name !~ /^__mod_page_state/ + && $name !~ /^init_module/ + && $name !~ /^cleanup_module/ ) { printf "Cannot resolve "; printf "weak " if ($type eq "w"); |
