2 # pppd makefile for Linux
3 # $Id: Makefile.linux,v 1.61 2004/10/28 00:15:08 paulus Exp $
6 # Default installation locations
7 BINDIR = $(DESTDIR)/usr/sbin
8 MANDIR = $(DESTDIR)/usr/man
9 INCDIR = $(DESTDIR)/usr/include
13 PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap-new.c md5.c ccp.c \
14 ecp.c ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c \
15 demand.c utils.c tty.c eap.c chap-md5.c
17 HEADERS = ccp.h chap-new.h ecp.h fsm.h ipcp.h \
18 ipxcp.h lcp.h magic.h md5.h patchlevel.h pathnames.h pppd.h \
22 PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o \
23 ecp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o \
27 # include dependencies if present
28 ifeq (.depend,$(wildcard .depend))
34 COPTS = -O2 -pipe -Wall -g
37 # Uncomment the next 2 lines to include support for Microsoft's
38 # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
41 # Don't use MSLANMAN unless you really know what you're doing.
43 # Uncomment the next line to include support for MPPE. CHAPMS (above) must
44 # also be enabled. Also, edit plugins/radius/Makefile.linux.
47 # Uncomment the next line to include support for PPP packet filtering.
48 # This requires that the libpcap library and headers be installed
49 # and that the kernel driver support PPP packet filtering.
52 # Uncomment the next line to enable multilink PPP (enabled by default)
53 # Linux distributions: Please leave multilink ENABLED in your builds
57 # Uncomment the next line to enable the TDB database (enabled by default.)
58 # If you enable multilink, then TDB is automatically enabled also.
59 # Linux distributions: Please leave TDB ENABLED in your builds.
69 # Enable Microsoft proprietary Callback Control Protocol
72 # Enable EAP SRP-SHA1 authentication (requires libsrp)
77 INCLUDE_DIRS= -I../include
79 COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
81 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
86 PPPDOBJS += md4.o chap_ms.o
87 HEADERS += md4.h chap_ms.h
89 CFLAGS += -DMSLANMAN=1
98 CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
99 LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
101 EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
102 MANPAGES += srp-entry.8
103 EXTRACLEAN += srp-entry.o
106 # OpenSSL has an integrated version of SHA-1, and its implementation
107 # is incompatible with this local SHA-1 implementation. We must use
108 # one or the other, not both.
115 CFLAGS += -DHAS_SHADOW
116 #LIBS += -lshadow $(LIBS)
119 ifneq ($(wildcard /usr/include/crypt.h),)
120 CFLAGS += -DHAVE_CRYPT_H=1
122 ifneq ($(wildcard /usr/lib/libcrypt.*),)
128 LIBS += -ldes $(LIBS)
130 CFLAGS += -DUSE_CRYPT=1
132 PPPDOBJS += pppcrypt.o
133 HEADERS += pppcrypt.h
136 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
144 # Multilink implies the use of TDB
147 CFLAGS += -DHAVE_MULTILINK
148 PPPDSRCS += multilink.c
149 PPPDOBJS += multilink.o
154 CFLAGS += -DUSE_TDB=1
160 # Lock library binary for Linux is included in 'linux' subdirectory.
163 CFLAGS += -DLOCKLIB=1
174 CFLAGS += -DPPP_FILTER
178 PPPDSRCS += ipv6cp.c eui64.c
179 HEADERS += ipv6cp.h eui64.h
180 PPPDOBJS += ipv6cp.o eui64.o
187 CFLAGS += -DCBCP_SUPPORT
192 CFLAGS += -DMAXOCTETS
195 INSTALL= install -o root
200 mkdir -p $(BINDIR) $(MANDIR)
202 $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
203 if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
204 chmod o-rx,u+s $(BINDIR)/pppd; fi
205 $(INSTALL) -c -m 444 pppd.8 $(MANDIR)/man8
208 $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
210 srp-entry: srp-entry.c
211 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
214 mkdir -p $(INCDIR)/pppd
215 $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
218 rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
221 $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend