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.

195 lines
6.1 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 = /usr/local
  10. exec_prefix = ${prefix}
  11. BINDEST = ${exec_prefix}/bin
  12. datarootdir = ${prefix}/share
  13. MANDEST = ${datarootdir}/man
  14. srcdir = .
  15. CC = gcc
  16. CCOPTS = $(CCOPT) -Wall -Wno-parentheses
  17. SYSDEFS =
  18. CPPFLAGS = -I.
  19. #0 INCLS = -I. @V_INCL@
  20. DEFS = -DHAVE_CONFIG_H
  21. LIBS = -lwrap -lutil -lreadline -lssl
  22. LDFLAGS =
  23. INSTALL = /usr/bin/install -c
  24. #OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o)
  25. #0 CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(INCLS)
  26. CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(CPPFLAGS)
  27. CLIBS = $(LIBS)
  28. #CLIBS = $(LIBS) -lm -lefence
  29. XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
  30. xiosignal.c xiosigchld.c xioread.c xiowrite.c \
  31. xiolayer.c xioshutdown.c xioclose.c xioexit.c \
  32. xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
  33. xio-gopen.c xio-creat.c xio-file.c xio-named.c \
  34. xio-socket.c xio-interface.c xio-listen.c xio-unix.c \
  35. xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
  36. xio-sctp.c xio-rawip.c \
  37. xio-socks.c xio-proxy.c xio-udp.c \
  38. xio-rawip.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 filan.c sycls.c sslcls.c
  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 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
  60. SHFILES = daemon.sh mail.sh ftp.sh readline.sh
  61. TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
  62. proxy.sh socks4a-echo.sh testcert.conf
  63. OSFILES = Config/Makefile.Linux-2-6-24 Config/config.Linux-2-6-24.h \
  64. Config/Makefile.SunOS-5-10 Config/config.SunOS-5-10.h \
  65. Config/Makefile.FreeBSD-6-1 Config/config.FreeBSD-6-1.h \
  66. Config/Makefile.NetBSD-4-0 Config/config.NetBSD-4-0.h \
  67. Config/Makefile.OpenBSD-4-3 Config/config.OpenBSD-4-3.h
  68. all: progs doc
  69. scmclean: gitclean
  70. gitclean: distclean docclean
  71. rm -f Makefile.bak configure
  72. doc: doc/socat.1 doc/socat.html
  73. docclean:
  74. rm -f doc/socat.1 doc/socat.html
  75. doc/socat.1: doc/socat.yo
  76. yodl2man -o $@ $+
  77. doc/socat.html: doc/socat.yo
  78. cd doc; yodl2html -o socat.html socat.yo; cd ..
  79. progs: $(PROGS)
  80. depend: $(CFILES) $(HFILES)
  81. makedepend $(SYSDEFS) $(CFILES)
  82. socat: socat.o libxio.a
  83. $(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS)
  84. PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysutils.o utils.o
  85. procan: $(PROCAN_OBJS)
  86. $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS)
  87. filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o
  88. $(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o $(CLIBS)
  89. libxio.a: $(XIOOBJS) $(UTLOBJS)
  90. $(AR) r $@ $(XIOOBJS) $(UTLOBJS)
  91. $(RANLIB) $@
  92. doc: doc/xio.help
  93. #
  94. strip: progs
  95. strip $(PROGS)
  96. install: progs $(srcdir)/doc/socat.1
  97. mkdir -p $(DESTDIR)$(BINDEST)
  98. $(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST)
  99. $(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST)
  100. $(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST)
  101. mkdir -p $(DESTDIR)$(MANDEST)/man1
  102. $(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/
  103. uninstall:
  104. rm -f $(DESTDIR)$(BINDEST)/socat
  105. rm -f $(DESTDIR)$(BINDEST)/procan
  106. rm -f $(DESTDIR)$(BINDEST)/filan
  107. rm -f $(DESTDIR)$(MANDEST)/man1/socat.1
  108. # make a GNU-zipped tar ball of the source files
  109. dist: socat.tar.gz socat.tar.bz2
  110. socat.tar.gz: socat.tar
  111. gzip -9 <socat.tar >socat.tar.gz
  112. socat.tar.bz2: socat.tar
  113. bzip2 -9 <socat.tar >socat.tar.bz2
  114. VERSION = `sed 's/"//g' VERSION`
  115. TARDIR = socat-$(VERSION)
  116. socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec
  117. if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi
  118. tar cf - $+ |(cd $(TARDIR); tar xf -)
  119. tar cvf socat.tar $(TARDIR)
  120. rm -f $(TARDIR)/COPYING # write protected
  121. rm -r $(TARDIR)
  122. clean:
  123. rm -f *.o libxio.a socat procan filan \
  124. socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
  125. socat.out compile.log test.log
  126. # remove all files that are generated from the original socat distribution
  127. # note that Makefile is also removed, so you have to start with ./configure
  128. # again
  129. distclean: clean
  130. rm -f config.status config.cache config.log config.h Makefile
  131. rm -rf autom4te.cache
  132. info: socat
  133. uname -a >socat.out
  134. ./socat -V >>socat.out
  135. ./socat -hh >>socat.out
  136. # perform some tests on socat
  137. test: progs
  138. ./test.sh
  139. cert:
  140. # prepare critical files with correct permissions to avoid race cond
  141. >cert.key
  142. >cert.pem
  143. chmod 600 cert.key cert.pem
  144. # generate a private key
  145. openssl genrsa -out cert.key 1024
  146. # generate a self signed cert
  147. openssl req -new -key cert.key -x509 -days 3653 -out cert.crt
  148. # ...enter fields
  149. # generate the pem file
  150. cat cert.key cert.crt >cert.pem
  151. #echo use cert.pem on requestors side, i.e. with option cert=cert.pem
  152. #echo use cert.crt on checkers side, i.e. with option cafile=cert.crt