mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [upatch] kernel build with 'make -r'
@ 2001-11-19  7:37 Peter Samuelson
  0 siblings, 0 replies; only message in thread
From: Peter Samuelson @ 2001-11-19  7:37 UTC (permalink / raw)
  To: torvalds, linux-kernel

The kernel makefiles are completely self-contained, so for a minor
speed boost we can use 'make -r -R' aka 'make --no-builtin-rules
--no-builtin-variables'.

However, due to an apparent bug in gmake 3.79.1 (possibly others),
'make -r' doesn't work if you use the '$*' variable in non-implicit
rules.  (The info page specifically warns against doing this.)  The
symptom is that init/main.o doesn't build.

The following is correct, safe and IMHO more readable anyway:


--- 2.4.15pre6/Makefile~	Sun Nov 18 16:40:49 2001
+++ 2.4.15pre6/Makefile	Sun Nov 18 20:02:19 2001
@@ -333,7 +333,7 @@
 	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) -DUTS_MACHINE='"$(ARCH)"' -c -o init/version.o init/version.c
 
 init/main.o: init/main.c include/config/MARKER
-	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -c -o $*.o $<
+	$(CC) $(CFLAGS) $(CFLAGS_KERNEL) $(PROFILING) -c -o $@ $<
 
 fs lib mm ipc kernel drivers net: dummy
 	$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)


These other patch hunks should be just as safe and correct, but I don't
have the architectures to test them..

Peter


--- 2.4.15pre6/arch/cris/boot/rescue/Makefile~	Wed Oct 17 21:34:01 2001
+++ 2.4.15pre6/arch/cris/boot/rescue/Makefile	Sun Nov 18 20:36:43 2001
@@ -36,13 +36,13 @@
 	rm ktr.bin tmp2423 kimagerescue_tmp.bin
 
 head.o: head.S
-	$(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
+	$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
 
 testrescue.o: testrescue.S
-	$(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
+	$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
 
 kimagerescue.o: kimagerescue.S
-	$(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
+	$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
 
 clean:
 	rm -f *.o *.bin
--- 2.4.15pre6/arch/sparc/kernel/Makefile~	Mon Jan 29 20:49:26 2001
+++ 2.4.15pre6/arch/sparc/kernel/Makefile	Sun Nov 18 20:36:43 2001
@@ -38,7 +38,7 @@
 endif
 
 head.o: head.S
-	$(CC) $(AFLAGS) -ansi -c $*.S -o $*.o
+	$(CC) $(AFLAGS) -ansi -c $< -o $@
 
 check_asm: dummy
 	@if [ ! -r $(HPATH)/asm/asm_offsets.h ] ; then \
--- 2.4.15pre6/arch/sparc64/kernel/Makefile~	Mon Jun 11 02:47:26 2001
+++ 2.4.15pre6/arch/sparc64/kernel/Makefile	Sun Nov 18 20:36:43 2001
@@ -43,7 +43,7 @@
 
 head.o: head.S ttable.S itlb_base.S dtlb_base.S dtlb_backend.S dtlb_prot.S \
 	etrap.S rtrap.S winfixup.S entry.S
-	$(CC) $(AFLAGS) -ansi -c $*.S -o $*.o
+	$(CC) $(AFLAGS) -ansi -c $< -o $@
 
 #
 # This is just to get the dependencies...

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-11-19  7:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-19  7:37 [upatch] kernel build with 'make -r' Peter Samuelson

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®