2 #CFLAGS += -DUSE_OPENSSL
4 ifneq ($(COMPAT_TREE),)
5 CFLAGS += -I$(COMPAT_TREE)/include/
10 CRDA_LIB="/usr/lib//crda/"
12 all: regulatory.bin warn crda
13 @$(MAKE) --no-print-directory -f Makefile verify
15 regulatory.bin: db2bin.py key.priv.pem db.txt dbparse.py
16 @./db2bin.py regulatory.bin db.txt key.priv.pem
18 crda: keys-gcrypt.c crda.c regdb.h
19 $(CC) $(CFLAGS) $(LDFLAGS) -lnl -o $@ crda.c
22 @rm -f regulatory.bin dump *~ *.pyc keys-*.c crda
25 @if test ! -f key.priv.pem || diff -qNs test-key key.priv.pem >/dev/null ; then \
26 echo '**************************************';\
27 echo '** WARNING! **';\
28 echo '** No key found, using TEST key! **';\
29 echo '**************************************';\
33 cp test-key key.priv.pem
36 openssl genrsa -out key.priv.pem 2048
38 dump: dump.c regdb.h keys-ssl.c keys-gcrypt.c
39 $(CC) $(CFLAGS) $(LDFLAGS) dump.c -o dump
41 keys-ssl.c: key2pub.py $(wildcard *.pem)
42 @./key2pub.py --ssl *.pem > keys-ssl.c
44 keys-gcrypt.c: key2pub.py *.pem
45 @./key2pub.py --gcrypt *.pem > keys-gcrypt.c
48 @./dump regulatory.bin >/dev/null
50 install: regulatory.bin crda
52 install regulatory.bin $(CRDA_LIB)