1# Makefile for RADIUS plugin
2#
3# Copyright 2002 Roaring Penguin Software Inc.
4#
5
6MANDIR=/usr/man
7PLUGIN=radius.so radattr.so radrealms.so
8CFLAGS=-I../.. -I../../../include -Iradiusclient/include -O2
9
10# Uncomment the next line to include support for Microsoft's
11# MS-CHAP authentication protocol.
12CHAPMS=y
13# Uncomment the next line to include support for MPPE.
14MPPE=y
15# Uncomment the next lint to include support for traffic limiting
16MAXOCTETS=y
17
18ifdef CHAPMS
19CFLAGS += -DCHAPMS=1
20ifdef MPPE
21CFLAGS += -DMPPE=1
22endif
23endif
24ifdef MAXOCTETS
25CFLAGS += -DMAXOCTETS=1
26endif
27
28all: $(PLUGIN)
29
30install: all
31	$(MAKE) $(MFLAGS) -C radiusclient install
32	$(INSTALL) -d -m 755 $(LIBDIR)
33	$(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
34	$(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
35	$(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
36	$(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)/man8
37	$(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)/man8
38
39radius.so: radiusclient/lib/.libs/libradiusclient.a radius.o
40	gcc -o radius.so -shared radius.o radiusclient/lib/.libs/libradiusclient.a
41
42radattr.so: radattr.o
43	gcc -o radattr.so -shared radattr.o
44
45radrealms.so: radrealms.o
46	gcc -o radrealms.so -shared radrealms.o
47
48radius.o: radius.c
49	gcc $(CFLAGS) -c -o radius.o -fPIC radius.c
50
51radattr.o: radattr.c
52	gcc $(CFLAGS) -c -o radattr.o -fPIC radattr.c
53
54radrealms.o: radrealms.c
55	gcc $(CFLAGS) -c -o radrealms.o -fPIC radrealms.c
56
57radiusclient/lib/.libs/libradiusclient.a:
58	test -r radiusclient/Makefile ||           \
59		(cd radiusclient;                  \
60		 ./configure --prefix=/usr         \
61			     --sysconfdir=/etc     \
62			     --enable-shared       \
63			     --enable-static)
64	$(MAKE) -C radiusclient
65
66clean:
67	$(MAKE) $(MFLAGS) -C radiusclient clean
68	rm -f *.o *.so
69
70distclean:
71	rm -f *.o *.so
72	$(MAKE) $(MFLAGS) -C radiusclient distclean
73
74dist-clean: distclean
75