]> git.ozlabs.org Git - ppp.git/blob - pppd/Makefile.linux
8c0ac11531d0156a94d2b259fca75bf986b3c4e1
[ppp.git] / pppd / Makefile.linux
1 #
2 # pppd makefile for Linux
3 # $Id: Makefile.linux,v 1.28 1999/03/30 06:01:42 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
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 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 VER = 2.3.6
31 LIBS =
32
33 ifneq ($(wildcard /usr/lib/libcrypt*),)
34 LIBS += -lcrypt
35 endif
36
37 # Uncomment the next 2 lines to include support for Microsoft's
38 # MS-CHAP authentication protocol.
39 CHAPMS=y
40 USE_CRYPT=y
41 ifneq ($(wildcard /usr/lib/libcrypt*),)
42 HAVE_CRYPT_H=y
43 endif
44
45
46 HAS_SHADOW=y
47 #USE_PAM=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 install: pppd
89         mkdir -p $(BINDIR) $(MANDIR)
90         install -s -c -m 4550 -o root pppd $(BINDIR)/pppd
91         if ! chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
92           chmod o+rx $(BINDIR)/pppd; fi
93         install -c -m 444 -o root pppd.8 $(MANDIR)/man8
94
95 pppd: $(PPPDOBJS)
96         $(CC) $(CFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
97
98 clean:
99         rm -f $(PPPDOBJS) pppd *~ #* core
100
101 depend:
102         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend