]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/rp-pppoe/Makefile.linux
make sure plugins get installed in the right place
[ppp.git] / pppd / plugins / rp-pppoe / Makefile.linux
index f1428c5c5edd288b93add185a96bc7c049eb63a9..2ffa1c079b3f0c1cb6ce424e61c4bb62da2ac356 100644 (file)
 # This program may be distributed according to the terms of the GNU
 # General Public License, version 2 or (at your option) any later version.
 #
-# $Id: Makefile.linux,v 1.3 2004/10/29 00:12:27 paulus Exp $
+# $Id: Makefile.linux,v 1.6 2004/11/14 07:58:37 paulus Exp $
 #***********************************************************************
 
 DESTDIR = @DESTDIR@
-LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
+BINDIR = $(DESTDIR)/sbin
+LIBDIR = $(DESTDIR)/lib/pppd/$(PPPDVERSION)
 
-INSTALL        = install -o root
+PPPDVERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
+
+INSTALL        = install
 
 # Version is set ONLY IN THE MAKEFILE!  Don't delete this!
 VERSION=3.3
 
 COPTS=-O2 -g
 CFLAGS=$(COPTS) -I../../../include/linux
-all: rp-pppoe.so
+all: rp-pppoe.so pppoe-discovery
+
+pppoe-discovery: libplugin.a pppoe-discovery.o
+       $(CC) -o pppoe-discovery pppoe-discovery.o libplugin.a
+
+pppoe-discovery.o: pppoe-discovery.c
+       $(CC) $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o pppoe-discovery.o pppoe-discovery.c
 
 rp-pppoe.so: libplugin.a plugin.o
        $(CC) -o rp-pppoe.so -shared plugin.o libplugin.a
@@ -31,6 +40,8 @@ rp-pppoe.so: libplugin.a plugin.o
 install: all
        $(INSTALL) -d -m 755 $(LIBDIR)
        $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
+       $(INSTALL) -d -m 755 $(BINDIR)
+       $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR)
 
 clean:
        rm -f *.o *.so