Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 8 Apr 2014 00:52:31 +0000 (17:52 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 8 Apr 2014 00:52:31 +0000 (17:52 -0700)
Pull kbuild changes from Michal Marek:
 - cleanups in the main Makefiles and Documentation/DocBook/Makefile
 - make O=...  directory is automatically created if needed
 - mrproper/distclean removes the old include/linux/version.h to make
   life easier when bisecting across the commit that moved the version.h
   file

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kbuild: docbook: fix the include error when executing "make help"
  kbuild: create a build directory automatically for out-of-tree build
  kbuild: remove redundant '.*.cmd' pattern from make distclean
  kbuild: move "quote" to Kbuild.include to be consistent
  kbuild: docbook: use $(obj) and $(src) rather than specific path
  kbuild: unconditionally clobber include/linux/version.h on distclean
  kbuild: docbook: specify KERNELDOC dependency correctly
  kbuild: docbook: include cmd files more simply
  kbuild: specify build_docproc as a phony target

1  2 
Documentation/DocBook/Makefile
Makefile
scripts/Kbuild.include
scripts/Makefile.lib

index 8d96ebf524e96e0f001dc999b1734b7b97feda4e,ca8fd2628a0f9e713ab8afb3167f6c8e6abf6583..b444f2e8fe32b3818d45997ca7f80c883a8619bb
@@@ -14,9 -14,9 +14,9 @@@ DOCBOOKS := z8530book.xml device-driver
            genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
            80211.xml debugobjects.xml sh.xml regulator.xml \
            alsa-driver-api.xml writing-an-alsa-driver.xml \
 -          tracepoint.xml drm.xml media_api.xml
 +          tracepoint.xml drm.xml media_api.xml w1.xml
  
- include $(srctree)/Documentation/DocBook/media/Makefile
+ include Documentation/DocBook/media/Makefile
  
  ###
  # The build process is as follows (targets):
@@@ -36,6 -36,7 +36,7 @@@ PS_METHOD     = $(prefer-db2x
  # The targets that may be used.
  PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs
  
+ targets += $(DOCBOOKS)
  BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
  xmldocs: $(BOOKS)
  sgmldocs: xmldocs
@@@ -58,14 -59,14 +59,14 @@@ mandocs: $(MAN
  
  installmandocs: mandocs
        mkdir -p /usr/local/man/man9/
-       install Documentation/DocBook/man/*.9.gz /usr/local/man/man9/
+       install $(obj)/man/*.9.gz /usr/local/man/man9/
  
  ###
  #External programs used
  KERNELDOC = $(srctree)/scripts/kernel-doc
  DOCPROC   = $(objtree)/scripts/docproc
  
- XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl
+ XMLTOFLAGS = -m $(srctree)/$(src)/stylesheet.xsl
  XMLTOFLAGS += --skip-validation
  
  ###
@@@ -87,21 -88,9 +88,9 @@@ define rule_docpro
          ) > $(dir $@).$(notdir $@).cmd
  endef
  
- %.xml: %.tmpl FORCE
+ %.xml: %.tmpl $(KERNELDOC) $(DOCPROC) FORCE
        $(call if_changed_rule,docproc)
  
- ###
- #Read in all saved dependency files
- cmd_files := $(wildcard $(foreach f,$(BOOKS),$(dir $(f)).$(notdir $(f)).cmd))
- ifneq ($(cmd_files),)
-   include $(cmd_files)
- endif
- ###
- # Changes in kernel-doc force a rebuild of all documentation
- $(BOOKS): $(KERNELDOC)
  # Tell kbuild to always build the programs
  always := $(hostprogs-y)
  
@@@ -139,7 -128,7 +128,7 @@@ quiet_cmd_db2pdf = PDF     $
  
  
  index = index.html
- main_idx = Documentation/DocBook/$(index)
+ main_idx = $(obj)/$(index)
  build_main_index = rm -rf $(main_idx); \
                   echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
                   echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
  quiet_cmd_db2html = HTML    $@
        cmd_db2html = xmlto html $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \
                echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \
-         $(patsubst %.html,%,$(notdir $@))</a><p>' > $@
+               $(patsubst %.html,%,$(notdir $@))</a><p>' > $@
  
  %.html:       %.xml
        @(which xmlto > /dev/null 2>&1) || \
diff --combined Makefile
index 00a933bb1f41078c44155a880718f5582233fe63,faf55c96ba5917e87e1f571902e39043d92a13a9..cf3e07516a043192576af45ab07fc3ee1bfdcaed
+++ b/Makefile
@@@ -1,7 -1,7 +1,7 @@@
  VERSION = 3
  PATCHLEVEL = 14
  SUBLEVEL = 0
 -EXTRAVERSION = -rc1
 +EXTRAVERSION =
  NAME = Shuffling Zombie Juror
  
  # *DOCUMENTATION*
@@@ -120,9 -120,10 +120,10 @@@ ifneq ($(KBUILD_OUTPUT),
  # Invoke a second make in the output directory, passing relevant variables
  # check that the output directory actually exists
  saved-output := $(KBUILD_OUTPUT)
- KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
+ KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
+                                                               && /bin/pwd)
  $(if $(KBUILD_OUTPUT),, \
-      $(error output directory "$(saved-output)" does not exist))
+      $(error failed to create output directory "$(saved-output)"))
  
  PHONY += $(MAKECMDGOALS) sub-make
  
@@@ -605,11 -606,10 +606,11 @@@ endi
  ifdef CONFIG_CC_STACKPROTECTOR_REGULAR
    stackp-flag := -fstack-protector
    ifeq ($(call cc-option, $(stackp-flag)),)
 -    $(warning Cannot use CONFIG_CC_STACKPROTECTOR: \
 -            -fstack-protector not supported by compiler))
 +    $(warning Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: \
 +             -fstack-protector not supported by compiler)
    endif
 -else ifdef CONFIG_CC_STACKPROTECTOR_STRONG
 +else
 +ifdef CONFIG_CC_STACKPROTECTOR_STRONG
    stackp-flag := -fstack-protector-strong
    ifeq ($(call cc-option, $(stackp-flag)),)
      $(warning Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: \
@@@ -619,7 -619,6 +620,7 @@@ els
    # Force off for distro compilers that enable stack protector by default.
    stackp-flag := $(call cc-option, -fno-stack-protector)
  endif
 +endif
  KBUILD_CFLAGS += $(stackp-flag)
  
  # This warning generated too much noise in a regular build.
@@@ -728,13 -727,6 +729,13 @@@ export KBUILD_IMAGE ?= vmlinu
  # images. Default is /boot, but you can set it to other values
  export        INSTALL_PATH ?= /boot
  
 +#
 +# INSTALL_DTBS_PATH specifies a prefix for relocations required by build roots.
 +# Like INSTALL_MOD_PATH, it isn't defined in the Makefile, but can be passed as
 +# an argument if needed. Otherwise it defaults to the kernel install path
 +#
 +export INSTALL_DTBS_PATH ?= $(INSTALL_PATH)/dtbs/$(KERNELRELEASE)
 +
  #
  # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
  # relocations required by build roots.  This is not defined in the
@@@ -1079,7 -1071,7 +1080,7 @@@ MRPROPER_FILES += .config .config.old .
                  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
                  signing_key.priv signing_key.x509 x509.genkey         \
                  extra_certificates signing_key.x509.keyid             \
-                 signing_key.x509.signer
+                 signing_key.x509.signer include/linux/version.h
  
  # clean - Delete most, but leave enough to build external modules
  #
@@@ -1118,8 -1110,7 +1119,7 @@@ distclean: mrprope
        @find $(srctree) $(RCS_FIND_IGNORE) \
                \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-               -o -name '.*.rej' \
-               -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
+               -o -name '.*.rej' -o -name '*%'  -o -name 'core' \) \
                -type f -print | xargs rm -f
  
  
diff --combined scripts/Kbuild.include
index 93a0da26582b863c64efd5ff226a8386bfb58064,2ec6829a4e64a8492ce6c74d80ce3d3e6cc6c0c7..122f95c958693c8b784e0b2e3e6409ab23d3e561
@@@ -3,6 -3,7 +3,7 @@@
  
  # Convenient variables
  comma   := ,
+ quote   := "
  squote  := '
  empty   :=
  space   := $(empty) $(empty)
@@@ -155,15 -156,6 +156,15 @@@ ld-option = $(call try-run,
  # Important: no spaces around options
  ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
  
 +# ld-version
 +# Usage: $(call ld-version)
 +# Note this is mainly for HJ Lu's 3 number binutil versions
 +ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
 +
 +# ld-ifversion
 +# Usage:  $(call ld-ifversion, -ge, 22252, y)
 +ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3))
 +
  ######
  
  ###
diff --combined scripts/Makefile.lib
index 72105d10435710c52556aa824d7710ed4b8ad402,e6644369ca40ae5e4bc783af7ed95c848a0e854e..6a5b0decb797227326acb4f8511256afb003b989
@@@ -152,7 -152,6 +152,7 @@@ ld_flags       = $(LDFLAGS) $(ldflags-y
  dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc                    \
                 -I$(srctree)/arch/$(SRCARCH)/boot/dts                   \
                 -I$(srctree)/arch/$(SRCARCH)/boot/dts/include           \
 +               -I$(srctree)/drivers/of/testcase-data                   \
                 -undef -D__DTS__
  
  # Finds the multi-part object the current object will be linked into
@@@ -274,18 -273,6 +274,18 @@@ $(obj)/%.dtb: $(src)/%.dts FORC
  
  dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
  
 +# Helper targets for Installing DTBs into the boot directory
 +quiet_cmd_dtb_install =       INSTALL $<
 +      cmd_dtb_install =       cp $< $(2)
 +
 +_dtbinst_pre_:
 +      $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi
 +      $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi
 +      $(Q)mkdir -p $(INSTALL_DTBS_PATH)
 +
 +%.dtb_dtbinst_: $(obj)/%.dtb _dtbinst_pre_
 +      $(call cmd,dtb_install,$(INSTALL_DTBS_PATH))
 +
  # Bzip2
  # ---------------------------------------------------------------------------
  
@@@ -380,7 -367,3 +380,3 @@@ quiet_cmd_xzmisc = XZMISC  $
  cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
        xz --check=crc32 --lzma2=dict=1MiB) > $@ || \
        (rm -f $@ ; false)
- # misc stuff
- # ---------------------------------------------------------------------------
- quote:="