]> git.ozlabs.org Git - ppp.git/blob - pppd/plugins/Makefile.linux
Patch from Robert Vogelgesang:
[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 -o root
6
7 SUBDIRS := rp-pppoe
8 # Uncomment the next line to include the radius authentication plugin
9 # SUBDIRS += radius
10 PLUGINS := minconn.so passprompt.so passwordfd.so
11
12 # include dependencies if present
13 ifeq (.depend,$(wildcard .depend))
14 include .depend
15 endif
16
17 all:    $(PLUGINS)
18         for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
19
20 %.so: %.c
21         $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
22
23 VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
24 LIBDIR  = $(DESTDIR)/usr/lib/pppd/$(VERSION)
25
26 install: $(PLUGINS)
27         $(INSTALL) -d $(LIBDIR)
28         $(INSTALL) $? $(LIBDIR)
29         for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d INSTALL=$(INSTALL) \
30                                 LIBDIR=$(LIBDIR) install; done
31
32 clean:
33         rm -f *.o *.so *.a
34         for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean; done
35
36 depend:
37         $(CPP) -M $(CFLAGS) *.c >.depend
38         for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend; done