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