linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Clark Williams <williams@redhat.com>
Cc: linux-rt-users@vger.kernel.org
Subject: [PATCH 1/2] modernize backfire's Makefile
Date: Thu,  1 Jul 2010 07:25:15 +0200	[thread overview]
Message-ID: <1277961916-2538-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20100701052430.GB28535@pengutronix.de>

- don't rely on non-standard envvar PWD, use make's CURDIR instead
- allow overwriting KERNELDIR
- less repetition by conflating targets
- explicitly differentiate between kbuild and ordinary make part

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 src/backfire/Makefile |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/backfire/Makefile b/src/backfire/Makefile
index b5d2b3e..bbad91a 100644
--- a/src/backfire/Makefile
+++ b/src/backfire/Makefile
@@ -1,14 +1,17 @@
+# If KERNELRELEASE is defined, we've been invoked from the
+# kernel build system and can use its language
+ifneq ($(KERNELRELEASE),)
 obj-m := backfire.o
 
-all:	modules modules_install
-	@echo Done
+# otherwise we were called directly from the command
+# line; invoke the kernel build system.
+else
+KERNELDIR ?= /lib/modules/$(shell uname -r)/build
 
-modules:
-	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
+modules modules_install clean::
+	make -C $(KERNELDIR) M=$(CURDIR) $@
 
-modules_install:
-	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules_install
+clean::
+	rm -f *.o Module.markers modules.order
 
-clean:
-	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
-	@rm -f *.o Module.markers modules.order
+endif
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-07-01  5:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01  5:24 [PATCH 0/2] Debian's rt-tests patches Uwe Kleine-König
2010-07-01  5:25 ` Uwe Kleine-König [this message]
2010-07-01  5:25 ` [PATCH 2/2] install backfire's Makefile Uwe Kleine-König
2010-07-01 15:57 ` [PATCH 0/2] Debian's rt-tests patches Clark Williams

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=1277961916-2538-1-git-send-email-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.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;
as well as URLs for NNTP newsgroup(s).