1 #***********************************************************************
5 # Makefile for Roaring Penguin's Linux PPPoE plugin.
6 # Modified for integration with pppd sources by Paul Mackerras.
8 # Copyright (C) 2001 Roaring Penguin Software Inc.
10 # This program may be distributed according to the terms of the GNU
11 # General Public License, version 2 or (at your option) any later version.
13 #***********************************************************************
15 CROSS_COMPILE=@CROSS_COMPILE@
16 CC=$(CROSS_COMPILE)@CC@
19 DESTDIR = $(INSTROOT)@DESTDIR@
20 BINDIR = $(DESTDIR)/sbin
21 MANDIR = $(DESTDIR)/share/man/man8
22 LIBDIR = $(DESTDIR)/lib/pppd/$(PPPDVERSION)
24 PPPDVERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
29 CFLAGS=$(COPTS) -I../../../include
30 all: pppoe.so pppoe-discovery
32 pppoe-discovery: pppoe-discovery.o debug.o
33 $(CC) $(LDFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o
35 pppoe-discovery.o: pppoe-discovery.c
36 $(CC) $(CFLAGS) -I../../.. -c -o pppoe-discovery.o pppoe-discovery.c
39 $(CC) $(CFLAGS) -I../../.. -c -o debug.o debug.c
41 pppoe.so: plugin.o discovery.o if.o common.o
42 $(CC) $(LDFLAGS) -o pppoe.so -shared plugin.o discovery.o if.o common.o
45 $(INSTALL) -d -m 755 $(LIBDIR)
46 $(INSTALL) -c -m 755 pppoe.so $(LIBDIR)
47 # Symlink for backward compatibility
48 $(LN_S) pppoe.so $(LIBDIR)/rp-pppoe.so
49 $(INSTALL) -d -m 755 $(BINDIR)
50 $(INSTALL) -c -m 755 pppoe-discovery $(BINDIR)
51 $(INSTALL) -c -m 644 pppoe-discovery.8 $(MANDIR)
54 rm -f *.o *.so pppoe-discovery
57 $(CC) $(CFLAGS) -I../../.. -c -o plugin.o -fPIC plugin.c
59 discovery.o: discovery.c
60 $(CC) $(CFLAGS) -I../../.. -c -o discovery.o -fPIC discovery.c
63 $(CC) $(CFLAGS) -I../../.. -c -o if.o -fPIC if.c
66 $(CC) $(CFLAGS) -I../../.. -c -o common.o -fPIC common.c