Version 1.8.0.0
[socat.git] / Makefile.in
blobc01b1a4a230627efb6bf2c942dabd3d4ed5d2ba5
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
5 # note: @...@ forms are filled in by configure script
7 SHELL = /bin/sh
8 AR = @AR@
9 RANLIB = @RANLIB@
11 .SUFFIXES: .c .o
13 prefix = @prefix@
14 exec_prefix = @exec_prefix@
16 BINDEST = @bindir@
18 datarootdir = @datarootdir@
19 MANDEST = @mandir@
21 srcdir = @srcdir@
22 VPATH = @srcdir@
24 CC = @CC@
25 #CCOPT1=-no-pie -fstack-protector
26 #CCOPT=$(CCOPT1) -fcf-protection=none # for gdb on Ubuntu-20.04
27 CCOPTS = $(CCOPT)
29 SYSDEFS = @SYSDEFS@
30 CPPFLAGS = -I. @CPPFLAGS@
31 #0 INCLS = -I. @V_INCL@
32 DEFS = @DEFS@
33 LIBS = @LIBS@
34 LDFLAGS = @LDFLAGS@
36 INSTALL = @INSTALL@
38 #OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) @LIBOBJS@
41 #0 CFLAGS = @CFLAGS@ $(CCOPTS) $(DEFS) $(INCLS)
42 CFLAGS = @CFLAGS@ $(CCOPTS) $(DEFS) $(CPPFLAGS)
43 CLIBS = $(LIBS)
44 #CLIBS = $(LIBS) -lm -lefence
45 XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
46 xiosignal.c xiosigchld.c xioread.c xiowrite.c \
47 xiolayer.c xioshutdown.c xioclose.c xioexit.c \
48 xio-process.c xio-fd.c xio-fdnum.c xio-stdio.c xio-pipe.c \
49 xio-socketpair.c xio-gopen.c xio-creat.c xio-file.c xio-named.c \
50 xio-socket.c xio-interface.c xio-listen.c xio-unix.c xio-vsock.c \
51 xio-ip.c xio-ip4.c xio-ip6.c xio-ipapp.c xio-tcp.c \
52 xio-sctp.c xio-dccp.c xio-rawip.c xio-posixmq.c \
53 xio-socks.c xio-socks5.c xio-proxy.c xio-udp.c xio-udplite.c \
54 xio-progcall.c xio-exec.c xio-system.c xio-shell.c \
55 xio-termios.c xio-readline.c \
56 xio-pty.c xio-openssl.c xio-streams.c xio-namespaces.c \
57 xio-ascii.c xiolockfile.c xio-tcpwrap.c xio-fs.c xio-tun.c
58 XIOOBJS = $(XIOSRCS:.c=.o)
59 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@
60 UTLOBJS = $(UTLSRCS:.c=.o)
61 CFILES = $(XIOSRCS) $(UTLSRCS) socat.c procan_main.c filan_main.c
62 OFILES = $(CFILES:.c=.o)
63 PROGS = socat procan filan
65 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 \
66 xioconfig.h mytypes.h xioopts.h xiodiag.h xiohelp.h xiosysincludes.h \
67 xiomodes.h xiolayer.h xio-process.h xio-fd.h xio-fdnum.h xio-stdio.h \
68 xio-named.h xio-file.h xio-creat.h xio-gopen.h xio-pipe.h \
69 xio-socketpair.h xio-socket.h xio-interface.h xio-listen.h xio-unix.h xio-vsock.h \
70 xio-ip.h xio-ip4.h xio-ip6.h xio-rawip.h xio-posixmq.h \
71 xio-ipapp.h xio-tcp.h xio-udp.h xio-sctp.h xio-dccp.h xio-udplite.h \
72 xio-socks.h xio-socks5.h xio-proxy.h xio-progcall.h xio-exec.h \
73 xio-system.h xio-shell.h xio-termios.h xio-readline.h \
74 xio-pty.h xio-openssl.h xio-streams.h xio-namespaces.h \
75 xio-ascii.h xiolockfile.h xio-tcpwrap.h xio-fs.h xio-tun.h
78 DOCFILES = README README.FIPS CHANGES FILES EXAMPLES PORTING SECURITY DEVELOPMENT doc/socat.yo doc/socat.1 doc/socat.html 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
79 SHFILES = socat-chain.sh socat-mux.sh socat-broker.sh \
80 daemon.sh mail.sh ftp.sh readline.sh \
81 socat_buildscript_for_android.sh
82 TESTFILES = test.sh socks4echo.sh proxyecho.sh readline-test.sh \
83 proxy.sh socks4a-echo.sh
85 all: progs doc
87 scmclean: gitclean
89 gitclean: distclean docclean
90 rm -f Makefile.bak configure
92 doc: doc/socat.1 doc/socat.html
94 docclean:
95 rm -f doc/socat.1 doc/socat.html
97 doc/socat.1: doc/socat.yo
98 -mkdir -p $(@D); yodl2man -o $@ $+
100 doc/socat.html: doc/socat.yo
101 # care for refs in html
102 -mkdir -p $(@D); cd $(@D); yodl2html -o socat.html ../$+; cd ..
104 progs: $(PROGS)
106 depend: $(CFILES) $(HFILES)
107 makedepend $(SYSDEFS) $(CFILES)
109 socat: socat.o libxio.a
110 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ socat.o libxio.a $(CLIBS)
112 procan.o: procan.c
113 $(CC) $(CFLAGS) -c -D CC=\"$(CC)\" -o $@ procan.c
115 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
116 procan: $(PROCAN_OBJS)
117 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS)
119 FILAN_OBJS=filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o vsnprintf_r.o snprinterr.o
120 filan: $(FILAN_OBJS)
121 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(FILAN_OBJS) $(CLIBS)
123 libxio.a: $(XIOOBJS) $(UTLOBJS)
124 $(AR) r $@ $(XIOOBJS) $(UTLOBJS)
125 $(RANLIB) $@
128 strip: progs
129 strip $(PROGS)
131 install: progs $(srcdir)/doc/socat.1
132 mkdir -p $(DESTDIR)$(BINDEST)
133 $(INSTALL) -m 755 socat $(DESTDIR)$(BINDEST)/socat1
134 ln -sf socat1 $(DESTDIR)$(BINDEST)/socat
135 $(INSTALL) -m 755 socat-chain.sh $(DESTDIR)$(BINDEST)
136 $(INSTALL) -m 755 socat-mux.sh $(DESTDIR)$(BINDEST)
137 $(INSTALL) -m 755 socat-broker.sh $(DESTDIR)$(BINDEST)
138 $(INSTALL) -m 755 procan $(DESTDIR)$(BINDEST)
139 $(INSTALL) -m 755 filan $(DESTDIR)$(BINDEST)
140 mkdir -p $(DESTDIR)$(MANDEST)/man1
141 $(INSTALL) -m 644 $(srcdir)/doc/socat.1 $(DESTDIR)$(MANDEST)/man1/socat1.1
142 ln -sf socat1.1 $(DESTDIR)$(MANDEST)/man1/socat.1
144 uninstall:
145 rm -f $(DESTDIR)$(BINDEST)/socat
146 rm -f $(DESTDIR)$(BINDEST)/socat1
147 rm -f $(DESTDIR)$(BINDEST)/socat-chain.sh
148 rm -f $(DESTDIR)$(BINDEST)/socat-mux.sh
149 rm -f $(DESTDIR)$(BINDEST)/socat-broker.sh
150 rm -f $(DESTDIR)$(BINDEST)/procan
151 rm -f $(DESTDIR)$(BINDEST)/filan
152 rm -f $(DESTDIR)$(MANDEST)/man1/socat.1
153 rm -f $(DESTDIR)$(MANDEST)/man1/socat1.1
155 # make a GNU-zipped tar ball of the source files
156 dist: socat.tar.gz socat.tar.bz2
158 socat.tar.gz: socat.tar
159 gzip -9 <socat.tar >socat.tar.gz
161 socat.tar.bz2: socat.tar
162 bzip2 -9 <socat.tar >socat.tar.bz2
164 VERSION = `sed 's/"//g' VERSION`
165 TARDIR = socat-$(VERSION)
166 socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(TESTFILES) socat.spec \
167 configure.ac
168 if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi
169 tar cf - $+ |(cd $(TARDIR); tar xf -)
170 tar cvf socat.tar $(TARDIR)
171 rm -f $(TARDIR)/COPYING # write protected
172 rm -r $(TARDIR)
174 clean:
175 rm -f *.o libxio.a socat procan filan \
176 socat.tar socat.tar.Z socat.tar.gz socat.tar.bz2 \
177 socat.out compile.log test.log
179 # remove all files that are generated from the original socat distribution
180 # note that Makefile is also removed, so you have to start with ./configure
181 # again
182 distclean: clean
183 rm -f config.status config.cache config.log config.h Makefile
184 rm -rf autom4te.cache
186 info: socat
187 uname -a >socat.out
188 ./socat -V >>socat.out
189 ./socat -hh >>socat.out
191 # perform some tests on socat
192 test: progs
193 ./test.sh
195 cert:
196 # prepare critical files with correct permissions to avoid race cond
197 >cert.key
198 >cert.pem
199 chmod 600 cert.key cert.pem
200 # generate a private key
201 openssl genrsa -out cert.key 1024
202 # generate a self signed cert
203 openssl req -new -key cert.key -x509 -days 3653 -out cert.crt
204 # ...enter fields
205 # generate the pem file
206 cat cert.key cert.crt >cert.pem
207 #echo use cert.pem on requestors side, i.e. with option cert=cert.pem
208 #echo use cert.crt on checkers side, i.e. with option cafile=cert.crt