]> git.ozlabs.org Git - ppp.git/blob - pppd/plugins/Makefile.linux
b52f284278008247a74935b64e12c293393c9240
[ppp.git] / pppd / plugins / Makefile.linux
1 CC      = gcc
2 COPTS   = -O2 -g
3 CFLAGS  = $(COPTS) -I.. -I../../include -fPIC
4 LDFLAGS = -shared
5 INSTALL = install
6
7 DESTDIR = @DESTDIR@
8 BINDIR = $(DESTDIR)/sbin
9 MANDIR = $(DESTDIR)/share/man/man8
10 LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
11
12 SUBDIRS := rp-pppoe pppoatm radius
13 # Uncomment the next line to include the radius authentication plugin
14 # SUBDIRS += radius
15 PLUGINS := minconn.so passprompt.so passwordfd.so winbind.so
16
17 # include dependencies if present
18 ifeq (.depend,$(wildcard .depend))
19 include .depend
20 endif
21
22 all:    $(PLUGINS)
23         for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
24
25 %.so: %.c
26         $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
27
28 VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
29
30 install: $(PLUGINS)
31         $(INSTALL) -d $(LIBDIR)
32         $(INSTALL) $? $(LIBDIR)
33         for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d install; done
34
35 clean:
36         rm -f *.o *.so *.a
37         for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean; done
38
39 depend:
40         $(CPP) -M $(CFLAGS) *.c >.depend
41         for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend; done