]> git.ozlabs.org Git - ppp.git/blob - pppd/Makefile.linux
Added "install-devel" Makefile target to install pppd headers required to
[ppp.git] / pppd / Makefile.linux
1 #
2 # pppd makefile for Linux
3 # $Id: Makefile.linux,v 1.50 2002/06/10 13:46:28 dfs 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 INCLUDE_DIRS= -I../include
76
77 COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
78
79 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
80
81 ifdef CHAPMS
82 CFLAGS   += -DCHAPMS=1
83 ifndef USE_CRYPT
84 LIBS     := -ldes $(LIBS)
85 else
86 CFLAGS   += -DUSE_CRYPT=1
87 ifneq ($(wildcard /usr/include/crypt.h),)
88 CFLAGS   += -DHAVE_CRYPT_H=1
89 endif
90 endif
91 PPPDOBJS += md4.o chap_ms.o
92 ifdef MSLANMAN
93 CFLAGS   += -DMSLANMAN=1
94 endif
95 ifdef MPPE
96 CFLAGS   += -DMPPE=1
97 endif
98 endif
99
100 ifdef HAS_SHADOW
101 CFLAGS   += -DHAS_SHADOW
102 #LIBS     := -lshadow $(LIBS)
103 endif
104
105 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
106 ifdef USE_PAM
107 CFLAGS   += -DUSE_PAM
108 LIBS     := -lpam -ldl $(LIBS)
109 endif
110
111 # Multi-linnk
112 ifdef HAVE_MULTILINK
113         # Multilink implies the use of TDB
114         USE_TDB=y
115
116         CFLAGS += -DHAVE_MULTILINK
117         PPPDSRCS += multilink.c
118         PPPDOBJS += multilink.o
119 endif
120
121 # TDB
122 ifdef USE_TDB
123         CFLAGS += -DUSE_TDB=1
124         PPPDSRCS += tdb.c
125         PPPDOBJS += tdb.o
126 endif
127
128 # Lock library binary for Linux is included in 'linux' subdirectory.
129 ifdef LOCKLIB
130 LIBS     := -llock $(LIBS)
131 CFLAGS   += -DLOCKLIB=1
132 endif
133
134 ifdef PLUGIN
135 CFLAGS  += -DPLUGIN
136 LDFLAGS += -Wl,-E
137 LIBS    += -ldl
138 endif
139
140 ifdef FILTER
141 LIBS    += -lpcap
142 CFLAGS  += -DPPP_FILTER -I/usr/include/pcap
143 endif
144
145 ifdef HAVE_INET6
146      PPPDSRCS += ipv6cp.c eui64.c
147      HEADERS  += ipv6cp.h eui64.h
148      PPPDOBJS += ipv6cp.o eui64.o
149      CFLAGS   += -DINET6=1
150 endif
151
152 ifdef CBCP
153      PPPDOBJS += cbcp.o
154      CFLAGS += -DCBCP_SUPPORT
155 endif
156
157 INSTALL= install -o root
158
159 install: pppd
160         mkdir -p $(BINDIR) $(MANDIR)
161         $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
162         if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
163           chmod o-rx,u+s $(BINDIR)/pppd; fi
164         $(INSTALL) -c -m 444 pppd.8 $(MANDIR)/man8
165
166 pppd: $(PPPDOBJS)
167         $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
168
169 install-devel:
170         mkdir -p $(INCDIR)/pppd
171         $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
172
173 clean:
174         rm -f $(PPPDOBJS) pppd *~ #* core
175
176 depend:
177         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend