add new RADIUS client library
[radsecproxy.git] / lib / radius / Makefile
1 #
2 #  GNU Makefile
3 #
4 .PHONY: all clean install
5 all: libnetworkradius-client.a
6
7 SRCS            := dict.c attrs.c packet.c valuepair.c static.c id.c \
8                    crypto.c custom.c print.c parse.c
9
10 OBJS            := ${SRCS:.c=.o}
11
12 HEADERS         := client.h radius.h
13
14 CFLAGS          := -I. -g -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef
15
16 VERSION := 1.0
17 NAME := networkradius-client-$(VERSION)
18
19
20 #
21 #  The DICTIONARIES variable can be used to point to the FreeRADIUS
22 #  dictionaries.
23 #
24 ifeq "${DICTIONARIES}" ""
25 DICTIONARIES    := $(filter-out %~,$(wildcard share/dictionary*))
26 endif
27
28 ${OBJS}: ${HEADERS}
29
30 radius.h dictionaries.c: ${DICTIONARIES} convert.pl common.pl
31         ./convert.pl ${DICTIONARIES}
32
33 static.o: static.c dictionaries.c
34
35 %.o : %.c
36         $(CC) $(CFLAGS) -c $<
37
38 %.o: ${HEADERS}
39
40 .PHONY: networkradius-devel
41 networkradius-devel:
42         @[ -e $@ ] || ln -s . $@
43
44 libnetworkradius-client.a: ${OBJS}
45         ${AR} ${ARFLAGS} $@ $^
46
47 LIBS    := -lcrypto -lssl
48 LDFLAGS = -L. -lnetworkradius-client
49
50 .PHONY: html
51 html:
52         doxygen doxygen.conf
53
54 clean:
55         @rm -rf *.o *.a *~ html
56
57 install: libnetworkradius-client.a
58
59 .PHONY: publish
60 publish:
61         @scp -r html/* networkradius.com@liberty:www.new/site/clientapi/
62
63 $(NAME).tar.gz: $(wildcard Makefile *.pl *.txt *.[ch] \
64         examples/*.[ch] doc/*.txt share/dictionary*)
65         git archive --format=tar --prefix=$(NAME)/ bsd | gzip > $@
66
67 .PHONY: tar
68 tar: $(NAME).tar.gz