]> git.ozlabs.org Git - ppp.git/blob - pppd/Makefile.linux
Rest of IPV6 merge which got lost somehow, plus some minor fixes.
[ppp.git] / pppd / Makefile.linux
1 #
2 # pppd makefile for Linux
3 # $Id: Makefile.linux,v 1.33 1999/08/24 05:31:08 paulus 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
13 HEADERS =  callout.h pathnames.h patchlevel.h chap.h md5.h chap_ms.h md4.h \
14            ipxcp.h cbcp.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
18
19 all: pppd
20
21 #
22 # include dependancies if present and backup if as a header file
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.
38 CHAPMS=y
39 USE_CRYPT=y
40 ifneq ($(wildcard /usr/lib/libcrypt*),)
41 HAVE_CRYPT_H=y
42 endif
43
44
45 HAS_SHADOW=y
46 #USE_PAM=y
47 #HAVE_INET6=y
48
49 INCLUDE_DIRS= -I../include
50
51 COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE
52
53 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
54
55 ifdef CHAPMS
56 CFLAGS   += -DCHAPMS=1
57 ifndef USE_CRYPT
58 LIBS     := -ldes $(LIBS)
59 else
60 CFLAGS   += -DUSE_CRYPT=1
61 ifneq ($(wildcard /usr/include/crypt.h),)
62 CFLAGS   += -DHAVE_CRYPT_H=1
63 endif
64 endif
65 PPPDOBJS += md4.o chap_ms.o
66 ifdef MSLANMAN
67 CFLAGS   += -DMSLANMAN=1
68 endif
69 endif
70
71 ifdef HAS_SHADOW
72 CFLAGS   += -DHAS_SHADOW
73 #LIBS     := -lshadow $(LIBS)
74 endif
75
76 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
77 ifdef USE_PAM
78 CFLAGS   += -DUSE_PAM
79 LIBS     := -lpam -ldl $(LIBS)
80 endif
81
82 # Lock library binary for Linux is included in 'linux' subdirectory.
83 ifdef LOCKLIB
84 LIBS     := -llock $(LIBS)
85 CFLAGS   += -DLOCKLIB=1
86 endif
87
88 ifdef HAVE_INET6
89      PPPDSRCS += ipv6cp.c eui64.c
90      HEADERS  += ipv6cp.h eui64.h
91      PPPDOBJS += ipv6cp.o eui64.o
92      CFLAGS   += -DINET6=1
93 endif
94
95
96 INSTALL= install -o root
97
98 install: pppd
99         mkdir -p $(BINDIR) $(MANDIR)
100         $(INSTALL) -s -c -m 4550 pppd $(BINDIR)/pppd
101         if ! chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
102           chmod o+rx $(BINDIR)/pppd; fi
103         $(INSTALL) -c -m 444 pppd.8 $(MANDIR)/man8
104
105 pppd: $(PPPDOBJS)
106         $(CC) $(CFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
107
108 clean:
109         rm -f $(PPPDOBJS) pppd *~ #* core
110
111 depend:
112         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend