http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / userapps / opensource / ppp / pppoe / Makefile
1 #
2 # pppd makefile for Linux
3 # $Id: Makefile,v 1.5 2006/11/16 09:07:05 andylin Exp $
4 #
5
6 # Default installation locations
7 BINDIR = /usr/sbin
8 MANDIR = /usr/man
9
10 #cwu
11 ATMLIBDIR = ../../atm2684/atm/lib
12
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
18 MANPAGES = pppd.8
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
24 vpath   %.c .
25 vpath   %.c ./plugins/pppoe
26 vpath   %.h .
27 vpath   %.h ./include
28 #cwu
29
30 #all: pppd
31 # cwu
32 all: pppd.a
33 #all: pppd
34
35 #
36 # include dependancies if present and backup if as a header file
37 ifeq (.depend,$(wildcard .depend))
38 include .depend
39 endif
40
41 #
42 # COPTS = -O2 -pipe -Wall -g
43 #COPTS = -O2 -pipe -Wall -DDEBUG
44 COPTS = -s -Os -pipe -Wall
45 LIBS = $(ATMLIBDIR)/libatm.a
46
47 ifneq ($(wildcard $(LIBCDIR)/lib/libcrypt.*),)
48 LIBS += -lcrypt
49 #LIBS += $(LIBCDIR)/lib/libcrypt.a
50 endif
51
52 # Uncomment the next 2 lines to include support for Microsoft's
53 # MS-CHAP authentication protocol.
54 # cwu
55 CHAPMS=y
56 USE_CRYPT=y
57 #ifneq ($(wildcard /usr/lib/libcrypt.*),)
58 #HAVE_CRYPT_H=y
59 #endif
60
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
64 # doesn't yet.
65 #FILTER=y
66
67 #HAS_SHADOW=y
68 #USE_PAM=y
69 #HAVE_INET6=y
70
71 #PLUGIN=y
72
73 # cwu
74 INCLUDE_DIRS= -I. -I../include -I$(INC_BRCMCFM_PATH) -I$(ATMLIBDIR) 
75 #-I/opt/sgi17/linux/include
76
77 COMPILE_FLAGS= -D_linux_=1 -DHAVE_PATHS_H -DHAVE_MMAP
78 ifeq ($(strip $(BUILD_PPPD)), static)
79 COMPILE_FLAGS += -DBUILD_STATIC
80 endif
81
82 CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
83 CFLAGS +=-D$(subst -,_,$(BRCM_MODEL_NAME))
84
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
89 endif
90
91 ifneq ($(strip $(BUILD_PPP_AUTH_LIMIT)),)
92    CFLAGS += -DPPP_AUTH_LIMIT
93 endif
94
95 ifneq ($(strip $(BUILD_PPP_SCHEDULE)),)
96    CFLAGS += -DSUPPORT_PPP_SCHEDULE
97 endif
98
99 ifneq ($(strip $(BUILD_EMBHTTPD)),)
100   CFLAGS += -DINCLUDE_EMBHTTPD
101 endif
102
103 ifneq ($(strip $(BUILD_MTU_LAN_PPP)),)
104 CFLAGS += -DINCLUDE_MTU_LAN_PPP
105 endif
106
107 ifneq ($(strip $(BRCM_LANG_MMM)),)
108     CFLAGS += -DCONFIG_LANG_MMM
109 endif
110
111 ifneq ($(strip $(SUPPORT_XML_API)),)
112         CFLAGS += -DSUPPORT_XML_API
113 endif
114
115
116 ifneq ($(strip $(SUPPORT_XML_API_FOR_NETGEAR)),)
117 CFLAGS += -DSUPPORT_XML_API_FOR_NETGEAR
118 endif
119
120 ifneq ($(strip $(VOXXXLOAD)),)
121   CFLAGS += -DVOXXXLOAD
122 endif
123
124 ifneq ($(strip $(SIPLOAD)),)
125   CFLAGS += -DINCLUDE_VOIP_SIP
126 endif
127
128 ifneq ($(strip $(BUILD_DOMAIN_LOCK)),)
129 CFLAGS += -DBUILD_DOMAIN_LOCK
130 endif
131
132 ifneq ($(strip $(ODM_LANG_LLL)),)
133 CFLAGS += -DODM_LANG_LLL
134 endif
135
136 ifneq ($(strip $(BUILD_PPP_ALWAYS_RETRY)),)
137    CFLAGS += -DPPP_ALWAYS_RETRY
138 endif
139
140 ifneq ($(strip $(BUILD_TR69C_SSL)),)
141 CFLAGS += -DSUPPORT_TR69C
142 endif
143
144 ifneq ($(strip $(BUILD_TR69C)),)
145 CFLAGS += -DSUPPORT_TR69C
146 endif
147
148 ifneq ($(strip $(BUILD_SUPPORT_PPPDBG_SYSLOG)),)
149 CFLAGS += -DSUPPORT_PPPDBG_SYSLOG
150 endif
151
152 #CFLAGS += -DDEBUG_PRINT
153
154 ifdef CHAPMS
155 CFLAGS   += -DCHAPMS=1
156 ifndef USE_CRYPT
157 LIBS     := -ldes $(LIBS)
158 else
159 CFLAGS   += -DUSE_CRYPT=1
160 ifneq ($(wildcard /usr/include/crypt.h),)
161 CFLAGS   += -DHAVE_CRYPT_H=1
162 endif
163 endif
164 PPPDOBJS += md4.o chap_ms.o
165 ifdef MSLANMAN
166 CFLAGS   += -DMSLANMAN=1
167 endif
168 endif
169
170 ifdef HAS_SHADOW
171 CFLAGS   += -DHAS_SHADOW
172 #LIBS     := -lshadow $(LIBS)
173 endif
174
175 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
176 ifdef USE_PAM
177 CFLAGS   += -DUSE_PAM
178 LIBS     := -lpam -ldl $(LIBS)
179 endif
180
181 # Lock library binary for Linux is included in 'linux' subdirectory.
182 ifdef LOCKLIB
183 LIBS     := -llock $(LIBS)
184 CFLAGS   += -DLOCKLIB=1
185 endif
186
187 ifdef PLUGIN
188 CFLAGS  += -DPLUGIN
189 LDFLAGS += -Wl,-E
190 LIBS    += -ldl
191 endif
192
193 ifdef FILTER
194 LIBS    += -lpcap
195 CFLAGS  += -DPPP_FILTER -I/usr/include/pcap
196 endif
197
198 ifdef HAVE_INET6
199      PPPDSRCS += ipv6cp.c eui64.c
200      HEADERS  += ipv6cp.h eui64.h
201      PPPDOBJS += ipv6cp.o eui64.o
202      CFLAGS   += -DINET6=1
203 endif
204
205 ifeq ($(strip $(PPP_AUTODISCONN)),y)
206 CFLAGS += -DAUTODISCONN
207 endif
208
209 INSTALL= install -o root
210
211 static: pppd.a
212
213 dynamic: pppd install
214
215 install: 
216         install -m 755 pppd $(INSTALL_DIR)/bin
217         $(STRIP) $(INSTALL_DIR)/bin/pppd
218
219 #install: 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
225
226 # cwu
227 pppd.a: $(PPPDOBJS)
228         $(AR) rcs pppd.a  $(PPPDOBJS)
229
230 # cwu
231 pppd: $(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)
234
235 #       $(CC) -Wl,--allow-shlib-undefined $(CFLAGS) $(LDFLAGS) -v -o pppd.o $(PPPDOBJS) $(LIBS)
236 #       $(LD) --allow-shlib-undefined -o $@ pppd.o $(LIBS)
237
238 clean:
239         rm -f $(PPPDOBJS) pppd pppd.a *~ #* core
240
241 depend:
242         $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend