]> git.ozlabs.org Git - ppp.git/blob - pppd/plugins/pppoe/Makefile.linux
Add cross-compilation support on Linux
[ppp.git] / pppd / plugins / pppoe / Makefile.linux
1 #***********************************************************************
2 #
3 # Makefile
4 #
5 # Makefile for Roaring Penguin's Linux PPPoE plugin.
6 # Modified for integration with pppd sources by Paul Mackerras.
7 #
8 # Copyright (C) 2001 Roaring Penguin Software Inc.
9 #
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.
12 #
13 #***********************************************************************
14
15 CROSS_COMPILE=@CROSS_COMPILE@
16 CC=$(CROSS_COMPILE)@CC@
17 COPTS=@CFLAGS@
18
19 DESTDIR = $(INSTROOT)@DESTDIR@
20 BINDIR = $(DESTDIR)/sbin
21 LIBDIR = $(DESTDIR)/lib/pppd/$(PPPDVERSION)
22
23 PPPDVERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
24
25 INSTALL = install
26 LN_S    = ln -sf
27
28 CFLAGS=$(COPTS) -I../../../include
29 all: pppoe.so pppoe-discovery
30
31 pppoe-discovery: pppoe-discovery.o debug.o
32         $(CC) $(LDFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o
33
34 pppoe-discovery.o: pppoe-discovery.c
35         $(CC) $(CFLAGS) -I../../.. -c -o pppoe-discovery.o pppoe-discovery.c
36
37 debug.o: debug.c
38         $(CC) $(CFLAGS) -I../../.. -c -o debug.o debug.c
39
40 pppoe.so: plugin.o discovery.o if.o common.o
41         $(CC) $(LDFLAGS) -o pppoe.so -shared plugin.o discovery.o if.o common.o
42
43 install: all
44         $(INSTALL) -d -m 755 $(LIBDIR)
45         $(INSTALL) -c -m 4550 pppoe.so $(LIBDIR)
46         # Symlink for backward compatibility
47         $(LN_S) pppoe.so $(LIBDIR)/rp-pppoe.so
48         $(INSTALL) -d -m 755 $(BINDIR)
49         $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR)
50
51 clean:
52         rm -f *.o *.so pppoe-discovery
53
54 plugin.o: plugin.c
55         $(CC) $(CFLAGS) -I../../.. -c -o plugin.o -fPIC plugin.c
56
57 discovery.o: discovery.c
58         $(CC) $(CFLAGS) -I../../.. -c -o discovery.o -fPIC discovery.c
59
60 if.o: if.c
61         $(CC) $(CFLAGS) -I../../.. -c -o if.o -fPIC if.c
62
63 common.o: common.c
64         $(CC) $(CFLAGS) -I../../.. -c -o common.o -fPIC common.c
65