]> git.ozlabs.org Git - ppp.git/blob - pppd/Makefile.linux
c72f3f7e80e18a5944a43ddab9b13a8c1cb515b1
[ppp.git] / pppd / Makefile.linux
1 #
2 # pppd makefile for Linux
3 # $Id: Makefile.linux,v 1.31 1999/05/13 00:35:14 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
48 INCLUDE_DIRS= -I../include
49
50 COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DIPX_CHANGE
51
52 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
53
54 ifdef CHAPMS
55 CFLAGS   += -DCHAPMS=1
56 ifndef USE_CRYPT
57 LIBS     := -ldes $(LIBS)
58 else
59 CFLAGS   += -DUSE_CRYPT=1
60 ifneq ($(wildcard /usr/include/crypt.h),)
61 CFLAGS   += -DHAVE_CRYPT_H=1
62 endif
63 endif
64 PPPDOBJS += md4.o chap_ms.o
65 ifdef MSLANMAN
66 CFLAGS   += -DMSLANMAN=1
67 endif
68 endif
69
70 ifdef HAS_SHADOW
71 CFLAGS   += -DHAS_SHADOW
72 #LIBS     := -lshadow $(LIBS)
73 endif
74
75 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
76 ifdef USE_PAM
77 CFLAGS   += -DUSE_PAM
78 LIBS     := -lpam -ldl $(LIBS)
79 endif
80
81 # Lock library binary for Linux is included in 'linux' subdirectory.
82 ifdef LOCKLIB
83 LIBS     := -llock $(LIBS)
84 CFLAGS   += -DLOCKLIB=1
85 endif
86
87 install: pppd
88         mkdir -p $(BINDIR) $(MANDIR)
89         install -s -c -m 4550 -o root pppd $(BINDIR)/pppd
90         if ! chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
91           chmod o+rx $(BINDIR)/pppd; fi
92         install -c -m 444 -o root pppd.8 $(MANDIR)/man8
93
94 pppd: $(PPPDOBJS)
95         $(CC) $(CFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
96
97 clean:
98         rm -f $(PPPDOBJS) pppd *~ #* core
99
100 depend:
101         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend