2013-07-10 17:09:40 -04:00
|
|
|
# Configuration
|
|
|
|
|
2013-07-10 17:14:15 -04:00
|
|
|
VERSION="v1.10"
|
2013-07-10 17:12:42 -04:00
|
|
|
USELIBWRAP= # Use libwrap?
|
2013-07-10 17:14:15 -04:00
|
|
|
COV_TEST= # Perform test coverage?
|
2013-07-10 17:10:43 -04:00
|
|
|
PREFIX=/usr/local
|
2013-07-10 17:09:40 -04:00
|
|
|
|
2013-07-10 17:10:43 -04:00
|
|
|
MAN=sslh.8.gz # man page name
|
2013-07-10 17:09:40 -04:00
|
|
|
|
|
|
|
# End of configuration -- the rest should take care of
|
|
|
|
# itself
|
|
|
|
|
2013-07-10 17:14:15 -04:00
|
|
|
ifneq ($(strip $(COV_TEST)),)
|
|
|
|
CFLAGS_COV=-fprofile-arcs -ftest-coverage
|
|
|
|
endif
|
|
|
|
|
2013-07-10 17:09:40 -04:00
|
|
|
CC = gcc
|
2013-07-10 17:14:15 -04:00
|
|
|
CFLAGS=-Wall -g $(CFLAGS_COV)
|
2013-07-10 17:09:40 -04:00
|
|
|
|
|
|
|
#LIBS=-lnet
|
|
|
|
LIBS=
|
2013-07-10 17:14:15 -04:00
|
|
|
OBJS=common.o sslh-main.o
|
2013-07-10 17:09:40 -04:00
|
|
|
|
|
|
|
ifneq ($(strip $(USELIBWRAP)),)
|
|
|
|
LIBS:=$(LIBS) -lwrap
|
2013-07-10 17:10:43 -04:00
|
|
|
CFLAGS:=$(CFLAGS) -DLIBWRAP
|
2013-07-10 17:09:40 -04:00
|
|
|
endif
|
|
|
|
|
2013-07-10 17:14:15 -04:00
|
|
|
all: sslh $(MAN) echosrv
|
2013-07-10 17:10:43 -04:00
|
|
|
|
2013-07-10 17:12:42 -04:00
|
|
|
.c.o: *.h
|
|
|
|
$(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -c $<
|
|
|
|
|
|
|
|
|
|
|
|
sslh: $(OBJS) sslh-fork sslh-select
|
|
|
|
|
2013-07-10 17:13:32 -04:00
|
|
|
sslh-fork: $(OBJS) sslh-fork.o Makefile common.h
|
2013-07-10 17:12:42 -04:00
|
|
|
$(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -o sslh-fork sslh-fork.o $(OBJS) $(LIBS)
|
2013-07-10 17:14:15 -04:00
|
|
|
#strip sslh-fork
|
2013-07-10 17:12:42 -04:00
|
|
|
|
2013-07-10 17:13:32 -04:00
|
|
|
sslh-select: $(OBJS) sslh-select.o Makefile common.h
|
2013-07-10 17:12:42 -04:00
|
|
|
$(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -o sslh-select sslh-select.o $(OBJS) $(LIBS)
|
2013-07-10 17:14:15 -04:00
|
|
|
#strip sslh-select
|
2013-07-10 17:12:42 -04:00
|
|
|
|
2013-07-10 17:14:15 -04:00
|
|
|
echosrv: $(OBJS) echosrv.o
|
|
|
|
$(CC) $(CFLAGS) -o echosrv echosrv.o common.o $(LIBS)
|
2013-07-10 17:09:40 -04:00
|
|
|
|
2013-07-10 17:10:43 -04:00
|
|
|
$(MAN): sslh.pod Makefile
|
|
|
|
pod2man --section=8 --release=$(VERSION) --center=" " sslh.pod | gzip -9 - > $(MAN)
|
|
|
|
|
|
|
|
# generic install: install binary and man page
|
|
|
|
install: sslh $(MAN)
|
2013-07-10 17:12:42 -04:00
|
|
|
install -D sslh-fork $(PREFIX)/sbin/sslh
|
2013-07-10 17:10:43 -04:00
|
|
|
install -D -m 0644 $(MAN) $(PREFIX)/share/man/man8/$(MAN)
|
|
|
|
|
|
|
|
# "extended" install for Debian: install startup script
|
|
|
|
install-debian: install sslh $(MAN)
|
|
|
|
sed -e "s+^PREFIX=+PREFIX=$(PREFIX)+" scripts/etc.init.d.sslh > /etc/init.d/sslh
|
|
|
|
chmod 755 /etc/init.d/sslh
|
|
|
|
cp scripts/etc.default.sslh /etc/default/sslh
|
|
|
|
update-rc.d sslh defaults
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(PREFIX)/sbin/sslh $(PREFIX)/share/man/man8/$(MAN) /etc/init.d/sslh /etc/default/sslh
|
|
|
|
update-rc.d sslh remove
|
2013-07-10 17:09:40 -04:00
|
|
|
|
2013-07-10 17:10:43 -04:00
|
|
|
clean:
|
2013-07-10 17:14:15 -04:00
|
|
|
rm -f sslh-fork sslh-select echosrv $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info
|
2013-07-10 17:12:42 -04:00
|
|
|
|
|
|
|
tags:
|
|
|
|
ctags -T *.[ch]
|
|
|
|
|
|
|
|
test:
|
|
|
|
./t
|
|
|
|
|