* [PATCH] wireless-regdb: Add install target to Makefile
@ 2008-12-26 22:42 Michael Buesch
2008-12-27 6:42 ` Pavel Roskin
0 siblings, 1 reply; 3+ messages in thread
From: Michael Buesch @ 2008-12-26 22:42 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Luis Rodriguez
This adds an "install" target to the Makefile.
We intentionally don't make install depend on "all" or another build
target, to avoid an undesired rebuild.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Index: wireless-regdb/Makefile
===================================================================
--- wireless-regdb.orig/Makefile 2008-12-26 23:33:19.000000000 +0100
+++ wireless-regdb/Makefile 2008-12-26 23:38:54.000000000 +0100
@@ -1,4 +1,7 @@
-.PHONY: all clean
+# Install prefix
+PREFIX = /usr
+
+.PHONY: all clean install
all: regulatory.bin key.pub.pem
@@ -13,3 +16,6 @@
key.priv.pem:
openssl genrsa -out key.priv.pem 2048
+
+install:
+ -install -o 0 -g 0 -m 644 regulatory.bin $(PREFIX)/lib/crda/regulatory.bin
--
Greetings, Michael.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] wireless-regdb: Add install target to Makefile
2008-12-26 22:42 [PATCH] wireless-regdb: Add install target to Makefile Michael Buesch
@ 2008-12-27 6:42 ` Pavel Roskin
2008-12-27 9:19 ` Michael Buesch
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Roskin @ 2008-12-27 6:42 UTC (permalink / raw)
To: Michael Buesch; +Cc: linville, linux-wireless, Luis Rodriguez
On Fri, 2008-12-26 at 23:42 +0100, Michael Buesch wrote:
> +install:
> + -install -o 0 -g 0 -m 644 regulatory.bin $(PREFIX)/lib/crda/regulatory.bin
The directory should be created first. Most likely it doesn't exist.
Also, the minus in front of the "install" command is harmful. Errors
should not be ignored. If the file is not installed, "make install"
should fail.
"install -D" is not widely used in makefiles, so let's do it in two
steps. $(PREFIX)/lib/crda/ could be abstracted as another variable.
Here's my take:
wireless-regdb: Add install target to Makefile
Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/Makefile b/Makefile
index 1d8ff2a..56881a7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,8 @@
-.PHONY: all clean
+# Install prefix
+PREFIX = /usr
+CDRA_PATH = $(PREFIX)/lib/crda
+
+.PHONY: all clean install
all: regulatory.bin key.pub.pem
@@ -13,3 +17,7 @@ key.pub.pem: key.priv.pem
key.priv.pem:
openssl genrsa -out key.priv.pem 2048
+
+install:
+ install -o 0 -g 0 -m 755 -d $(CDRA_PATH)
+ install -o 0 -g 0 -m 644 regulatory.bin $(CDRA_PATH)/regulatory.bin
--
Regards,
Pavel Roskin
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] wireless-regdb: Add install target to Makefile
2008-12-27 6:42 ` Pavel Roskin
@ 2008-12-27 9:19 ` Michael Buesch
0 siblings, 0 replies; 3+ messages in thread
From: Michael Buesch @ 2008-12-27 9:19 UTC (permalink / raw)
To: Pavel Roskin; +Cc: linville, linux-wireless, Luis Rodriguez
On Saturday 27 December 2008 07:42:54 Pavel Roskin wrote:
> On Fri, 2008-12-26 at 23:42 +0100, Michael Buesch wrote:
> > +install:
> > + -install -o 0 -g 0 -m 644 regulatory.bin $(PREFIX)/lib/crda/regulatory.bin
>
> The directory should be created first. Most likely it doesn't exist.
>
> Also, the minus in front of the "install" command is harmful. Errors
> should not be ignored. If the file is not installed, "make install"
> should fail.
>
> "install -D" is not widely used in makefiles, so let's do it in two
> steps. $(PREFIX)/lib/crda/ could be abstracted as another variable.
>
> Here's my take:
ok thanks
--
Greetings, Michael.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-12-27 9:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-26 22:42 [PATCH] wireless-regdb: Add install target to Makefile Michael Buesch
2008-12-27 6:42 ` Pavel Roskin
2008-12-27 9:19 ` Michael Buesch
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).