1 # Modify as you see fit, note this is built into crda,
2 # so if you change it here you will have to change crda.c
3 REG_BIN?=/usr/lib/crda/regulatory.bin
4 REG_GIT?=git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-regdb.git
6 # Use a custom CRDA_UDEV_LEVEL when callling make install to
7 # change your desired level for the udev regulatory.rules
9 UDEV_LEVEL=$(CRDA_UDEV_LEVEL)-
10 # You can customize this if your distributions uses
11 # a different location.
12 UDEV_RULE_DIR?=/lib/udev/rules.d/
14 # Used locally to retrieve all pubkeys during build time
19 all: $(REG_BIN) crda intersect verify
21 ifeq ($(USE_OPENSSL),1)
22 CFLAGS += -DUSE_OPENSSL `pkg-config --cflags openssl`
23 LDLIBS += `pkg-config --libs openssl`
28 CFLAGS += -DUSE_GCRYPT
31 reglib.o: keys-gcrypt.c
37 NL1FOUND := $(shell pkg-config --atleast-version=1 libnl-1 && echo Y)
38 NL2FOUND := $(shell pkg-config --atleast-version=2 libnl-2.0 && echo Y)
45 CFLAGS += -DCONFIG_LIBNL20
50 LIBS += `pkg-config --libs $(NLLIBNAME)`
51 CFLAGS += `pkg-config --cflags $(NLLIBNAME)`
62 $(NQ) ' EXIST ' $(REG_BIN)
64 $(NQ) ERROR: The file: $(REG_BIN) is missing. You need this in place in order
65 $(NQ) to build CRDA. You can get it from:
69 $(NQ) "Once cloned (no need to build) cp regulatory.bin to $(REG_BIN)"
73 keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
75 $(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
79 $(Q)$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
83 $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@ $^ $(LDLIBS)
85 regdbdump: reglib.o regdbdump.o print-regdom.o
87 $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
89 intersect: reglib.o intersect.o print-regdom.o
91 $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
93 verify: $(REG_BIN) regdbdump
94 $(NQ) ' CHK $(REG_BIN)'
95 $(Q)./regdbdump $(REG_BIN) >/dev/null
99 $(Q)$(MKDIR) $(DESTDIR)/sbin
100 $(Q)$(INSTALL) -m 755 -t $(DESTDIR)/sbin/ crda
101 $(NQ) ' INSTALL regdbdump'
102 $(Q)$(INSTALL) -m 755 -t $(DESTDIR)/sbin/ regdbdump
103 $(NQ) ' INSTALL regulatory.rules'
104 $(Q)$(MKDIR) $(DESTDIR)/etc/udev/rules.d
105 @# This removes the old rule you may have, we were not
106 @# putting it in the right place.
107 $(Q)rm -f $(DESTDIR)/etc/udev/rules.d/regulatory.rules
108 $(Q)$(INSTALL) -m 644 -t \
109 $(DESTDIR)/$(UDEV_RULE_DIR)/$(UDEV_LEVEL)regulatory.rules \
110 udev/regulatory.rules
113 $(Q)rm -f crda regdbdump intersect *.o *~ *.pyc keys-*.c