mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Samuelson <peter@cadcamlab.org>
To: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: [upatch] kernel build with 'make -r'
Date: Mon, 19 Nov 2001 01:37:28 -0600	[thread overview]
Message-ID: <20011119013728.G1188@cadcamlab.org> (raw)

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...

                 reply	other threads:[~2001-11-19  7:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20011119013728.G1188@cadcamlab.org \
    --to=peter@cadcamlab.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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®