1 # source: Makefile.Tru64-5-1B
2 # Copyright Gerhard Rieger and contributors (see file CHANGES)
3 # Published under the GNU General Public License V.2, see file COPYING
5 # note: @...@ forms are filled in by configure script
14 exec_prefix = ${prefix}
16 BINDEST = ${exec_prefix}/bin
18 MANDEST = ${prefix}/man
24 CCOPTS = $(CCOPT) -Wall -Wno-parentheses
26 SYSDEFS = -D__GNUC__=2 -D__GNUC_MINOR__=9 -Dunix -D__osf__ -D_LONGLONG -DSYSTYPE_BSD -D_SYSTYPE_BSD -D__unix__ -D__osf__ -D_LONGLONG -D__SYSTYPE_BSD__ -D_SYSTYPE_BSD -D__unix -D__SYSTYPE_BSD -D__LANGUAGE_C__ -D__LANGUAGE_C -DLANGUAGE_C -D__alpha -D__alpha__ -D__alpha_ev4__
28 #0 INCLS = -I. @V_INCL@
29 DEFS = -DHAVE_CONFIG_H
30 LIBS = -lutil -lbsd -lrt -lreadline -lcurses -lssl -lcrypto
33 INSTALL = /usr/local/bin/install -c
35 #OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o)
38 #0 CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(INCLS)
39 CFLAGS = -O -D_GNU_SOURCE $(CCOPTS) $(DEFS) $(CPPFLAGS)
41 #CLIBS = $(LIBS) -lm -lefence
42 XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
43 xiosignal.c xiosigchld.c xioread.c xiowrite.c \
44 xiolayer.c xioshutdown.c xioclose.c xioexit.c \
45 xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
46 xio-gopen.c xio-creat.c xio-file.c xio-named.c \
47 xio-socket.c xio-listen.c xio-unix.c xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c xio-socks.c xio-proxy.c xio-udp.c \
49 xio-progcall.c xio-exec.c xio-system.c xio-termios.c xio-readline.c \
50 xio-pty.c xio-openssl.c \
51 xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-ext2.c
52 XIOOBJS = $(XIOSRCS:.c=.o)
53 UTLSRCS = error.c dalan.c procan.c sysutils.c utils.c nestlex.c filan.c sycls.c sslcls.c
54 UTLOBJS = $(UTLSRCS:.c=.o)
55 CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c fdname.c
56 OFILES = $(CFILES:.c=.o)
57 PROGS = socat procan filan
59 HFILES = sycls.h sslcls.h error.h dalan.h procan.h filan.h sysincludes.h xio.h xioopen.h sysutils.h utils.h nestlex.h compat.h \
60 xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
61 xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
62 xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h xio-socket.h \
63 xio-listen.h xio-unix.h xio-rawip.h xio-ip.h xio-ip4.h xio-ip6.h \
64 xio-ipapp.h xio-tcp.h xio-udp.h xio-socks.h xio-proxy.h xio-progcall.h xio-exec.h \
65 xio-system.h xio-termios.h xio-readline.h \
66 xio-pty.h xio-openssl.h \
67 xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-ext2.h
70 DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT socat.1 socat.html xio.help FAQ BUGREPORTS COPYING COPYING.OpenSSL
71 SHFILES = daemon.sh mail.sh ftp.sh readline.sh
72 TESTFILES = test.sh socks4echo.sh proxyecho.sh gatherinfo.sh readline-test.sh \
73 proxy.sh socks4a-echo.sh testcert.conf
74 OSFILES = Config/Makefile.Linux-2-4-20 Config/config.Linux-2-4-20.h \
75 Config/Makefile.AIX-5-1 Config/config.AIX-5-1.h \
76 Config/Makefile.MacOS-10-2 Config/config.MacOS-10-2.h \
77 Config/Makefile.SunOS-5-9 Config/config.SunOS-5-9.h \
78 Config/Makefile.HP-UX-B-11-11 Config/config.HP-UX-B-11-11.h \
79 Config/Makefile.FreeBSD-4-10 Config/config.FreeBSD-4-10.h \
80 Config/Makefile.FreeBSD-5-4 Config/config.FreeBSD-5-4.h \
81 Config/Makefile.OpenBSD-3-4 Config/config.OpenBSD-3-4.h \
82 Config/Makefile.Tru64-5-1B Config/config.Tru64-5-1B.h
89 depend: $(CFILES) $(HFILES)
90 makedepend $(SYSDEFS) $(CFILES)
92 socat: socat.o libxio.a
93 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS)
95 procan: procan_main.o procan.o error.o sycls.o sysutils.o utils.o
96 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ procan_main.o procan.o error.o sycls.o sysutils.o utils.o $(CLIBS)
98 filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o
99 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o $(CLIBS)
101 libxio.a: $(XIOOBJS) $(UTLOBJS)
102 $(AR) r $@ $(XIOOBJS) $(UTLOBJS)
111 install: progs socat.1
112 mkdir -p $(DESTDIR)$(BINDEST)
113 $(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST)
114 $(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST)
115 $(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST)
116 mkdir -p $(DESTDIR)$(MANDEST)/man1
117 $(INSTALL) -m 644 socat.1 $(DESTDIR)$(MANDEST)/man1/
119 # make a GNU-zipped tar ball of the source files
120 dist: socat.tar.gz socat.tar.bz2
122 socat.tar.gz: socat.tar
123 gzip -9 <socat.tar >socat.tar.gz
125 socat.tar.bz2: socat.tar
126 bzip2 -9 <socat.tar >socat.tar.bz2
128 VERSION = `sed 's/"//g' VERSION`
129 TARDIR = socat-$(VERSION)
130 socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) socat.spec
131 if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi
132 tar cf - $+ |(cd $(TARDIR); tar xf -)
133 tar cvf socat.tar $(TARDIR)
134 rm -f $(TARDIR)/COPYING # write protected
138 rm -f *.o libxio.a socat procan filan \
139 socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
140 socat.out compile.log test.log
142 # remove all files that are generated from the original socat distribution
143 # note that Makefile is also removed, so you have to start with ./configure
146 rm -f config.status config.cache config.log config.h Makefile
147 rm -rf autom4te.cache
151 ./socat -V >>socat.out
152 ./socat -hh >>socat.out
154 # perform some tests on socat
159 # prepare critical files with correct permissions to avoid race cond
162 chmod 600 cert.key cert.pem
163 # generate a private key
164 openssl genrsa -out cert.key 1024
165 # generate a self signed cert
166 openssl req -new -key cert.key -x509 -days 3653 -out cert.crt
168 # generate the pem file
169 cat cert.key cert.crt >cert.pem
170 #echo use cert.pem on requestors side, i.e. with option cert=cert.pem
171 #echo use cert.crt on checkers side, i.e. with option cafile=cert.crt