| 1 |
# |
|---|
| 2 |
# pppd makefile for Linux |
|---|
| 3 |
# $Id: Makefile.linux,v 1.69 2006/06/04 05:07:46 paulus Exp $ |
|---|
| 4 |
# |
|---|
| 5 |
|
|---|
| 6 |
# Default installation locations |
|---|
| 7 |
DESTDIR = @DESTDIR@ |
|---|
| 8 |
BINDIR = $(DESTDIR)/sbin |
|---|
| 9 |
MANDIR = $(DESTDIR)/share/man/man8 |
|---|
| 10 |
INCDIR = $(DESTDIR)/include |
|---|
| 11 |
|
|---|
| 12 |
TARGETS = pppd |
|---|
| 13 |
|
|---|
| 14 |
PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap-new.c md5.c ccp.c \ |
|---|
| 15 |
ecp.c ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c \ |
|---|
| 16 |
demand.c utils.c tty.c eap.c chap-md5.c |
|---|
| 17 |
|
|---|
| 18 |
HEADERS = ccp.h chap-new.h ecp.h fsm.h ipcp.h \ |
|---|
| 19 |
ipxcp.h lcp.h magic.h md5.h patchlevel.h pathnames.h pppd.h \ |
|---|
| 20 |
upap.h eap.h |
|---|
| 21 |
|
|---|
| 22 |
MANPAGES = pppd.8 |
|---|
| 23 |
PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o \ |
|---|
| 24 |
ecp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o \ |
|---|
| 25 |
eap.o chap-md5.o |
|---|
| 26 |
|
|---|
| 27 |
# |
|---|
| 28 |
# include dependencies if present |
|---|
| 29 |
ifeq (.depend,$(wildcard .depend)) |
|---|
| 30 |
include .depend |
|---|
| 31 |
endif |
|---|
| 32 |
|
|---|
| 33 |
# CC = gcc |
|---|
| 34 |
# |
|---|
| 35 |
#COPTS = -O2 -pipe -Wall -g |
|---|
| 36 |
#COPTS |
|---|
| 37 |
LIBS = |
|---|
| 38 |
|
|---|
| 39 |
# Uncomment the next 2 lines to include support for Microsoft's |
|---|
| 40 |
# MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux. |
|---|
| 41 |
CHAPMS=y |
|---|
| 42 |
USE_CRYPT=y |
|---|
| 43 |
# Don't use MSLANMAN unless you really know what you're doing. |
|---|
| 44 |
#MSLANMAN=y |
|---|
| 45 |
# Uncomment the next line to include support for MPPE. CHAPMS (above) must |
|---|
| 46 |
# also be enabled. Also, edit plugins/radius/Makefile.linux. |
|---|
| 47 |
MPPE=y |
|---|
| 48 |
|
|---|
| 49 |
# Uncomment the next line to include support for PPP packet filtering. |
|---|
| 50 |
# This requires that the libpcap library and headers be installed |
|---|
| 51 |
# and that the kernel driver support PPP packet filtering. |
|---|
| 52 |
#FILTER=y |
|---|
| 53 |
|
|---|
| 54 |
# Uncomment the next line to enable multilink PPP (enabled by default) |
|---|
| 55 |
# Linux distributions: Please leave multilink ENABLED in your builds |
|---|
| 56 |
# of pppd! |
|---|
| 57 |
include ../../.config |
|---|
| 58 |
ifneq ($(CONFIG_DIST),"micro") |
|---|
| 59 |
ifneq ($(CONFIG_DIST),"micro-special") |
|---|
| 60 |
HAVE_MULTILINK=y |
|---|
| 61 |
endif |
|---|
| 62 |
endif |
|---|
| 63 |
|
|---|
| 64 |
#ifeq ($(CONFIG_AQOS),y) |
|---|
| 65 |
#CFLAGS += -DHAVE_AQOS |
|---|
| 66 |
#LDFLAGS = -L$(TOP)/libutils -L$(TOP)/nvram -lutils -lnvram |
|---|
| 67 |
#endif |
|---|
| 68 |
|
|---|
| 69 |
# Uncomment the next line to enable the TDB database (enabled by default.) |
|---|
| 70 |
# If you enable multilink, then TDB is automatically enabled also. |
|---|
| 71 |
# Linux distributions: Please leave TDB ENABLED in your builds. |
|---|
| 72 |
#USE_TDB=y |
|---|
| 73 |
|
|---|
| 74 |
#HAS_SHADOW=y |
|---|
| 75 |
#USE_PAM=y |
|---|
| 76 |
#HAVE_INET6=y |
|---|
| 77 |
|
|---|
| 78 |
# Enable plugins |
|---|
| 79 |
PLUGIN=y |
|---|
| 80 |
|
|---|
| 81 |
# Enable Microsoft proprietary Callback Control Protocol |
|---|
| 82 |
#CBCP=y |
|---|
| 83 |
|
|---|
| 84 |
# Enable EAP SRP-SHA1 authentication (requires libsrp) |
|---|
| 85 |
#USE_SRP=y |
|---|
| 86 |
|
|---|
| 87 |
MAXOCTETS=y |
|---|
| 88 |
|
|---|
| 89 |
INCLUDE_DIRS= -I../include |
|---|
| 90 |
|
|---|
| 91 |
COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP |
|---|
| 92 |
|
|---|
| 93 |
ifeq ($(ARCHITECTURE),broadcom) |
|---|
| 94 |
CFLAGS= -DBROADCOM |
|---|
| 95 |
endif |
|---|
| 96 |
|
|---|
| 97 |
CFLAGS+= -O2 $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"' -ffunction-sections -fdata-sections -Wl,--gc-sections |
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
ifdef CHAPMS |
|---|
| 102 |
CFLAGS += -DCHAPMS=1 |
|---|
| 103 |
NEEDDES=y |
|---|
| 104 |
PPPDOBJS += md4.o chap_ms.o |
|---|
| 105 |
HEADERS += md4.h chap_ms.h |
|---|
| 106 |
ifdef MSLANMAN |
|---|
| 107 |
CFLAGS += -DMSLANMAN=1 |
|---|
| 108 |
endif |
|---|
| 109 |
ifdef MPPE |
|---|
| 110 |
CFLAGS += -DMPPE=1 |
|---|
| 111 |
endif |
|---|
| 112 |
endif |
|---|
| 113 |
|
|---|
| 114 |
# EAP SRP-SHA1 |
|---|
| 115 |
ifdef USE_SRP |
|---|
| 116 |
CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include |
|---|
| 117 |
LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto -ffunction-sections -fdata-sections -Wl,--gc-sections |
|---|
| 118 |
TARGETS += srp-entry |
|---|
| 119 |
EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry |
|---|
| 120 |
MANPAGES += srp-entry.8 |
|---|
| 121 |
EXTRACLEAN += srp-entry.o |
|---|
| 122 |
NEEDDES=y |
|---|
| 123 |
else |
|---|
| 124 |
# OpenSSL has an integrated version of SHA-1, and its implementation |
|---|
| 125 |
# is incompatible with this local SHA-1 implementation. We must use |
|---|
| 126 |
# one or the other, not both. |
|---|
| 127 |
PPPDSRCS += sha1.c |
|---|
| 128 |
HEADERS += sha1.h |
|---|
| 129 |
PPPDOBJS += sha1.o |
|---|
| 130 |
endif |
|---|
| 131 |
|
|---|
| 132 |
ifdef HAS_SHADOW |
|---|
| 133 |
CFLAGS += -DHAS_SHADOW |
|---|
| 134 |
#LIBS += -lshadow $(LIBS) |
|---|
| 135 |
endif |
|---|
| 136 |
|
|---|
| 137 |
#ifneq ($(wildcard /usr/include/crypt.h),) |
|---|
| 138 |
CFLAGS += -DHAVE_CRYPT_H=1 |
|---|
| 139 |
#endif |
|---|
| 140 |
#ifneq ($(wildcard /usr/lib/libcrypt.*),) |
|---|
| 141 |
LIBS += -lcrypt |
|---|
| 142 |
#endif |
|---|
| 143 |
|
|---|
| 144 |
ifdef NEEDDES |
|---|
| 145 |
ifndef USE_CRYPT |
|---|
| 146 |
LIBS += -ldes $(LIBS) |
|---|
| 147 |
else |
|---|
| 148 |
CFLAGS += -DUSE_CRYPT=1 |
|---|
| 149 |
endif |
|---|
| 150 |
PPPDOBJS += pppcrypt.o |
|---|
| 151 |
HEADERS += pppcrypt.h |
|---|
| 152 |
endif |
|---|
| 153 |
|
|---|
| 154 |
# For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/. |
|---|
| 155 |
ifdef USE_PAM |
|---|
| 156 |
CFLAGS += -DUSE_PAM |
|---|
| 157 |
LIBS += -lpam -ldl |
|---|
| 158 |
endif |
|---|
| 159 |
|
|---|
| 160 |
# Multi-linnk |
|---|
| 161 |
ifdef HAVE_MULTILINK |
|---|
| 162 |
# Multilink implies the use of TDB |
|---|
| 163 |
USE_TDB=y |
|---|
| 164 |
|
|---|
| 165 |
CFLAGS += -DHAVE_MULTILINK |
|---|
| 166 |
PPPDSRCS += multilink.c |
|---|
| 167 |
PPPDOBJS += multilink.o |
|---|
| 168 |
endif |
|---|
| 169 |
|
|---|
| 170 |
# TDB |
|---|
| 171 |
ifdef USE_TDB |
|---|
| 172 |
CFLAGS += -DUSE_TDB=1 |
|---|
| 173 |
PPPDSRCS += tdb.c spinlock.c |
|---|
| 174 |
PPPDOBJS += tdb.o spinlock.o |
|---|
| 175 |
HEADERS += tdb.h spinlock.h |
|---|
| 176 |
endif |
|---|
| 177 |
|
|---|
| 178 |
# Lock library binary for Linux is included in 'linux' subdirectory. |
|---|
| 179 |
ifdef LOCKLIB |
|---|
| 180 |
LIBS += -llock |
|---|
| 181 |
CFLAGS += -DLOCKLIB=1 |
|---|
| 182 |
endif |
|---|
| 183 |
|
|---|
| 184 |
ifdef PLUGIN |
|---|
| 185 |
CFLAGS += -DPLUGIN |
|---|
| 186 |
LDFLAGS += -Wl,-E |
|---|
| 187 |
LIBS += -ldl |
|---|
| 188 |
endif |
|---|
| 189 |
|
|---|
| 190 |
ifdef FILTER |
|---|
| 191 |
ifneq ($(wildcard /usr/include/pcap-bpf.h),) |
|---|
| 192 |
LIBS += -lpcap |
|---|
| 193 |
CFLAGS += -DPPP_FILTER |
|---|
| 194 |
endif |
|---|
| 195 |
endif |
|---|
| 196 |
|
|---|
| 197 |
ifdef HAVE_INET6 |
|---|
| 198 |
PPPDSRCS += ipv6cp.c eui64.c |
|---|
| 199 |
HEADERS += ipv6cp.h eui64.h |
|---|
| 200 |
PPPDOBJS += ipv6cp.o eui64.o |
|---|
| 201 |
CFLAGS += -DINET6=1 |
|---|
| 202 |
endif |
|---|
| 203 |
|
|---|
| 204 |
ifdef CBCP |
|---|
| 205 |
PPPDSRCS += cbcp.c |
|---|
| 206 |
PPPDOBJS += cbcp.o |
|---|
| 207 |
CFLAGS += -DCBCP_SUPPORT |
|---|
| 208 |
HEADERS += cbcp.h |
|---|
| 209 |
endif |
|---|
| 210 |
|
|---|
| 211 |
ifdef MAXOCTETS |
|---|
| 212 |
CFLAGS += -DMAXOCTETS |
|---|
| 213 |
endif |
|---|
| 214 |
|
|---|
| 215 |
INSTALL= install |
|---|
| 216 |
|
|---|
| 217 |
all: $(TARGETS) |
|---|
| 218 |
|
|---|
| 219 |
install: pppd |
|---|
| 220 |
mkdir -p $(BINDIR) $(MANDIR) |
|---|
| 221 |
$(EXTRAINSTALL) |
|---|
| 222 |
$(INSTALL) -c -m 555 pppd $(BINDIR)/pppd |
|---|
| 223 |
if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \ |
|---|
| 224 |
chmod o-rx,u+s $(BINDIR)/pppd; fi |
|---|
| 225 |
$(INSTALL) -c -m 444 pppd.8 $(MANDIR) |
|---|
| 226 |
|
|---|
| 227 |
pppd: $(PPPDOBJS) |
|---|
| 228 |
$(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS) |
|---|
| 229 |
|
|---|
| 230 |
srp-entry: srp-entry.c |
|---|
| 231 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS) |
|---|
| 232 |
|
|---|
| 233 |
install-devel: |
|---|
| 234 |
mkdir -p $(INCDIR)/pppd |
|---|
| 235 |
$(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd |
|---|
| 236 |
|
|---|
| 237 |
clean: |
|---|
| 238 |
rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core |
|---|
| 239 |
|
|---|
| 240 |
depend: |
|---|
| 241 |
$(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend |
|---|