-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (41 loc) · 1.15 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Makefile for PPPD_LDAP plugin
#
# Uncomment this line to get more debug messages
#DEBUG=y
# Uncomment this line to enable SSL/TLS
TLS=y
#
DESTDIR = $(INSTROOT)/usr/local
LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
BINDIR = $(DESTDIR)/bin
VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
INSTALL ?= install
PLUGIN := pppd_ldap.so
TOOLS := ppp_list
INCLUDE := -I. -I../.. -I../../../include
CFLAGS = -O2 $(INCLUDE) -fPIC
LDFLAGS += -lldap -lc
# Uncomment this line if you don't want to include MS-CHAP and MS-CHAP-V2 supprot
CHAPMS=y
# Uncomment this line if you don't want MPPE support
MPPE=y
ifdef CHAPMS
CFLAGS += -DCHAPMS=1
endif
ifdef MPPE
CFLAGS += -DMPPE=1
endif
all : $(PLUGIN) $(TOOLS)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS)
ppp_list: utmplib.o
$(CC) $(CFLAGS) ppp_list.c -o ppp_list utmplib.o $(LDFLAGS)
pppd_ldap.so: main.o utmplib.o ldap_utils.o chap_verifiers.o
$(CC) -shared -o $@ $^ $(LDFLAGS)
install: all
$(INSTALL) -d -m 755 $(LIBDIR)
$(INSTALL) -c -m 6440 $(PLUGIN) $(LIBDIR)/pppd/
$(INSTALL) -d -m 755 $(BINDIR)
$(INSTALL) -c -m 755 $(TOOLS) $(BINDIR)
clean :
rm $(PLUGIN) $(TOOLS) *.o *.so *~