From: Sam Ravnborg <sam@ravnborg.org>
To: Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] kbuild: fix make -j4 on UP
Date: Sun, 2 Mar 2003 21:16:48 +0100 [thread overview]
Message-ID: <20030302201648.GA14770@mars.ravnborg.org> (raw)
When executing make -j4 on my UP machine kbuild failed.
The culprint was that compile.h were generated twice:
1) Due to the newly added dependency when building modules
2) When descending down into the directories
The generation of compile.h were placed in init/, presumeably
for historical reasons.
The following patch moves the generation of compile.h to the
top-level makefile, and list it in the prepare rule.
Hereby the generation of compile.h is done before descending down
in the the directories.
Sam
===== Makefile 1.389 vs edited =====
--- 1.389/Makefile Sun Mar 2 21:01:58 2003
+++ edited/Makefile Sun Mar 2 21:11:31 2003
@@ -400,7 +400,7 @@
# module versions are listed in "prepare"
.PHONY: prepare
-prepare: include/linux/version.h include/asm include/config/MARKER
+prepare: include/linux/version.h include/linux/compile.h include/asm include/config/MARKER
ifdef KBUILD_MODULES
ifeq ($(origin SUBDIRS),file)
$(Q)rm -rf $(MODVERDIR)
@@ -484,6 +484,14 @@
) > $@.tmp
@$(update-if-changed)
+# compile.h changes depending on hostname, generation number, etc,
+# so we regenerate it always.
+# mkcompile_h will make sure to only update the
+# actual file if its content has changed.
+include/linux/compile.h: FORCE
+ @echo -n ' GEN $@'
+ @sh $(srctree)/scripts/mkcompile_h $@ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
+
# ---------------------------------------------------------------------------
.PHONY: depend dep
@@ -501,11 +509,8 @@
# Build modules
-include/linux/compile.h: FORCE
- $(Q)$(MAKE) $(build)=init include/linux/compile.h
-
.PHONY: modules
-modules: $(SUBDIRS) $(if $(KBUILD_BUILTIN),vmlinux) include/linux/compile.h
+modules: $(SUBDIRS) $(if $(KBUILD_BUILTIN),vmlinux)
@echo ' Building modules, stage 2.';
$(Q)$(MAKE) -rR -f scripts/Makefile.modpost
@@ -644,7 +649,7 @@
# make distclean Remove editor backup files, patch leftover files and the like
# Files removed with 'make clean'
-CLEAN_FILES += vmlinux System.map MC*
+CLEAN_FILES += vmlinux System.map include/linux/compile.h
# Files removed with 'make mrproper'
MRPROPER_FILES += \
===== init/Makefile 1.23 vs edited =====
--- 1.23/init/Makefile Sat Mar 1 23:47:42 2003
+++ edited/init/Makefile Sun Mar 2 21:10:35 2003
@@ -6,19 +6,3 @@
obj-$(CONFIG_DEVFS_FS) += do_mounts_devfs.o
obj-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o
obj-$(CONFIG_BLK_DEV_MD) += do_mounts_md.o
-
-# files to be removed upon make clean
-clean-files := ../include/linux/compile.h
-
-# dependencies on generated files need to be listed explicitly
-
-$(obj)/version.o: include/linux/compile.h
-
-# compile.h changes depending on hostname, generation number, etc,
-# so we regenerate it always.
-# mkcompile_h will make sure to only update the
-# actual file if its content has changed.
-
-include/linux/compile.h: FORCE
- @echo -n ' GEN $@'
- @sh $(srctree)/scripts/mkcompile_h $@ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
next reply other threads:[~2003-03-02 20:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-02 20:16 Sam Ravnborg [this message]
2003-03-02 21:40 ` Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030302201648.GA14770@mars.ravnborg.org \
--to=sam@ravnborg.org \
--cc=kai@tp1.ruhr-uni-bochum.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®