Skip to content

Commit

Permalink
Merge branch 'for-33' of git://repo.or.cz/linux-kbuild
Browse files Browse the repository at this point in the history
* 'for-33' of git://repo.or.cz/linux-kbuild: (29 commits)
  net: fix for utsrelease.h moving to generated
  gen_init_cpio: fixed fwrite warning
  kbuild: fix make clean after mismerge
  kbuild: generate modules.builtin
  genksyms: properly consider  EXPORT_UNUSED_SYMBOL{,_GPL}()
  score: add asm/asm-offsets.h wrapper
  unifdef: update to upstream revision 1.190
  kbuild: specify absolute paths for cscope
  kbuild: create include/generated in silentoldconfig
  scripts/package: deb-pkg: use fakeroot if available
  scripts/package: add KBUILD_PKG_ROOTCMD variable
  scripts/package: tar-pkg: use tar --owner=root
  Kbuild: clean up marker
  net: add net_tstamp.h to headers_install
  kbuild: move utsrelease.h to include/generated
  kbuild: move autoconf.h to include/generated
  drop explicit include of autoconf.h
  kbuild: move compile.h to include/generated
  kbuild: drop include/asm
  kbuild: do not check for include/asm-$ARCH
  ...

Fixed non-conflicting clean merge of modpost.c as per comments from
Stephen Rothwell (modpost.c had grown an include of linux/autoconf.h
that needed to be changed to generated/autoconf.h)
  • Loading branch information
torvalds committed Dec 17, 2009
2 parents 331d9d5 + 46e75f6 commit 5a865c0
Show file tree
Hide file tree
Showing 90 changed files with 556 additions and 401 deletions.
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*.lst
*.symtypes
*.order
modules.builtin
*.elf
*.bin
*.gz
Expand All @@ -45,14 +46,8 @@ Module.symvers
#
# Generated include files
#
include/asm
include/asm-*/asm-offsets.h
include/config
include/linux/autoconf.h
include/linux/compile.h
include/linux/version.h
include/linux/utsrelease.h
include/linux/bounds.h
include/generated

# stgit generated dirs
Expand Down
1 change: 1 addition & 0 deletions Documentation/dontdiff
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ gconf
gen-devlist
gen_crc32table
gen_init_cpio
generated
genheaders
genksyms
*_gray256.c
Expand Down
14 changes: 14 additions & 0 deletions Documentation/kbuild/kbuild.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
Output files

modules.order
--------------------------------------------------
This file records the order in which modules appear in Makefiles. This
is used by modprobe to deterministically resolve aliases that match
multiple modules.

modules.builtin
--------------------------------------------------
This file lists all modules that are built into the kernel. This is used
by modprobe to not fail when trying to load something builtin.


Environment variables

KCPPFLAGS
Expand Down
8 changes: 7 additions & 1 deletion Documentation/kbuild/kconfig.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,16 @@ KCONFIG_AUTOCONFIG
This environment variable can be set to specify the path & name of the
"auto.conf" file. Its default value is "include/config/auto.conf".

KCONFIG_TRISTATE
--------------------------------------------------
This environment variable can be set to specify the path & name of the
"tristate.conf" file. Its default value is "include/config/tristate.conf".

KCONFIG_AUTOHEADER
--------------------------------------------------
This environment variable can be set to specify the path & name of the
"autoconf.h" (header) file. Its default value is "include/linux/autoconf.h".
"autoconf.h" (header) file.
Its default value is "include/generated/autoconf.h".


======================================================================
Expand Down
4 changes: 2 additions & 2 deletions Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#####
# 1) Generate bounds.h

bounds-file := include/linux/bounds.h
bounds-file := include/generated/bounds.h

always := $(bounds-file)
targets := $(bounds-file) kernel/bounds.s
Expand Down Expand Up @@ -43,7 +43,7 @@ $(obj)/$(bounds-file): kernel/bounds.s Kbuild
# 2) Generate asm-offsets.h
#

offsets-file := include/asm/asm-offsets.h
offsets-file := include/generated/asm-offsets.h

always += $(offsets-file)
targets += $(offsets-file)
Expand Down
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5434,6 +5434,12 @@ F: drivers/uwb/*
F: include/linux/uwb.h
F: include/linux/uwb/

UNIFDEF
M: Tony Finch <[email protected]>
W: http://dotat.at/prog/unifdef
S: Maintained
F: scripts/unifdef.c

UNIFORM CDROM DRIVER
M: Jens Axboe <[email protected]>
W: http://www.kernel.dk
Expand Down
96 changes: 26 additions & 70 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,9 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage

# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
LINUXINCLUDE := -Iinclude \
$(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
-I$(srctree)/arch/$(hdr-arch)/include \
-include include/linux/autoconf.h
LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \
$(if $(KBUILD_SRC), -I$(srctree)/include) \
-include include/generated/autoconf.h

KBUILD_CPPFLAGS := -D__KERNEL__

Expand Down Expand Up @@ -465,7 +464,7 @@ ifeq ($(KBUILD_EXTMOD),)
# Carefully list dependencies so we do not try to build scripts twice
# in parallel
PHONY += scripts
scripts: scripts_basic include/config/auto.conf
scripts: scripts_basic include/config/auto.conf include/config/tristate.conf
$(Q)$(MAKE) $(build)=$(@)

# Objects we will link into vmlinux / subdirs we need to visit
Expand All @@ -492,18 +491,18 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
# with it and forgot to run make oldconfig.
# if auto.conf.cmd is missing then we are probably in a cleaned tree so
# we execute the config step to be sure to catch updated Kconfig files
include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
else
# external modules needs include/linux/autoconf.h and include/config/auto.conf
# external modules needs include/generated/autoconf.h and include/config/auto.conf
# but do not care if they are up-to-date. Use auto.conf to trigger the test
PHONY += include/config/auto.conf

include/config/auto.conf:
$(Q)test -e include/linux/autoconf.h -a -e $@ || ( \
$(Q)test -e include/generated/autoconf.h -a -e $@ || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/linux/autoconf.h or $@ are missing."; \
echo " include/generated/autoconf.h or $@ are missing.";\
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
Expand Down Expand Up @@ -877,6 +876,9 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
PHONY += $(vmlinux-dirs)
$(vmlinux-dirs): prepare scripts
$(Q)$(MAKE) $(build)=$@
ifdef CONFIG_MODULES
$(Q)$(MAKE) $(modbuiltin)=$@
endif

# Build the kernel release string
#
Expand Down Expand Up @@ -955,7 +957,6 @@ PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
# prepare3 is used to check if we are building in a separate output directory,
# and if so do:
# 1) Check that make has not been executed in the kernel src $(srctree)
# 2) Create the include2 directory, used for the second asm symlink
prepare3: include/config/kernel.release
ifneq ($(KBUILD_SRC),)
@$(kecho) ' Using $(srctree) as source for kernel'
Expand All @@ -964,17 +965,13 @@ ifneq ($(KBUILD_SRC),)
echo " in the '$(srctree)' directory.";\
/bin/false; \
fi;
$(Q)if [ ! -d include2 ]; then \
mkdir -p include2; \
ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm; \
fi
endif

# prepare2 creates a makefile if using a separate output directory
prepare2: prepare3 outputmakefile

prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
include/asm include/config/auto.conf
prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \
include/config/auto.conf
$(cmd_crmodverdir)

archprepare: prepare1 scripts_basic
Expand All @@ -986,42 +983,6 @@ prepare0: archprepare FORCE
# All the preparing..
prepare: prepare0

# The asm symlink changes when $(ARCH) changes.
# Detect this and ask user to run make mrproper
# If asm is a stale symlink (point to dir that does not exist) remove it
define check-symlink
set -e; \
if [ -L include/asm ]; then \
asmlink=`readlink include/asm | cut -d '-' -f 2`; \
if [ "$$asmlink" != "$(SRCARCH)" ]; then \
echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \
echo " set ARCH or save .config and run 'make mrproper' to fix it"; \
exit 1; \
fi; \
test -e $$asmlink || rm include/asm; \
elif [ -d include/asm ]; then \
echo "ERROR: $@ is a directory but a symlink was expected";\
exit 1; \
fi
endef

# We create the target directory of the symlink if it does
# not exist so the test in check-symlink works and we have a
# directory for generated filesas used by some architectures.
define create-symlink
if [ ! -L include/asm ]; then \
$(kecho) ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \
if [ ! -d include/asm-$(SRCARCH) ]; then \
mkdir -p include/asm-$(SRCARCH); \
fi; \
ln -fsn asm-$(SRCARCH) $@; \
fi
endef

include/asm: FORCE
$(Q)$(check-symlink)
$(Q)$(create-symlink)

# Generate some files
# ---------------------------------------------------------------------------

Expand All @@ -1046,7 +1007,7 @@ endef
include/linux/version.h: $(srctree)/Makefile FORCE
$(call filechk,version.h)

include/linux/utsrelease.h: include/config/kernel.release FORCE
include/generated/utsrelease.h: include/config/kernel.release FORCE
$(call filechk,utsrelease.h)

PHONY += headerdep
Expand Down Expand Up @@ -1076,11 +1037,6 @@ firmware_install: FORCE
export INSTALL_HDR_PATH = $(objtree)/usr

hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
# Find out where the Kbuild file is located to support
# arch/$(ARCH)/include/asm
hdr-dir = $(strip \
$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild), \
arch/$(hdr-arch)/include/asm, include/asm-$(hdr-arch)))

# If we do an all arch process set dst to asm-$(hdr-arch)
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
Expand All @@ -1095,10 +1051,10 @@ headers_install_all:

PHONY += headers_install
headers_install: __headers
$(if $(wildcard $(srctree)/$(hdr-dir)/Kbuild),, \
$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild),, \
$(error Headers not exportable for the $(SRCARCH) architecture))
$(Q)$(MAKE) $(hdr-inst)=include
$(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst)
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst)

PHONY += headers_check_all
headers_check_all: headers_install_all
Expand All @@ -1107,7 +1063,7 @@ headers_check_all: headers_install_all
PHONY += headers_check
headers_check: headers_install
$(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1
$(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) HDRCHECK=1
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/asm $(hdr-dst) HDRCHECK=1

# ---------------------------------------------------------------------------
# Modules
Expand All @@ -1127,6 +1083,7 @@ all: modules
PHONY += modules
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
$(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
$(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.builtin) > $(objtree)/modules.builtin
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
Expand Down Expand Up @@ -1156,6 +1113,7 @@ _modinst_:
ln -s $(objtree) $(MODLIB)/build ; \
fi
@cp -f $(objtree)/modules.order $(MODLIB)/
@cp -f $(objtree)/modules.builtin $(MODLIB)/
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst

# This depmod is only for convenience to give the initial
Expand Down Expand Up @@ -1194,12 +1152,10 @@ CLEAN_FILES += vmlinux System.map \
.tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map

# Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config include2 usr/include include/generated
MRPROPER_FILES += .config .config.old include/asm .version .old_version \
include/linux/autoconf.h include/linux/version.h \
include/linux/utsrelease.h \
include/linux/bounds.h include/asm*/asm-offsets.h \
Module.symvers Module.markers tags TAGS cscope*
MRPROPER_DIRS += include/config usr/include include/generated
MRPROPER_FILES += .config .config.old .version .old_version \
include/linux/version.h \
Module.symvers tags TAGS cscope*

# clean - Delete most, but leave enough to build external modules
#
Expand All @@ -1218,7 +1174,7 @@ clean: archclean $(clean-dirs)
\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
-o -name '*.symtypes' -o -name 'modules.order' \
-o -name 'Module.markers' -o -name '.tmp_*.o.*' \
-o -name modules.builtin -o -name '.tmp_*.o.*' \
-o -name '*.gcno' \) -type f -print | xargs rm -f

# mrproper - Delete all generated files, including .config
Expand Down Expand Up @@ -1416,8 +1372,8 @@ $(clean-dirs):

clean: rm-dirs := $(MODVERDIR)
clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \
$(KBUILD_EXTMOD)/Module.markers \
$(KBUILD_EXTMOD)/modules.order
$(KBUILD_EXTMOD)/modules.order \
$(KBUILD_EXTMOD)/modules.builtin
clean: $(clean-dirs)
$(call cmd,rmdirs)
$(call cmd,rmfiles)
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/boot/bootp.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/utsrelease.h>
#include <generated/utsrelease.h>
#include <linux/mm.h>

#include <asm/system.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/boot/bootpz.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/utsrelease.h>
#include <generated/utsrelease.h>
#include <linux/mm.h>

#include <asm/system.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/boot/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/utsrelease.h>
#include <generated/utsrelease.h>
#include <linux/mm.h>

#include <asm/system.h>
Expand Down
1 change: 1 addition & 0 deletions arch/alpha/include/asm/asm-offsets.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <generated/asm-offsets.h>
14 changes: 2 additions & 12 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,8 @@ all: $(KBUILD_IMAGE)

boot := arch/arm/boot

# Update machine arch and proc symlinks if something which affects
# them changed. We use .arch to indicate when they were updated
# last, otherwise make uses the target directory mtime.

archprepare: maketools

PHONY += maketools FORCE
maketools: include/linux/version.h FORCE
$(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h
archprepare:
$(Q)$(MAKE) $(build)=arch/arm/tools include/generated/mach-types.h

# Convert bzImage to zImage
bzImage: zImage
Expand All @@ -261,9 +254,6 @@ zImage Image xipImage bootpImage uImage: vmlinux
zinstall install: vmlinux
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@

CLEAN_FILES += include/asm-arm/mach-types.h \
include/asm-arm/arch include/asm-arm/.arch

# We use MRPROPER_FILES and CLEAN_FILES now
archclean:
$(Q)$(MAKE) $(clean)=$(boot)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/include/asm/asm-offsets.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <generated/asm-offsets.h>
1 change: 1 addition & 0 deletions arch/arm/include/asm/mach-types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <generated/mach-types.h>
2 changes: 1 addition & 1 deletion arch/arm/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Copyright (C) 2001 Russell King
#

include/asm-arm/mach-types.h: $(src)/gen-mach-types $(src)/mach-types
include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types
@echo ' Generating $@'
@mkdir -p $(dir $@)
$(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
2 changes: 1 addition & 1 deletion arch/arm/tools/gen-mach-types
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/awk
#
# Awk script to generate include/asm-arm/mach-types.h
# Awk script to generate include/generated/mach-types.h
#
BEGIN { nr = 0 }
/^#/ { next }
Expand Down
Loading

0 comments on commit 5a865c0

Please sign in to comment.