1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
|
# faucet and hose: network pipe utilities
# Copyright (C) 1992,1993 Robert Forsman
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# You probably want to change this:
#INSTROOT = ${HOME}
DESTDIR = /depot/collections0/netpipes4.1
#INSTROOT = /usr/local
INSTBIN = ${DESTDIR}/usr/bin
INSTMAN = ${DESTDIR}/usr/share/man
# For those who wish to use gcc instead of the vendor's compiler.
#CC=gcc -Wall
# This might be necessary for HPUX
#LDLIBS=-lBSD
# I'm told this is required for Sequent SysV
#LDLIBS=-lsocket -linet -lnsl
# This will be necessary for Sun Solaris (the abomination)
# Also necessary for SCO
#LDLIBS=-lsocket -lnsl
######################################################################
# CFLAGS
######################################################################
# For SunOS, add -DNO_MEMMOVE. It doesn't have this very handy function.
# If you don't want to use (or don't have) fcntl(2) try the -DUSE_IOCTL.
# Add -DNO_STRERROR if your system doesn't have strerror(3)
# Add -DPOSIX_SIG for POSIX signal handling, or -DSYSV for reliable signals
# under SVR3.
# Add -DNO_SETSID if your system doesn't have the setsid() system call.
# (that system call is used by the -daemon argument to detach faucet from
# the controlling terminal)
# SunOS 4.1.4
#CFLAGS = -DUSE_IOCTL -DNO_MEMMOVE -DNO_STRERROR $(CDEBUGFLAGS)
# GNU libc Linux (i.e. RedHat 5.0)
#CFLAGS = -DPOSIX_SIG -DHAVE_INET_ATON $(CDEBUGFLAGS)
# Linux (developed with RedHat 4.2, libc5)
CFLAGS += -DUSE_IOCTL -DPOSIX_SIG -DHAVE_INET_ATON $(CDEBUGFLAGS)
# SGI
#CFLAGS = -DSYSV $(CDEBUGFLAGS)
# Digital Unix ?
#CFLAGS = -DSYSV $(CDEBUGFLAGS)
# Solaris 2.5
#CFLAGS = -DPOSIX_SIG $(CDEBUGFLAGS)
# FreeBSD
#CFLAGS = -DPOSIX_SIG $(CDEBUGFLAGS)
# AIX 4.1.4 and 3.2.5
#CFLAGS = -DPOSIX_SIG -DAIX $(CDEBUGFLAGS)
# DG/UX R4.11MU04 -- AViiON mc88110
#CFLAGS = -DPOSIX_SIG $(CDEBUGFLAGS)
# GNU Win32, the unix-like environment for Win95,
# but it doesn't have Unix domain sockets.
# Does not work yet (I suspect there are bugs in GNUWin32).
#CFLAGS = -DNOUNIXSOCKETS -DPOSIX_SIG $(CDEBUGFLAGS)
# gcc can handle both -O and -g at once
#CDEBUGFLAGS = -g # -Wall -DDEBUG
CDEBUGFLAGS = -O
######################################################################
FOBJS = faucet.o common.o version.o
HOBJS = hose.o common.o version.o memmove.o
SOBJS = sockdown.o version.o
GOBJS = getpeername.o version.o
TOBJS = timelimit.o version.o
EOBJS = encapsulate.o common.o version.o memmove.o
SSLOBJS = ssl-auth.o ssl-criteria.o common.o version.o memmove.o
# Avoid conflict with an independent service `timelimit`.
TIMELIMIT = timelimit.netpipes
SSLDIR = /usr/local/ssl
SSLINC = -I${SSLDIR}/include
#SSLLIB = -L${SSLDIR}/lib -lssl -lcrypto
SSLLIB = -L../SSLeay-0.8.1 -lssl -lcrypto
MANPAGES = netpipes.1 faucet.1 hose.1 \
sockdown.1 getpeername.1 encapsulate.1
# timelimit.1
# ssl-auth.1
PROGRAMS = faucet hose sockdown getpeername ${TIMELIMIT} encapsulate
all : ${PROGRAMS}
faucet : ${FOBJS}
${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${FOBJS} ${LDLIBS}
hose : ${HOBJS}
${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${HOBJS} ${LDLIBS}
sockdown: ${SOBJS}
${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${SOBJS} ${LDLIBS}
getpeername: ${GOBJS}
${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${GOBJS} ${LDLIBS}
${TIMELIMIT}: ${TOBJS}
${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${TOBJS} ${LDLIBS}
encapsulate: ${EOBJS}
${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${EOBJS} ${LDLIBS}
ssl-auth: ${SSLOBJS}
${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${SSLOBJS} ${LDLIBS} ${SSLLIB}
ssl-auth.o: ssl-auth.c
${CC} ${CPPFLAGS} ${CFLAGS} ${SSLINC} -c $<
ssl-criteria.o: ssl-criteria.c
${CC} ${CPPFLAGS} ${CFLAGS} ${SSLINC} -c $<
install : all
mkdir -p ${INSTBIN}
cp ${PROGRAMS} ${INSTBIN}/
#- rm -f ${INSTBIN}/getsockname
#ln -s getpeername ${INSTBIN}/getsockname
mv -f ${INSTBIN}/getpeername ${INSTBIN}/getsockname
#- [ -x ssl-auth ] && cp ssl-auth ${INSTBIN}/
mkdir -p ${INSTMAN}/man1
cp ${MANPAGES} ${INSTMAN}/man1/
cp timelimit.1 ${INSTMAN}/man1/${TIMELIMIT}.1
mv -f ${INSTMAN}/man1/getpeername.1 ${INSTMAN}/man1/getsockname.1
#ln -s getpeername.1 ${INSTMAN}/man1/getsockname.1
#
clean :
rm -f ${FOBJS} ${HOBJS} ${SOBJS} ${GOBJS} ${TOBJS} ${EOBJS} ${SSLOBJS} ${PROGRAMS}
spotless: clean
rm -f *~ core ${PROGRAMS}
#
common.o encapsulate.o faucet.o getpeername.o hose.o sockdown.o \
ssl-auth.o ssl-criteria.o timelimit.o: common.h
encapsulate.o hose.o ssl-auth.o: memmove.h
ssl-auth.o ssl-critera.o: ssl-criteria.h
#
# These targets aren't for normal builders,
# just for me when I make a distribution.
#
HTML2MAN = perl ./html2man.perl
manpages:
for i in *.html; do \
$(HTML2MAN) < $$i > `basename $$i .html`.1; \
done
#sslexp-readkey: sslexp-readkey.c
# $(CC) ${CFLAGS} ${SSLINC} -o $@ sslexp-readkey.c ${LDLIBS} ${SSLLIB}
#sslexp-readcert: sslexp-readcert.c
# $(CC) ${CFLAGS} ${SSLINC} -o $@ sslexp-readcert.c ${LDLIBS} ${SSLLIB}
#
.PHONY: release
release:
- rm -rf release
mkdir release
cd release; \
ln -s ../RCS .; co -r$(RELEASE) RCS/*,v; rm RCS ; chmod u+w *; \
ln ../COPYING . ; make HTML2MAN="perl ../html2man.perl" manpages
cd release; tar cf ../netpipes-$(RELEASE)-noexport.tar *
cd release; tar cf ../netpipes-$(RELEASE)-export.tar `ls | egrep -v '^ssl.*\.[ch]$$'`
|