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