UBUNTU: Ubuntu-2.6.38-12.51
[linux-flexiantxendom0-natty.git] / scripts / Makefile.headersinst
index 612dc13..f89cb87 100644 (file)
@@ -3,7 +3,6 @@
 #
 # header-y  - list files to be installed. They are preprocessed
 #             to remove __KERNEL__ section of the file
-# unifdef-y - Same as header-y. Obsolete
 # objhdr-y  - Same as header-y but for generated files
 #
 # ==========================================================================
@@ -14,11 +13,13 @@ _dst := $(if $(dst),$(dst),$(obj))
 kbuild-file := $(srctree)/$(obj)/Kbuild
 include $(kbuild-file)
 
+_dst := $(if $(destination-y),$(destination-y),$(_dst))
+
 include scripts/Kbuild.include
 
 install       := $(INSTALL_HDR_PATH)/$(_dst)
 
-header-y      := $(sort $(header-y) $(unifdef-y))
+header-y      := $(sort $(header-y))
 subdirs       := $(patsubst %/,%,$(filter %/, $(header-y)))
 header-y      := $(filter-out %/, $(header-y))
 
@@ -52,8 +53,12 @@ quiet_cmd_remove = REMOVE  $(unwanted)
       cmd_remove = rm -f $(unwanted-file)
 
 quiet_cmd_check = CHECK   $(printdir) ($(words $(all-files)) files)
-      cmd_check = $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH) \
-                  $(addprefix $(install)/, $(all-files));           \
+# Headers list can be pretty long, xargs helps to avoid
+# the "Argument list too long" error.
+      cmd_check = for f in $(all-files); do                          \
+                  echo "$(install)/$${f}"; done                      \
+                  | xargs                                            \
+                  $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \
                  touch $@
 
 PHONY += __headersinst __headerscheck