]> git.ozlabs.org Git - ppp.git/blob - pppd/plugins/Makefile.linux
Honor LDFLAGS
[ppp.git] / pppd / plugins / Makefile.linux
1 #CC     = gcc
2 COPTS   = -O2 -g
3 CFLAGS  = $(COPTS) -I.. -I../../include -fPIC
4 LDFLAGS_SHARED  = -shared
5 INSTALL = install
6
7 DESTDIR = $(INSTROOT)@DESTDIR@
8 BINDIR = $(DESTDIR)/sbin
9 MANDIR = $(DESTDIR)/share/man/man8
10 LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
11
12 SUBDIRS := rp-pppoe pppoatm pppol2tp
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 # This setting should match the one in ../Makefile.linux
18 MPPE=y
19
20 ifdef MPPE
21 CFLAGS   += -DMPPE=1
22 endif
23
24 # include dependencies if present
25 ifeq (.depend,$(wildcard .depend))
26 include .depend
27 endif
28
29 all:    $(PLUGINS)
30         for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all || exit $$?; done
31
32 %.so: %.c
33         $(CC) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) $(CFLAGS) $^
34
35 VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
36
37 install: $(PLUGINS)
38         $(INSTALL) -d $(LIBDIR)
39         $(INSTALL) $? $(LIBDIR)
40         for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d install || exit $$?; done
41
42 clean:
43         rm -f *.o *.so *.a
44         for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean || exit $$?; done
45
46 depend:
47         $(CPP) -M $(CFLAGS) *.c >.depend
48         for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend || exit $$?; done