2 # pppd makefile for Linux
3 # $Id: Makefile,v 1.5 2006/11/16 09:07:05 andylin Exp $
6 # Default installation locations
11 ATMLIBDIR = ../../atm2684/atm/lib
13 PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c \
14 auth.c options.c sys-linux.c md4.c chap_ms.c cbcp.c \
15 demand.c utils.c tdb.c sha1dgst.c extra_crypto.c
16 HEADERS = callout.h pathnames.h patchlevel.h chap.h md5.h chap_ms.h md4.h \
17 ipxcp.h cbcp.h tdb.h extra_crypto.h
19 PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap.o md5.o \
20 auth.o options.o demand.o utils.o sys-linux.o \
21 tdb.o sha1dgst.o extra_crypto.o \
22 pppoe.o pppoehash.o pppoe_client.o libpppoe.o \
23 pppoe_utils.o pppoatm.o
25 vpath %.c ./plugins/pppoe
36 # include dependancies if present and backup if as a header file
37 ifeq (.depend,$(wildcard .depend))
42 # COPTS = -O2 -pipe -Wall -g
43 #COPTS = -O2 -pipe -Wall -DDEBUG
44 COPTS = -s -Os -pipe -Wall
45 LIBS = $(ATMLIBDIR)/libatm.a
47 ifneq ($(wildcard $(LIBCDIR)/lib/libcrypt.*),)
49 #LIBS += $(LIBCDIR)/lib/libcrypt.a
52 # Uncomment the next 2 lines to include support for Microsoft's
53 # MS-CHAP authentication protocol.
57 #ifneq ($(wildcard /usr/lib/libcrypt.*),)
61 # Uncomment the next line to include support for PPP packet filtering.
62 # This requires that the libpcap library and headers be installed
63 # and that the kernel driver support PPP packet filtering, which it
74 INCLUDE_DIRS= -I. -I../include -I$(INC_BRCMCFM_PATH) -I$(ATMLIBDIR)
75 #-I/opt/sgi17/linux/include
77 COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DHAVE_MMAP
78 ifeq ($(strip $(BUILD_PPPD)), static)
79 COMPILE_FLAGS += -DBUILD_STATIC
82 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
83 CFLAGS +=-D$(subst -,_,$(BRCM_MODEL_NAME))
85 #Add by Andrew to test 1&1 requirement
86 #porting from 2.18 by wilson
87 ifneq ($(strip $(BUILD_ONE_AND_ONE)),)
88 CFLAGS += -DONE_AND_ONE
91 ifneq ($(strip $(BUILD_PPP_AUTH_LIMIT)),)
92 CFLAGS += -DPPP_AUTH_LIMIT
95 ifneq ($(strip $(BUILD_PPP_SCHEDULE)),)
96 CFLAGS += -DSUPPORT_PPP_SCHEDULE
99 ifneq ($(strip $(BUILD_EMBHTTPD)),)
100 CFLAGS += -DINCLUDE_EMBHTTPD
103 ifneq ($(strip $(BUILD_MTU_LAN_PPP)),)
104 CFLAGS += -DINCLUDE_MTU_LAN_PPP
107 ifneq ($(strip $(BRCM_LANG_MMM)),)
108 CFLAGS += -DCONFIG_LANG_MMM
111 ifneq ($(strip $(SUPPORT_XML_API)),)
112 CFLAGS += -DSUPPORT_XML_API
116 ifneq ($(strip $(SUPPORT_XML_API_FOR_NETGEAR)),)
117 CFLAGS += -DSUPPORT_XML_API_FOR_NETGEAR
120 ifneq ($(strip $(VOXXXLOAD)),)
121 CFLAGS += -DVOXXXLOAD
124 ifneq ($(strip $(SIPLOAD)),)
125 CFLAGS += -DINCLUDE_VOIP_SIP
128 ifneq ($(strip $(BUILD_DOMAIN_LOCK)),)
129 CFLAGS += -DBUILD_DOMAIN_LOCK
132 ifneq ($(strip $(ODM_LANG_LLL)),)
133 CFLAGS += -DODM_LANG_LLL
136 ifneq ($(strip $(BUILD_PPP_ALWAYS_RETRY)),)
137 CFLAGS += -DPPP_ALWAYS_RETRY
140 ifneq ($(strip $(BUILD_TR69C_SSL)),)
141 CFLAGS += -DSUPPORT_TR69C
144 ifneq ($(strip $(BUILD_TR69C)),)
145 CFLAGS += -DSUPPORT_TR69C
148 ifneq ($(strip $(BUILD_SUPPORT_PPPDBG_SYSLOG)),)
149 CFLAGS += -DSUPPORT_PPPDBG_SYSLOG
152 #CFLAGS += -DDEBUG_PRINT
157 LIBS := -ldes $(LIBS)
159 CFLAGS += -DUSE_CRYPT=1
160 ifneq ($(wildcard /usr/include/crypt.h),)
161 CFLAGS += -DHAVE_CRYPT_H=1
164 PPPDOBJS += md4.o chap_ms.o
166 CFLAGS += -DMSLANMAN=1
171 CFLAGS += -DHAS_SHADOW
172 #LIBS := -lshadow $(LIBS)
175 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
178 LIBS := -lpam -ldl $(LIBS)
181 # Lock library binary for Linux is included in 'linux' subdirectory.
183 LIBS := -llock $(LIBS)
184 CFLAGS += -DLOCKLIB=1
195 CFLAGS += -DPPP_FILTER -I/usr/include/pcap
199 PPPDSRCS += ipv6cp.c eui64.c
200 HEADERS += ipv6cp.h eui64.h
201 PPPDOBJS += ipv6cp.o eui64.o
205 ifeq ($(strip $(PPP_AUTODISCONN)),y)
206 CFLAGS += -DAUTODISCONN
209 INSTALL= install -o root
213 dynamic: pppd install
216 install -m 755 pppd $(INSTALL_DIR)/bin
217 $(STRIP) $(INSTALL_DIR)/bin/pppd
220 # mkdir -p $(BINDIR) $(MANDIR)
221 # $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
222 # if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
223 # chmod o-rx,u+s $(BINDIR)/pppd; fi
224 # $(INSTALL) -c -m 444 pppd.8 $(MANDIR)/man8
228 $(AR) rcs pppd.a $(PPPDOBJS)
232 # $(CC) -static $(CFLAGS) $(LDFLAGS) -Wl,--allow-shlib-undefined -o pppd $(PPPDOBJS) $(LIBS)
233 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,--allow-shlib-undefined -o pppd $(PPPDOBJS) $(LIBS)
235 # $(CC) -Wl,--allow-shlib-undefined $(CFLAGS) $(LDFLAGS) -v -o pppd.o $(PPPDOBJS) $(LIBS)
236 # $(LD) --allow-shlib-undefined -o $@ pppd.o $(LIBS)
239 rm -f $(PPPDOBJS) pppd pppd.a *~ #* core
242 $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend