wireless-regdb: Add install target to Makefile
PATCH 1/1 wireless-regdb: Add install target to Makefile
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.
Makefile +7 -1
@@ -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
Signature · 1 line
Greetings, Michael.
Review
Quoted 2 lines · Michael Buesch
(quoted diff) +2
-0+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
Makefile +9 -1
@@ -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
Signature · 2 lines
Regards, Pavel Roskin
Quoted 6 lines · On Saturday 27 December 2008 07:42:54 Pavel Roskin wrote:
Review
Quoted 2 lines · Michael Buesch
(quoted diff) +2
-0+install: + -install -o 0 -g 0 -m 644 regulatory.bin $(PREFIX)/lib/crda/regulatory.binThe directory should be created first. Most likely it doesn't exist.
Quoted 8 lines
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
Signature · 1 line
Greetings, Michael.