Advertisement
serenia

Makefile

Jun 12th, 2019
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.46 KB | None | 0 0
  1. #
  2. # pppd makefile for Linux
  3. # $Id: Makefile,v 1.1.1.1 2010/11/11 13:17:56 nash Exp $
  4. #
  5.  
  6. include $(SRCBASE)/cy_conf.mak
  7.  
  8. CFLAGS += -DMIPSEL=1
  9.  
  10. # Default installation locations
  11. DESTDIR = /usr
  12. #DESTDIR = @DESTDIR@
  13. BINDIR = $(DESTDIR)/sbin
  14. MANDIR = $(DESTDIR)/share/man/man8
  15. INCDIR = $(DESTDIR)/include
  16.  
  17. TARGETS = pppd
  18.  
  19. PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap-new.c md5.c ccp.c \
  20. ecp.c ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c \
  21. demand.c utils.c tty.c eap.c chap-md5.c
  22.  
  23. HEADERS = ccp.h chap-new.h ecp.h fsm.h ipcp.h \
  24. ipxcp.h lcp.h magic.h md5.h patchlevel.h pathnames.h pppd.h \
  25. upap.h eap.h
  26.  
  27. MANPAGES = pppd.8
  28. PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o \
  29. ecp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o \
  30. eap.o chap-md5.o
  31.  
  32. #
  33. # include dependencies if present
  34. ifeq (.depend,$(wildcard .depend))
  35. include .depend
  36. endif
  37.  
  38. #CROSS =mipsel-linux-
  39. #CC = $(CROSS)gcc -s
  40. #AR = $(CROSS)ar
  41. #LD = $(CROSS)ld
  42.  
  43. #COPTS = -O2 -pipe -Wall -g
  44. COPTS = -O2 -pipe -Wall
  45. LIBS =
  46.  
  47. # Uncomment the next 2 lines to include support for Microsoft's
  48. # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
  49. ifeq ($(CONFIG_PPP_MPPE_COMPRESSION),y)
  50. CHAPMS=y
  51. USE_CRYPT=y
  52. endif
  53. # Don't use MSLANMAN unless you really know what you're doing.
  54. #MSLANMAN=y
  55. # Uncomment the next line to include support for MPPE. CHAPMS (above) must
  56. # also be enabled. Also, edit plugins/radius/Makefile.linux.
  57. ifeq ($(CONFIG_PPP_MPPE_COMPRESSION),y)
  58. MPPE=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.
  64. #FILTER=y
  65.  
  66. # Uncomment the next line to enable multilink PPP (enabled by default)
  67. # Linux distributions: Please leave multilink ENABLED in your builds
  68. # of pppd!
  69. #HAVE_MULTILINK=y
  70.  
  71. # Uncomment the next line to enable the TDB database (enabled by default.)
  72. # If you enable multilink, then TDB is automatically enabled also.
  73. # Linux distributions: Please leave TDB ENABLED in your builds.
  74. #USE_TDB=y
  75.  
  76. #HAS_SHADOW=y
  77. #USE_PAM=y
  78. #HAVE_INET6=y
  79.  
  80. # Enable plugins
  81. PLUGIN=y
  82.  
  83. # Enable Microsoft proprietary Callback Control Protocol
  84. ifeq ($(CONFIG_PPP_MPPE_COMPRESSION),y)
  85. CBCP=y
  86. endif
  87.  
  88. # Enable EAP SRP-SHA1 authentication (requires libsrp)
  89. #USE_SRP=y
  90.  
  91. #MAXOCTETS=y
  92.  
  93. INCLUDE_DIRS= -I../include -I$(OPEN_SOURCE)/include
  94.  
  95. COMPILE_FLAGS= -D__linux__=1 -DHAVE_PATHS_H -DHAVE_MMAP
  96.  
  97. CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS)
  98.  
  99. ifdef CHAPMS
  100. CFLAGS += -DCHAPMS=1
  101. NEEDDES=y
  102. PPPDOBJS += md4.o chap_ms.o
  103. HEADERS += md4.h chap_ms.h
  104. ifdef MSLANMAN
  105. CFLAGS += -DMSLANMAN=1
  106. endif
  107. ifdef MPPE
  108. CFLAGS += -DMPPE=1
  109. endif
  110. endif
  111.  
  112. # EAP SRP-SHA1
  113. ifdef USE_SRP
  114. CFLAGS += -DUSE_SRP -DOPENSSL -I$(OPEN_SOURCE)/openssl/include/openssl
  115. LIBS += -lsrp -L$(OPEN_SOURCE)/openssl/ssl -lcrypto
  116. TARGETS += srp-entry
  117. EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
  118. MANPAGES += srp-entry.8
  119. EXTRACLEAN += srp-entry.o
  120. NEEDDES=y
  121. else
  122. # OpenSSL has an integrated version of SHA-1, and its implementation
  123. # is incompatible with this local SHA-1 implementation. We must use
  124. # one or the other, not both.
  125. PPPDSRCS += sha1.c
  126. HEADERS += sha1.h
  127. PPPDOBJS += sha1.o
  128. endif
  129.  
  130. ifdef HAS_SHADOW
  131. CFLAGS += -DHAS_SHADOW
  132. #LIBS += -lshadow $(LIBS)
  133. endif
  134.  
  135. ifneq ($(wildcard /usr/include/crypt.h),)
  136. CFLAGS += -DHAVE_CRYPT_H=1
  137. endif
  138. ifneq ($(wildcard /usr/lib/libcrypt*.*),)
  139. LIBS += -lcrypt
  140. endif
  141.  
  142. ifdef NEEDDES
  143. ifndef USE_CRYPT
  144. LIBS += -ldes $(LIBS)
  145. else
  146. CFLAGS += -DUSE_CRYPT=1
  147. endif
  148. PPPDOBJS += pppcrypt.o
  149. HEADERS += pppcrypt.h
  150. endif
  151.  
  152. # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
  153. ifdef USE_PAM
  154. CFLAGS += -DUSE_PAM
  155. LIBS += -lpam -ldl
  156. endif
  157.  
  158. # Multi-linnk
  159. ifdef HAVE_MULTILINK
  160. # Multilink implies the use of TDB
  161. USE_TDB=y
  162.  
  163. CFLAGS += -DHAVE_MULTILINK
  164. PPPDSRCS += multilink.c
  165. PPPDOBJS += multilink.o
  166. endif
  167.  
  168. # TDB
  169. ifdef USE_TDB
  170. CFLAGS += -DUSE_TDB=1
  171. PPPDSRCS += tdb.c spinlock.c
  172. PPPDOBJS += tdb.o spinlock.o
  173. HEADERS += tdb.h spinlock.h
  174. endif
  175.  
  176. # Lock library binary for Linux is included in 'linux' subdirectory.
  177. ifdef LOCKLIB
  178. LIBS += -llock
  179. CFLAGS += -DLOCKLIB=1
  180. endif
  181.  
  182. ifdef PLUGIN
  183. CFLAGS += -DPLUGIN
  184. LDFLAGS += -Wl,-E
  185. LIBS += -ldl
  186. endif
  187.  
  188. ifdef FILTER
  189. ifneq ($(wildcard /usr/include/pcap-bpf.h),)
  190. LIBS += -lpcap
  191. CFLAGS += -DPPP_FILTER
  192. endif
  193. endif
  194.  
  195. ifdef HAVE_INET6
  196. PPPDSRCS += ipv6cp.c eui64.c
  197. HEADERS += ipv6cp.h eui64.h
  198. PPPDOBJS += ipv6cp.o eui64.o
  199. CFLAGS += -DINET6=1
  200. endif
  201.  
  202. ifdef CBCP
  203. PPPDSRCS += cbcp.c
  204. PPPDOBJS += cbcp.o
  205. CFLAGS += -DCBCP_SUPPORT
  206. HEADERS += cbcp.h
  207. endif
  208.  
  209. ifdef MAXOCTETS
  210. CFLAGS += -DMAXOCTETS
  211. endif
  212.  
  213. INSTALL= install
  214.  
  215. all: $(TARGETS)
  216.  
  217. install: pppd
  218. mkdir -p $(BINDIR) $(MANDIR)
  219. $(EXTRAINSTALL)
  220. $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
  221. if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
  222. chmod o-rx,u+s $(BINDIR)/pppd; fi
  223. $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
  224.  
  225. pppd: $(PPPDOBJS)
  226. $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
  227.  
  228. srp-entry: srp-entry.c
  229. $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
  230.  
  231. install-devel:
  232. mkdir -p $(INCDIR)/pppd
  233. $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
  234.  
  235. clean:
  236. rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
  237.  
  238. depend:
  239. $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement