diff options
| author | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-06 03:35:51 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-06 03:35:51 -0400 |
| commit | ef88b7dba2b47c70037a34a599d383462bb74bd3 (patch) | |
| tree | f50afe82c446cbf93893880878b97339fbdb8f49 /scripts | |
| parent | f65e77693aa5a1cf688fc378bc6913a56f9ff7b7 (diff) | |
| parent | aaebf4332018980fef4e601d1b5a6e52dd9e9ae4 (diff) | |
Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Kbuild.include | 96 | ||||
| -rw-r--r-- | scripts/Makefile.build | 7 | ||||
| -rw-r--r-- | scripts/Makefile.clean | 14 | ||||
| -rw-r--r-- | scripts/Makefile.host | 3 | ||||
| -rw-r--r-- | scripts/Makefile.lib | 99 | ||||
| -rw-r--r-- | scripts/Makefile.modinst | 2 | ||||
| -rw-r--r-- | scripts/Makefile.modpost | 1 | ||||
| -rw-r--r-- | scripts/conmakehash.c | 2 | ||||
| -rw-r--r-- | scripts/kallsyms.c | 6 | ||||
| -rw-r--r-- | scripts/kconfig/lkc.h | 2 | ||||
| -rw-r--r-- | scripts/kconfig/menu.c | 4 | ||||
| -rw-r--r-- | scripts/kconfig/zconf.tab.c_shipped | 8 | ||||
| -rw-r--r-- | scripts/kconfig/zconf.y | 8 | ||||
| -rwxr-xr-x | scripts/kernel-doc | 8 | ||||
| -rw-r--r-- | scripts/lxdialog/dialog.h | 2 | ||||
| -rw-r--r-- | scripts/lxdialog/inputbox.c | 4 | ||||
| -rwxr-xr-x | scripts/mkcompile_h | 12 | ||||
| -rw-r--r-- | scripts/mod/sumversion.c | 8 | ||||
| -rw-r--r-- | scripts/package/Makefile | 24 | ||||
| -rw-r--r-- | scripts/package/builddeb | 56 | ||||
| -rw-r--r-- | scripts/package/buildtar | 111 | ||||
| -rwxr-xr-x | scripts/package/mkspec | 9 | ||||
| -rw-r--r-- | scripts/reference_discarded.pl | 1 | ||||
| -rw-r--r-- | scripts/reference_init.pl | 1 | ||||
| -rw-r--r-- | scripts/setlocalversion | 56 |
25 files changed, 397 insertions, 147 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include new file mode 100644 index 000000000000..9087273abf91 --- /dev/null +++ b/scripts/Kbuild.include | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | #### | ||
| 2 | # kbuild: Generic definitions | ||
| 3 | |||
| 4 | # Convinient variables | ||
| 5 | comma := , | ||
| 6 | empty := | ||
| 7 | space := $(empty) $(empty) | ||
| 8 | |||
| 9 | ### | ||
| 10 | # The temporary file to save gcc -MD generated dependencies must not | ||
| 11 | # contain a comma | ||
| 12 | depfile = $(subst $(comma),_,$(@D)/.$(@F).d) | ||
| 13 | |||
| 14 | ### | ||
| 15 | # filechk is used to check if the content of a generated file is updated. | ||
| 16 | # Sample usage: | ||
| 17 | # define filechk_sample | ||
| 18 | # echo $KERNELRELEASE | ||
| 19 | # endef | ||
| 20 | # version.h : Makefile | ||
| 21 | # $(call filechk,sample) | ||
| 22 | # The rule defined shall write to stdout the content of the new file. | ||
| 23 | # The existing file will be compared with the new one. | ||
| 24 | # - If no file exist it is created | ||
| 25 | # - If the content differ the new file is used | ||
| 26 | # - If they are equal no change, and no timestamp update | ||
| 27 | # - stdin is piped in from the first prerequisite ($<) so one has | ||
| 28 | # to specify a valid file as first prerequisite (often the kbuild file) | ||
| 29 | define filechk | ||
| 30 | $(Q)set -e; \ | ||
| 31 | echo ' CHK $@'; \ | ||
| 32 | mkdir -p $(dir $@); \ | ||
| 33 | $(filechk_$(1)) < $< > $@.tmp; \ | ||
| 34 | if [ -r $@ ] && cmp -s $@ $@.tmp; then \ | ||
| 35 | rm -f $@.tmp; \ | ||
| 36 | else \ | ||
| 37 | echo ' UPD $@'; \ | ||
| 38 | mv -f $@.tmp $@; \ | ||
| 39 | fi | ||
| 40 | endef | ||
| 41 | |||
| 42 | ### | ||
| 43 | # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj= | ||
| 44 | # Usage: | ||
| 45 | # $(Q)$(MAKE) $(build)=dir | ||
| 46 | build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj | ||
| 47 | |||
| 48 | # If quiet is set, only print short version of command | ||
| 49 | cmd = @$(if $($(quiet)cmd_$(1)),\ | ||
| 50 | echo ' $(subst ','\'',$($(quiet)cmd_$(1)))' &&) $(cmd_$(1)) | ||
| 51 | |||
| 52 | ### | ||
| 53 | # if_changed - execute command if any prerequisite is newer than | ||
| 54 | # target, or command line has changed | ||
| 55 | # if_changed_dep - as if_changed, but uses fixdep to reveal dependencies | ||
| 56 | # including used config symbols | ||
| 57 | # if_changed_rule - as if_changed but execute rule instead | ||
| 58 | # See Documentation/kbuild/makefiles.txt for more info | ||
| 59 | |||
| 60 | ifneq ($(KBUILD_NOCMDDEP),1) | ||
| 61 | # Check if both arguments has same arguments. Result in empty string if equal | ||
| 62 | # User may override this check using make KBUILD_NOCMDDEP=1 | ||
| 63 | arg-check = $(strip $(filter-out $(1), $(2)) $(filter-out $(2), $(1)) ) | ||
| 64 | endif | ||
| 65 | |||
| 66 | # echo command. Short version is $(quiet) equals quiet, otherwise full command | ||
| 67 | echo-cmd = $(if $($(quiet)cmd_$(1)), \ | ||
| 68 | echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) | ||
| 69 | |||
| 70 | # function to only execute the passed command if necessary | ||
| 71 | # >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file | ||
| 72 | # note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars | ||
| 73 | # | ||
| 74 | if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ | ||
| 75 | @set -e; \ | ||
| 76 | $(echo-cmd) \ | ||
| 77 | $(cmd_$(1)); \ | ||
| 78 | echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd) | ||
| 79 | |||
| 80 | # execute the command and also postprocess generated .d dependencies | ||
| 81 | # file | ||
| 82 | if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ | ||
| 83 | $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ | ||
| 84 | @set -e; \ | ||
| 85 | $(echo-cmd) \ | ||
| 86 | $(cmd_$(1)); \ | ||
| 87 | scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ | ||
| 88 | rm -f $(depfile); \ | ||
| 89 | mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd) | ||
| 90 | |||
| 91 | # Usage: $(call if_changed_rule,foo) | ||
| 92 | # will check if $(cmd_foo) changed, or any of the prequisites changed, | ||
| 93 | # and if so will execute $(rule_foo) | ||
| 94 | if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ | ||
| 95 | @set -e; \ | ||
| 96 | $(rule_$(1))) | ||
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 76ba6be3dfc9..506e3f3befe3 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
| @@ -10,8 +10,11 @@ __build: | |||
| 10 | # Read .config if it exist, otherwise ignore | 10 | # Read .config if it exist, otherwise ignore |
| 11 | -include .config | 11 | -include .config |
| 12 | 12 | ||
| 13 | include $(if $(wildcard $(obj)/Kbuild), $(obj)/Kbuild, $(obj)/Makefile) | 13 | # The filename Kbuild has precedence over Makefile |
| 14 | kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) | ||
| 15 | include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) | ||
| 14 | 16 | ||
| 17 | include scripts/Kbuild.include | ||
| 15 | include scripts/Makefile.lib | 18 | include scripts/Makefile.lib |
| 16 | 19 | ||
| 17 | ifdef host-progs | 20 | ifdef host-progs |
| @@ -169,7 +172,7 @@ cmd_modversions = \ | |||
| 169 | -T $(@D)/.tmp_$(@F:.o=.ver); \ | 172 | -T $(@D)/.tmp_$(@F:.o=.ver); \ |
| 170 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ | 173 | rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \ |
| 171 | else \ | 174 | else \ |
| 172 | mv $(@D)/.tmp_$(@F) $@; \ | 175 | mv -f $(@D)/.tmp_$(@F) $@; \ |
| 173 | fi; | 176 | fi; |
| 174 | endif | 177 | endif |
| 175 | 178 | ||
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index ff3e87dbf387..8974ea5fc878 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean | |||
| @@ -7,7 +7,14 @@ src := $(obj) | |||
| 7 | .PHONY: __clean | 7 | .PHONY: __clean |
| 8 | __clean: | 8 | __clean: |
| 9 | 9 | ||
| 10 | include $(if $(wildcard $(obj)/Kbuild), $(obj)/Kbuild, $(obj)/Makefile) | 10 | # Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir |
| 11 | # Usage: | ||
| 12 | # $(Q)$(MAKE) $(clean)=dir | ||
| 13 | clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj | ||
| 14 | |||
| 15 | # The filename Kbuild has precedence over Makefile | ||
| 16 | kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) | ||
| 17 | include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) | ||
| 11 | 18 | ||
| 12 | # Figure out what we need to build from the various variables | 19 | # Figure out what we need to build from the various variables |
| 13 | # ========================================================================== | 20 | # ========================================================================== |
| @@ -87,8 +94,3 @@ $(subdir-ymn): | |||
| 87 | # If quiet is set, only print short version of command | 94 | # If quiet is set, only print short version of command |
| 88 | 95 | ||
| 89 | cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) | 96 | cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) |
| 90 | |||
| 91 | # Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir | ||
| 92 | # Usage: | ||
| 93 | # $(Q)$(MAKE) $(clean)=dir | ||
| 94 | clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj | ||
diff --git a/scripts/Makefile.host b/scripts/Makefile.host index 2821a2b83bbb..2d519704b8fd 100644 --- a/scripts/Makefile.host +++ b/ | |||
