]> git.ozlabs.org Git - ppp.git/blob - pppd/Makefile.linux
9fc44532a8d814e32ce737d77798a9b61c31cd98
[ppp.git] / pppd / Makefile.linux
1 #
2 # pppd makefile for Linux
3 # $Id: Makefile.linux,v 1.51 2002/07/13 06:24:36 kad Exp $
4 #
5
6 # Default installation locations
7 BINDIR = /usr/sbin
8 MANDIR = /usr/man
9 INCDIR = /usr/include
10
11 PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c ecp.c \
12            ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c cbcp.c \
13            demand.c utils.c tty.c sha1.c
14
15 HEADERS = cbcp.h ccp.h chap.h chap_ms.h ecp.h fsm.h ipcp.h \
16         ipxcp.h lcp.h magic.h md4.h md5.h patchlevel.h pathnames.h pppd.h \
17         sha1.h tdb.h upap.h
18
19 MANPAGES = pppd.8
20 PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o ccp.o ecp.o \
21            auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o sha1.o
22
23 all: pppd
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 ifneq ($(wildcard /usr/lib/libcrypt.*),)
37 LIBS += -lcrypt
38 endif
39
40 # Uncomment the next 2 lines to include support for Microsoft's
41 # MS-CHAP authentication protocol.  Also, edit plugins/radius/Makefile.linux.
42 CHAPMS=y
43 USE_CRYPT=y
44 # Uncomment the next line to include support for MPPE.  CHAPMS (above) must
45 # also be enabled.  Also, edit plugins/radius/Makefile.linux.
46 MPPE=y
47 ifneq ($(wildcard /usr/lib/libcrypt.*),)
48 HAVE_CRYPT_H=y
49 endif
50
51 # Uncomment the next line to include support for PPP packet filtering.
52 # This requires that the libpcap library and headers be installed
53 # and that the kernel driver support PPP packet filtering, which it
54 # doesn't yet.
55 #FILTER=y
56
57 # Uncomment the next line to enable multilink PPP (enabled by default)
58 # Linux distributions: Please leave multilink ENABLED in your builds
59 # of pppd!
60 HAVE_MULTILINK=y
61
62 # Uncomment the next line to enable the TDB database (enabled by default.)
63 # If you enable multilink, then TDB is automatically enabled also.
64 # Linux distributions: Please leave TDB ENABLED in your builds.
65 USE_TDB=y
66
67 HAS_SHADOW=y
68 #USE_PAM=y
69 #HAVE_INET6=y
70
71 PLUGIN=y
72
73 #CBCP=y
74
75 MAXOCTETS=y
76
77 INCLUDE_DIRS= -I../include
78
79 COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
80
81 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
82
83 ifdef CHAPMS
84 CFLAGS   += -DCHAPMS=1
85 ifndef USE_CRYPT
86 LIBS     := -ldes $(LIBS)
87 else
88 CFLAGS   += -DUSE_CRYPT=1
89 ifneq ($(wildcard /usr/include/crypt.h),)
90 CFLAGS   += -DHAVE_CRYPT_H=1
91 endif
92 endif
93 PPPDOBJS += md4.o chap_ms.o
94 ifdef MSLANMAN
95 CFLAGS   += -DMSLANMAN=1
96 endif
97 ifdef MPPE
98 CFLAGS   += -DMPPE=1
99 endif
100 endif
101
102 ifdef HAS_SHADOW
103 CFLAGS   += -DHAS_SHADOW
104 #LIBS     := -lshadow $(LIBS)
105 endif
106
107 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
108 ifdef USE_PAM
109 CFLAGS   += -DUSE_PAM
110 LIBS     := -lpam -ldl $(LIBS)
111 endif
112
113 # Multi-linnk
114 ifdef HAVE_MULTILINK
115         # Multilink implies the use of TDB
116         USE_TDB=y
117
118         CFLAGS += -DHAVE_MULTILINK
119         PPPDSRCS += multilink.c
120         PPPDOBJS += multilink.o
121 endif
122
123 # TDB
124 ifdef USE_TDB
125         CFLAGS += -DUSE_TDB=1
126         PPPDSRCS += tdb.c
127         PPPDOBJS += tdb.o
128 endif
129
130 # Lock library binary for Linux is included in 'linux' subdirectory.
131 ifdef LOCKLIB
132 LIBS     := -llock $(LIBS)
133 CFLAGS   += -DLOCKLIB=1
134 endif
135
136 ifdef PLUGIN
137 CFLAGS  += -DPLUGIN
138 LDFLAGS += -Wl,-E
139 LIBS    += -ldl
140 endif
141
142 ifdef FILTER
143 LIBS    += -lpcap
144 CFLAGS  += -DPPP_FILTER -I/usr/include/pcap
145 endif
146
147 ifdef HAVE_INET6
148      PPPDSRCS += ipv6cp.c eui64.c
149      HEADERS  += ipv6cp.h eui64.h
150      PPPDOBJS += ipv6cp.o eui64.o
151      CFLAGS   += -DINET6=1
152 endif
153
154 ifdef CBCP
155      PPPDOBJS += cbcp.o
156      CFLAGS += -DCBCP_SUPPORT
157 endif
158
159 ifdef MAXOCTETS
160      CFLAGS += -DMAXOCTETS
161 endif
162
163 INSTALL= install -o root
164
165 install: pppd
166         mkdir -p $(BINDIR) $(MANDIR)
167         $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
168         if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
169           chmod o-rx,u+s $(BINDIR)/pppd; fi
170         $(INSTALL) -c -m 444 pppd.8 $(MANDIR)/man8
171
172 pppd: $(PPPDOBJS)
173         $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
174
175 install-devel:
176         mkdir -p $(INCDIR)/pppd
177         $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
178
179 clean:
180         rm -f $(PPPDOBJS) pppd *~ #* core
181
182 depend:
183         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend