Commit d02c2b1f authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Fix calling of scripts

We source some scripts, but still pass parameters to them, e.g.

	. mk_version_h $@ $(KERNELRELEASE) $(VERSION) ...

This does not work for all kinds of /bin/sh (it does for bash, that's
why I did not notice).

The fix is easy: Just mark the scripts executable and call instead of
source them.

Unfortunately, patch(1) doesn't understand about propagating chmod.
bk does, so changing the tree isn't hard, and we introduce an explicit
chmod a+x executed during the build for propagating this change into
those trees which get "traditionally" patched up.
parent 4a2fa6ce
...@@ -295,12 +295,15 @@ include/linux/autoconf.h: .config ...@@ -295,12 +295,15 @@ include/linux/autoconf.h: .config
# this Makefile # this Makefile
include/linux/version.h: Makefile include/linux/version.h: Makefile
@. scripts/mkversion_h $@ $(KERNELRELEASE) $(VERSION) $(PATCHLEVEL) $(SUBLEVEL) @scripts/mkversion_h $@ $(KERNELRELEASE) $(VERSION) $(PATCHLEVEL) $(SUBLEVEL)
# Helpers built in scripts/ # Helpers built in scripts/
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
scripts/mkdep scripts/split-include : FORCE scripts/mkdep scripts/split-include : scripts ;
.PHONY: scripts
scripts:
@$(MAKE) -C scripts @$(MAKE) -C scripts
# Generate dependencies # Generate dependencies
......
...@@ -22,4 +22,4 @@ $(TOPDIR)/include/linux/compile.h: ../include/linux/compile.h ; ...@@ -22,4 +22,4 @@ $(TOPDIR)/include/linux/compile.h: ../include/linux/compile.h ;
# actual file if its content has changed. # actual file if its content has changed.
../include/linux/compile.h: FORCE ../include/linux/compile.h: FORCE
@. ../scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)" @../scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
# always needed # always needed
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
all: mkdep split-include # The following temporary rule will make sure that people's
# trees get updated to the right permissions, since patch(1)
# can't do it
CHMOD_FILES := docgen gen-all-syms kernel-doc mkcompile_h mkversion_h makelst
all: mkdep split-include $(CHMOD_FILES)
mkdep: mkdep.c mkdep: mkdep.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $< $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
...@@ -10,6 +15,9 @@ mkdep: mkdep.c ...@@ -10,6 +15,9 @@ mkdep: mkdep.c
split-include: split-include.c split-include: split-include.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $< $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
$(CHMOD_FILES): FORCE
@chmod a+x $@
# xconfig # xconfig
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -44,15 +52,11 @@ tkparse.o tkcond.o tkgen.o: %.o: %.c ...@@ -44,15 +52,11 @@ tkparse.o tkcond.o tkgen.o: %.o: %.c
# DocBook stuff # DocBook stuff
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
doc-progs: docproc docgen gen-all-syms kernel-doc doc-progs: docproc
docproc: docproc.c docproc: docproc.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $< $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
docgen gen-all-syms kernel-doc: FORCE
chmod 755 $@
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
# we don't have automatic deps for host programs # we don't have automatic deps for host programs
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment