Advertisement
Guest User

Makefile2

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