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