# 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.4 2004/10/31 22:09:03 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)
+
+PPPDVERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
INSTALL = install
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
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