diff options
author | Davide Pesavento <davidepesa@gmail.com> | 2008-09-28 22:09:04 +0200 |
---|---|---|
committer | Luis R. Rodriguez <lrodriguez@atheros.com> | 2008-09-29 12:48:02 -0700 |
commit | 46e6ec02257a1a761b4d529dd44449ce308b46d1 (patch) | |
tree | b76a831944385fce0406de8bfb4a8f2a7c055dc2 | |
parent | a9f91b8caeb0372baf2a9f8b7021488dac0c0d4d (diff) | |
download | crda-46e6ec02257a1a761b4d529dd44449ce308b46d1.tar.gz crda-46e6ec02257a1a761b4d529dd44449ce308b46d1.tar.bz2 crda-46e6ec02257a1a761b4d529dd44449ce308b46d1.zip |
Makefile: add support for DESTDIR.
Signed-off-by: Davide Pesavento <davidepesa@gmail.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
-rw-r--r-- | Makefile | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -1,7 +1,7 @@ ifeq ($(origin $(KLIB)), undefined) -KLIB:= /lib/modules/$(shell uname -r) +KLIB := /lib/modules/$(shell uname -r) endif -KLIB_BUILD ?= $(KLIB)/build +KLIB_BUILD ?= $(KLIB)/build CFLAGS += -Wall -g3 #CFLAGS += -DUSE_OPENSSL @@ -12,7 +12,10 @@ endif CFLAGS += -I$(KLIB_BUILD)/include -DUSE_GCRYPT LDFLAGS += -lgcrypt -CRDA_LIB="/usr/lib//crda/" +MKDIR ?= mkdir -p +INSTALL ?= install + +CRDA_LIB = "/usr/lib/crda/" all: regulatory.bin warn crda @$(MAKE) --no-print-directory -f Makefile verify @@ -20,7 +23,7 @@ all: regulatory.bin warn crda regulatory.bin: db2bin.py key.priv.pem db.txt dbparse.py @./db2bin.py regulatory.bin db.txt key.priv.pem -crda: keys-gcrypt.c crda.c regdb.h +crda: keys-gcrypt.c keys-ssl.c crda.c regdb.h $(CC) $(CFLAGS) $(LDFLAGS) -lnl -o $@ crda.c clean: @@ -53,7 +56,7 @@ verify: dump @./dump regulatory.bin >/dev/null install: regulatory.bin crda - mkdir -p $(CRDA_LIB) - install regulatory.bin $(CRDA_LIB) - install crda /sbin/ - install regulatory.rules /etc/udev/rules.d/ + $(MKDIR) $(DESTDIR)$(CRDA_LIB) + $(INSTALL) -m 644 -t $(DESTDIR)$(CRDA_LIB) regulatory.bin + $(INSTALL) -m 755 -t $(DESTDIR)/sbin/ crda + $(INSTALL) -m 644 -t $(DESTDIR)/etc/udev/rules.d/ regulatory.rules |