add stuff for packet filtering
[ppp.git] / pppd / Makefile.linux
1 #
2 # pppd makefile for Linux
3 # $Id: Makefile.linux,v 1.39 2000/08/01 01:38:29 paulus Exp $
4 #
5
6 # Default installation locations
7 BINDIR = /usr/sbin
8 MANDIR = /usr/man
9
10 PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
11            ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c cbcp.c \
12            demand.c utils.c multilink.c tdb.c tty.c
13 HEADERS =  callout.h pathnames.h patchlevel.h chap.h md5.h chap_ms.h md4.h \
14            ipxcp.h cbcp.h tdb.h
15 MANPAGES = pppd.8
16 PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o \
17            auth.o options.o demand.o utils.o sys-linux.o ipxcp.o multilink.o \
18            tdb.o tty.o
19
20 all: pppd
21
22 #
23 # include dependancies if present and backup if as a header file
24 ifeq (.depend,$(wildcard .depend))
25 include .depend
26 endif
27
28 # CC = gcc
29 #
30 COPTS = -O2 -pipe -Wall -g
31 LIBS =
32
33 ifneq ($(wildcard /usr/lib/libcrypt.*),)
34 LIBS += -lcrypt
35 endif
36
37 # Uncomment the next 2 lines to include support for Microsoft's
38 # MS-CHAP authentication protocol.
39 CHAPMS=y
40 USE_CRYPT=y
41 ifneq ($(wildcard /usr/lib/libcrypt.*),)
42 HAVE_CRYPT_H=y
43 endif
44
45 # Uncomment the next line to include support for PPP packet filtering.
46 # This requires that the libpcap library and headers be installed.
47 FILTER=y
48
49 HAS_SHADOW=y
50 #USE_PAM=y
51 #HAVE_INET6=y
52
53 PLUGIN=y
54
55 INCLUDE_DIRS= -I../include
56
57 COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MULTILINK -DHAVE_MMAP
58
59 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
60
61 ifdef CHAPMS
62 CFLAGS   += -DCHAPMS=1
63 ifndef USE_CRYPT
64 LIBS     := -ldes $(LIBS)
65 else
66 CFLAGS   += -DUSE_CRYPT=1
67 ifneq ($(wildcard /usr/include/crypt.h),)
68 CFLAGS   += -DHAVE_CRYPT_H=1
69 endif
70 endif
71 PPPDOBJS += md4.o chap_ms.o
72 ifdef MSLANMAN
73 CFLAGS   += -DMSLANMAN=1
74 endif
75 endif
76
77 ifdef HAS_SHADOW
78 CFLAGS   += -DHAS_SHADOW
79 #LIBS     := -lshadow $(LIBS)
80 endif
81
82 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
83 ifdef USE_PAM
84 CFLAGS   += -DUSE_PAM
85 LIBS     := -lpam -ldl $(LIBS)
86 endif
87
88 # Lock library binary for Linux is included in 'linux' subdirectory.
89 ifdef LOCKLIB
90 LIBS     := -llock $(LIBS)
91 CFLAGS   += -DLOCKLIB=1
92 endif
93
94 ifdef PLUGIN
95 CFLAGS  += -DPLUGIN
96 LDFLAGS += -Wl,-E
97 LIBS    += -ldl
98 endif
99
100 ifdef FILTER
101 LIBS    += -lpcap
102 CFLAGS  += -DPPP_FILTER -I/usr/include/pcap
103 endif
104
105 ifdef HAVE_INET6
106      PPPDSRCS += ipv6cp.c eui64.c
107      HEADERS  += ipv6cp.h eui64.h
108      PPPDOBJS += ipv6cp.o eui64.o
109      CFLAGS   += -DINET6=1
110 endif
111
112
113 INSTALL= install -o root
114
115 install: pppd
116         mkdir -p $(BINDIR) $(MANDIR)
117         $(INSTALL) -s -c -m 4550 pppd $(BINDIR)/pppd
118         if ! chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
119           chmod o+rx $(BINDIR)/pppd; fi
120         $(INSTALL) -c -m 444 pppd.8 $(MANDIR)/man8
121
122 pppd: $(PPPDOBJS)
123         $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
124
125 clean:
126         rm -f $(PPPDOBJS) pppd *~ #* core
127
128 depend:
129         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend