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