Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Jan 5, 2006
2 parents 52347f4 + 8ded4ac commit 25c862c
Show file tree
Hide file tree
Showing 54 changed files with 4,485 additions and 3,888 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Module.symvers
# Generated include files
#
include/asm
include/asm-*/asm-offsets.h
include/config
include/linux/autoconf.h
include/linux/compile.h
Expand Down
24 changes: 12 additions & 12 deletions Documentation/kbuild/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ included in the kernel tree.
What is covered within this file is mainly information to authors
of modules. The author of an external modules should supply
a makefile that hides most of the complexity so one only has to type
'make' to buld the module. A complete example will be present in
'make' to build the module. A complete example will be present in
chapter �. Creating a kbuild file for an external module".


Expand Down Expand Up @@ -69,7 +69,7 @@ when building an external module.

--- 2.2 Available targets

$KDIR refers to path to kernel source top-level directory
$KDIR refers to the path to the kernel source top-level directory

make -C $KDIR M=`pwd`
Will build the module(s) located in current directory.
Expand All @@ -87,19 +87,19 @@ when building an external module.
make -C $KDIR M=$PWD modules_install
Install the external module(s).
Installation default is in /lib/modules/<kernel-version>/extra,
but may be prefixed with INSTALL_MOD_PATH - see separate chater.
but may be prefixed with INSTALL_MOD_PATH - see separate chapter.

make -C $KDIR M=$PWD clean
Remove all generated files for the module - the kernel
source directory is not moddified.
source directory is not modified.

make -C $KDIR M=`pwd` help
help will list the available target when building external
modules.

--- 2.3 Available options:

$KDIR refer to path to kernel src
$KDIR refers to the path to the kernel source top-level directory

make -C $KDIR
Used to specify where to find the kernel source.
Expand Down Expand Up @@ -206,11 +206,11 @@ following files:

KERNELDIR := /lib/modules/`uname -r`/build
all::
$(MAKE) -C $KERNELDIR M=`pwd` $@
$(MAKE) -C $(KERNELDIR) M=`pwd` $@

# Module specific targets
genbin:
echo "X" > 8123_bini.o_shipped
echo "X" > 8123_bin.o_shipped

endif

Expand Down Expand Up @@ -341,13 +341,13 @@ directory and therefore needs to deal with this in their kbuild file.
EXTRA_CFLAGS := -Iinclude
8123-y := 8123_if.o 8123_pci.o 8123_bin.o

Note that in the assingment there is no space between -I and the path.
This is a kbuild limitation and no space must be present.
Note that in the assignment there is no space between -I and the path.
This is a kbuild limitation: there must be no space present.


=== 6. Module installation

Modules which are included in the kernel is installed in the directory:
Modules which are included in the kernel are installed in the directory:

/lib/modules/$(KERNELRELEASE)/kernel

Expand All @@ -365,7 +365,7 @@ External modules are installed in the directory:
=> Install dir: /frodo/lib/modules/$(KERNELRELEASE)/kernel

INSTALL_MOD_PATH may be set as an ordinary shell variable or as in the
example above be specified on the commandline when calling make.
example above be specified on the command line when calling make.
INSTALL_MOD_PATH has effect both when installing modules included in
the kernel as well as when installing external modules.

Expand All @@ -384,7 +384,7 @@ External modules are installed in the directory:

=== 7. Module versioning

Module versioning are enabled by the CONFIG_MODVERSIONS tag.
Module versioning is enabled by the CONFIG_MODVERSIONS tag.

Module versioning is used as a simple ABI consistency check. The Module
versioning creates a CRC value of the full prototype for an exported symbol and
Expand Down
30 changes: 17 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,6 @@ export quiet Q KBUILD_VERBOSE
cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)

# For backward compatibility
check_gcc = $(warning check_gcc is deprecated - use cc-option) \
$(call cc-option, $(1),$(2))

# cc-option-yn
# Usage: flag := $(call cc-option-yn, -march=winchip-c6)
cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
Expand Down Expand Up @@ -481,18 +477,20 @@ ifeq ($(dot-config),1)

# Read in dependencies to all Kconfig* files, make sure to run
# oldconfig if changes are detected.
-include .config.cmd
-include .kconfig.d

include .config

# If .config needs to be updated, it will be done via the dependency
# that autoconf has on .config.
# To avoid any implicit rule to kick in, define an empty command
.config: ;
.config .kconfig.d: ;

# If .config is newer than include/linux/autoconf.h, someone tinkered
# with it and forgot to run make oldconfig
include/linux/autoconf.h: .config
# with it and forgot to run make oldconfig.
# If kconfig.d is missing then we are probarly in a cleaned tree so
# we execute the config step to be sure to catch updated Kconfig files
include/linux/autoconf.h: .kconfig.d .config
$(Q)mkdir -p include/linux
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
else
Expand Down Expand Up @@ -1066,7 +1064,7 @@ help:
@echo ' all - Build all targets marked with [*]'
@echo '* vmlinux - Build the bare kernel'
@echo '* modules - Build all modules'
@echo ' modules_install - Install all modules'
@echo ' modules_install - Install all modules to INSTALL_MOD_PATH (default: /)'
@echo ' dir/ - Build all files in dir and below'
@echo ' dir/file.[ois] - Build specified target only'
@echo ' dir/file.ko - Build module including final link'
Expand Down Expand Up @@ -1240,8 +1238,11 @@ cscope: FORCE
quiet_cmd_TAGS = MAKE $@
define cmd_TAGS
rm -f $@; \
ETAGSF=`etags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_GPL --extra=+f"`; \
$(all-sources) | xargs etags $$ETAGSF -a
ETAGSF=`etags --version | grep -i exuberant >/dev/null && \
echo "-I __initdata,__exitdata,__acquires,__releases \
-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
--extra=+f --c-kinds=+px"`; \
$(all-sources) | xargs etags $$ETAGSF -a
endef

TAGS: FORCE
Expand All @@ -1251,8 +1252,11 @@ TAGS: FORCE
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 --extra=+f"`; \
$(all-sources) | xargs ctags $$CTAGSF -a
CTAGSF=`ctags --version | grep -i exuberant >/dev/null && \
echo "-I __initdata,__exitdata,__acquires,__releases \
-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
--extra=+f --c-kinds=+px"`; \
$(all-sources) | xargs ctags $$CTAGSF -a
endef

tags: FORCE
Expand Down
3 changes: 3 additions & 0 deletions arch/x86_64/boot/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bootsect
bzImage
setup
1 change: 1 addition & 0 deletions arch/x86_64/boot/tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
1 change: 1 addition & 0 deletions arch/x86_64/ia32/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vsyscall*.so
2 changes: 1 addition & 1 deletion drivers/char/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
consolemap_deftbl.c
defkeymap.c

qtronixmap.c
1 change: 1 addition & 0 deletions drivers/ieee1394/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oui.c
4 changes: 4 additions & 0 deletions drivers/md/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mktables
raid6altivec*.c
raid6int*.c
raid6tables.c
1 change: 1 addition & 0 deletions drivers/net/wan/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wanxlfw.inc
3 changes: 3 additions & 0 deletions drivers/scsi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
53c700_d.h
53c7xx_d.h
53c7xx_u.h
6 changes: 6 additions & 0 deletions drivers/scsi/aic7xxx/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
aic79xx_reg.h
aic79xx_reg_print.c
aic79xx_seq.h
aic7xxx_reg.h
aic7xxx_reg_print.c
aic7xxx_seq.h
1 change: 0 additions & 1 deletion include/asm-mips/.gitignore

This file was deleted.

3 changes: 1 addition & 2 deletions include/linux/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
/*
* Must define these before including other files, inline functions need them
*/
#define LOCK_SECTION_NAME \
".text.lock." __stringify(KBUILD_BASENAME)
#define LOCK_SECTION_NAME ".text.lock."KBUILD_BASENAME

#define LOCK_SECTION_START(extra) \
".subsection 1\n\t" \
Expand Down
4 changes: 2 additions & 2 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ config OBSOLETE_MODPARM
If unsure, say Y.

config MODVERSIONS
bool "Module versioning support (EXPERIMENTAL)"
depends on MODULES && EXPERIMENTAL
bool "Module versioning support"
depends on MODULES
help
Usually, you have to use modules compiled with your kernel.
Saying Y here makes it sometimes possible to use modules
Expand Down
5 changes: 5 additions & 0 deletions kernel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Generated files
#
config_data.h
config_data.gz
5 changes: 4 additions & 1 deletion scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#
# Generated files
#
conmakehash
kallsyms
pnmtologo

bin2c
2 changes: 1 addition & 1 deletion scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ subdir-$(CONFIG_MODVERSIONS) += genksyms
subdir-$(CONFIG_MODULES) += mod

# Let clean descend into subdirs
subdir- += basic lxdialog kconfig package
subdir- += basic kconfig package
8 changes: 5 additions & 3 deletions scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ obj-dirs := $(addprefix $(obj)/,$(obj-dirs))
# Note: It's possible that one object gets potentially linked into more
# than one module. In that case KBUILD_MODNAME will be set to foo_bar,
# where foo and bar are the name of the modules.
basename_flags = -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F)))
modname_flags = $(if $(filter 1,$(words $(modname))),-DKBUILD_MODNAME=$(subst $(comma),_,$(subst -,_,$(modname))))
name-fix = $(subst $(comma),_,$(subst -,_,$1))
basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(*F)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")

_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o)
_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
Expand Down Expand Up @@ -113,7 +115,7 @@ endif

c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
$(__c_flags) $(modkern_cflags) \
$(basename_flags) $(modname_flags)
-D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)

a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
$(__a_flags) $(modkern_aflags)
Expand Down
15 changes: 14 additions & 1 deletion scripts/basic/fixdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,22 @@ void usage(void)
exit(1);
}

/*
* Print out the commandline prefixed with cmd_<target filename> :=
* If commandline contains '#' escape with '\' so make to not see
* the '#' as a start-of-comment symbol
**/
void print_cmdline(void)
{
printf("cmd_%s := %s\n\n", target, cmdline);
char *p = cmdline;

printf("cmd_%s := ", target);
for (; *p; p++) {
if (*p == '#')
printf("\\");
printf("%c", *p);
}
printf("\n\n");
}

char * str_config = NULL;
Expand Down
4 changes: 4 additions & 0 deletions scripts/genksyms/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
keywords.c
lex.c
parse.[ch]
genksyms
Loading

0 comments on commit 25c862c

Please sign in to comment.