mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kbuild: fix make -j4 on UP
@ 2003-03-02 20:16 Sam Ravnborg
  2003-03-02 21:40 ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Sam Ravnborg @ 2003-03-02 20:16 UTC (permalink / raw)
  To: Kai Germaschewski; +Cc: linux-kernel

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)"

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild: fix make -j4 on UP
  2003-03-02 20:16 [PATCH] kbuild: fix make -j4 on UP Sam Ravnborg
@ 2003-03-02 21:40 ` Sam Ravnborg
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2003-03-02 21:40 UTC (permalink / raw)
  To: Kai Germaschewski, linux-kernel

On Sun, Mar 02, 2003 at 09:16:48PM +0100, Sam Ravnborg wrote:
> The following patch moves the generation of compile.h to the
> top-level makefile, and list it in the prepare rule.

Which has the side-effect that compile.h will be generated each time,
because the version increases. And the kernel is recompiled.
I will do a proper fix tomorrow.

	Sam

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-02 21:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-02 20:16 [PATCH] kbuild: fix make -j4 on UP Sam Ravnborg
2003-03-02 21:40 ` Sam Ravnborg

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®