You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

201 lines
6.4 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. # source: Makefile.in
  2. # Copyright Gerhard Rieger and contributors (see file CHANGES)
  3. # Published under the GNU General Public License V.2, see file COPYING
  4. # note: @...@ forms are filled in by configure script
  5. SHELL = /bin/sh
  6. AR = @AR@
  7. RANLIB = @RANLIB@
  8. .SUFFIXES: .c .o
  9. prefix = @prefix@
  10. exec_prefix = @exec_prefix@
  11. BINDEST = @bindir@
  12. datarootdir = @datarootdir@
  13. MANDEST = @mandir@
  14. srcdir = @srcdir@
  15. VPATH = @srcdir@
  16. CC = @CC@
  17. CCOPTS = $(CCOPT)
  18. SYSDEFS = @SYSDEFS@
  19. CPPFLAGS = -I. @CPPFLAGS@
  20. #0 INCLS = -I. @V_INCL@
  21. DEFS = @DEFS@
  22. LIBS = @LIBS@
  23. LDFLAGS = @LDFLAGS@
  24. INSTALL = @INSTALL@
  25. #OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) @LIBOBJS@
  26. #0 CFLAGS = @CFLAGS@ $(CCOPTS) $(DEFS) $(INCLS)
  27. CFLAGS = @CFLAGS@ $(CCOPTS) $(DEFS) $(CPPFLAGS)
  28. CLIBS = $(LIBS)
  29. #CLIBS = $(LIBS) -lm -lefence
  30. XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
  31. xiosignal.c xiosigchld.c xioread.c xiowrite.c \
  32. xiolayer.c xioshutdown.c xioclose.c xioexit.c \
  33. xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
  34. xio-gopen.c xio-creat.c xio-file.c xio-named.c \
  35. xio-socket.c xio-interface.c xio-listen.c xio-unix.c \
  36. xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
  37. xio-sctp.c xio-rawip.c \
  38. xio-socks.c xio-proxy.c xio-udp.c \
  39. xio-progcall.c xio-exec.c xio-system.c xio-termios.c xio-readline.c \
  40. xio-pty.c xio-openssl.c xio-streams.c\
  41. xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-ext2.c xio-tun.c
  42. XIOOBJS = $(XIOSRCS:.c=.o)
  43. UTLSRCS = error.c dalan.c procan.c procan-cdefs.c hostan.c fdname.c sysutils.c utils.c nestlex.c vsnprintf_r.c snprinterr.c @FILAN@ sycls.c @SSLCLS@
  44. UTLOBJS = $(UTLSRCS:.c=.o)
  45. CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c
  46. OFILES = $(CFILES:.c=.o)
  47. PROGS = socat procan filan
  48. HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h hostan.h sysincludes.h xio.h xioopen.h sysutils.h utils.h nestlex.h vsnprintf_r.h snprinterr.h compat.h \
  49. xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
  50. xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
  51. xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h \
  52. xio-socket.h xio-interface.h xio-listen.h xio-unix.h \
  53. xio-ip.h xio-ip4.h xio-ip6.h xio-rawip.h \
  54. xio-ipapp.h xio-tcp.h xio-udp.h xio-sctp.h \
  55. xio-socks.h xio-proxy.h xio-progcall.h xio-exec.h \
  56. xio-system.h xio-termios.h xio-readline.h \
  57. xio-pty.h xio-openssl.h xio-streams.h \
  58. xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h xio-tun.h
  59. DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 doc/socat.html doc/xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL doc/dest-unreach.css doc/socat-openssltunnel.html doc/socat-multicast.html doc/socat-tun.html doc/socat-genericsocket.html
  60. SHFILES = daemon.sh mail.sh ftp.sh readline.sh \
  61. socat_buildscript_for_android.sh
  62. TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
  63. proxy.sh socks4a-echo.sh
  64. OSFILES = Config/Makefile.Linux-2-6-24 Config/config.Linux-2-6-24.h \
  65. Config/Makefile.SunOS-5-10 Config/config.SunOS-5-10.h \
  66. Config/Makefile.FreeBSD-6-1 Config/config.FreeBSD-6-1.h \
  67. Config/Makefile.NetBSD-5-1 Config/config.NetBSD-5-1.h \
  68. Config/Makefile.OpenBSD-4-3 Config/config.OpenBSD-4-3.h \
  69. Config/Makefile.AIX-5-3 Config/config.AIX-5-3.h \
  70. Config/Makefile.Cygwin-1-5-25 Config/config.Cygwin-1-5-25.h \
  71. Config/Makefile.MacOSX-10-5 Config/config.MacOSX-10-5.h \
  72. Config/Makefile.DragonFly-2-8-2 Config/config.DragonFly-2-8-2.h
  73. all: progs doc
  74. scmclean: gitclean
  75. gitclean: distclean docclean
  76. rm -f Makefile.bak configure
  77. doc: doc/socat.1 doc/socat.html
  78. docclean:
  79. rm -f doc/socat.1 doc/socat.html
  80. doc/socat.1: doc/socat.yo
  81. yodl2man -o $@ $+
  82. doc/socat.html: doc/socat.yo
  83. cd doc; yodl2html -o socat.html socat.yo; cd ..
  84. progs: $(PROGS)
  85. depend: $(CFILES) $(HFILES)
  86. makedepend $(SYSDEFS) $(CFILES)
  87. socat: socat.o libxio.a
  88. $(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS)
  89. PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysutils.o utils.o vsnprintf_r.o snprinterr.o
  90. procan: $(PROCAN_OBJS)
  91. $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS)
  92. FILAN_OBJS=filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o vsnprintf_r.o snprinterr.o
  93. filan: $(FILAN_OBJS)
  94. $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(FILAN_OBJS) $(CLIBS)
  95. libxio.a: $(XIOOBJS) $(UTLOBJS)
  96. $(AR) r $@ $(XIOOBJS) $(UTLOBJS)
  97. $(RANLIB) $@
  98. doc: doc/xio.help
  99. #
  100. strip: progs
  101. strip $(PROGS)
  102. install: progs $(srcdir)/doc/socat.1
  103. mkdir -p $(DESTDIR)$(BINDEST)
  104. $(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST)
  105. $(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST)
  106. $(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST)
  107. mkdir -p $(DESTDIR)$(MANDEST)/man1
  108. $(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/
  109. uninstall:
  110. rm -f $(DESTDIR)$(BINDEST)/socat
  111. rm -f $(DESTDIR)$(BINDEST)/procan
  112. rm -f $(DESTDIR)$(BINDEST)/filan
  113. rm -f $(DESTDIR)$(MANDEST)/man1/socat.1
  114. # make a GNU-zipped tar ball of the source files
  115. dist: socat.tar.gz socat.tar.bz2
  116. socat.tar.gz: socat.tar
  117. gzip -9 <socat.tar >socat.tar.gz
  118. socat.tar.bz2: socat.tar
  119. bzip2 -9 <socat.tar >socat.tar.bz2
  120. VERSION = `sed 's/"//g' VERSION`
  121. TARDIR = socat-$(VERSION)
  122. socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec \
  123. configure.ac
  124. if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi
  125. tar cf - $+ |(cd $(TARDIR); tar xf -)
  126. tar cvf socat.tar $(TARDIR)
  127. rm -f $(TARDIR)/COPYING # write protected
  128. rm -r $(TARDIR)
  129. clean:
  130. rm -f *.o libxio.a socat procan filan \
  131. socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
  132. socat.out compile.log test.log
  133. # remove all files that are generated from the original socat distribution
  134. # note that Makefile is also removed, so you have to start with ./configure
  135. # again
  136. distclean: clean
  137. rm -f config.status config.cache config.log config.h Makefile
  138. rm -rf autom4te.cache
  139. info: socat
  140. uname -a >socat.out
  141. ./socat -V >>socat.out
  142. ./socat -hh >>socat.out
  143. # perform some tests on socat
  144. test: progs
  145. ./test.sh
  146. cert:
  147. # prepare critical files with correct permissions to avoid race cond
  148. >cert.key
  149. >cert.pem
  150. chmod 600 cert.key cert.pem
  151. # generate a private key
  152. openssl genrsa -out cert.key 1024
  153. # generate a self signed cert
  154. openssl req -new -key cert.key -x509 -days 3653 -out cert.crt
  155. # ...enter fields
  156. # generate the pem file
  157. cat cert.key cert.crt >cert.pem
  158. #echo use cert.pem on requestors side, i.e. with option cert=cert.pem
  159. #echo use cert.crt on checkers side, i.e. with option cafile=cert.crt