Remove unused headers.
[platform/upstream/crda.git] / Makefile
1 CFLAGS += -Wall -g3
2 #CFLAGS += -DUSE_OPENSSL
3 #LDFLAGS += -lssl
4 ifneq ($(COMPAT_TREE),)
5 CFLAGS += -I$(COMPAT_TREE)/include/
6 endif
7 CFLAGS += -DUSE_GCRYPT
8 LDFLAGS += -lgcrypt
9
10 CRDA_LIB="/usr/lib//crda/"
11
12 all:    regulatory.bin warn crda
13         @$(MAKE) --no-print-directory -f Makefile verify
14
15 regulatory.bin: db2bin.py key.priv.pem db.txt dbparse.py
16         @./db2bin.py regulatory.bin db.txt key.priv.pem
17
18 crda: keys-gcrypt.c crda.c regdb.h
19         $(CC) $(CFLAGS) $(LDFLAGS) -lnl -o $@ crda.c
20
21 clean:
22         @rm -f regulatory.bin dump *~ *.pyc keys-*.c crda
23
24 warn:
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 '**************************************';\
30         fi
31
32 key.priv.pem:
33         cp test-key key.priv.pem
34
35 generate_key:
36         openssl genrsa -out key.priv.pem 2048
37
38 dump:   dump.c regdb.h keys-ssl.c keys-gcrypt.c
39         $(CC) $(CFLAGS) $(LDFLAGS) dump.c -o dump
40
41 keys-ssl.c: key2pub.py $(wildcard *.pem)
42         @./key2pub.py --ssl *.pem > keys-ssl.c
43
44 keys-gcrypt.c: key2pub.py *.pem
45         @./key2pub.py --gcrypt *.pem > keys-gcrypt.c
46
47 verify: dump
48         @./dump regulatory.bin >/dev/null
49
50 install: regulatory.bin crda
51         mkdir -p $(CRDA_LIB)
52         install regulatory.bin $(CRDA_LIB)
53         install crda /sbin/