git ssb

0+

cel / sslh



Tree: 8758a298ba730832838ef982fa8a2e07d3ca6f69

Files: 8758a298ba730832838ef982fa8a2e07d3ca6f69 / Makefile

2615 bytesRaw
1# Configuration
2
3VERSION=$(shell ./genver.sh -r)
4USELIBCONFIG=1 # Use libconfig? (necessary to use configuration files)
5USELIBPCRE=1 # Use libpcre? (necessary to use regex probe)
6USELIBWRAP?= # Use libwrap?
7USELIBCAP= # Use libcap?
8COV_TEST= # Perform test coverage?
9PREFIX?=/usr
10BINDIR?=$(PREFIX)/sbin
11MANDIR?=$(PREFIX)/share/man/man8
12
13MAN=sslh.8.gz # man page name
14
15# End of configuration -- the rest should take care of
16# itself
17
18ifneq ($(strip $(COV_TEST)),)
19 CFLAGS_COV=-fprofile-arcs -ftest-coverage
20endif
21
22CC ?= gcc
23CFLAGS ?=-Wall -g $(CFLAGS_COV)
24
25LIBS=
26OBJS=common.o sslh-main.o probe.o tls.o
27
28ifneq ($(strip $(USELIBWRAP)),)
29 LIBS:=$(LIBS) -lwrap
30 CPPFLAGS+=-DLIBWRAP
31endif
32
33ifneq ($(strip $(USELIBPCRE)),)
34 CPPFLAGS+=-DLIBPCRE
35endif
36
37ifneq ($(strip $(USELIBCONFIG)),)
38 LIBS:=$(LIBS) -lconfig
39 CPPFLAGS+=-DLIBCONFIG
40endif
41
42ifneq ($(strip $(USELIBCAP)),)
43 LIBS:=$(LIBS) -lcap
44 CPPFLAGS+=-DLIBCAP
45endif
46
47all: sslh $(MAN) echosrv
48
49.c.o: *.h
50 $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
51
52version.h:
53 ./genver.sh >version.h
54
55sslh: sslh-fork sslh-select
56
57sslh-fork: version.h $(OBJS) sslh-fork.o Makefile common.h
58 $(CC) $(CFLAGS) $(LDFLAGS) -o sslh-fork sslh-fork.o $(OBJS) $(LIBS)
59 #strip sslh-fork
60
61sslh-select: version.h $(OBJS) sslh-select.o Makefile common.h
62 $(CC) $(CFLAGS) $(LDFLAGS) -o sslh-select sslh-select.o $(OBJS) $(LIBS)
63 #strip sslh-select
64
65echosrv: $(OBJS) echosrv.o
66 $(CC) $(CFLAGS) $(LDFLAGS) -o echosrv echosrv.o probe.o common.o tls.o $(LIBS)
67
68$(MAN): sslh.pod Makefile
69 pod2man --section=8 --release=$(VERSION) --center=" " sslh.pod | gzip -9 - > $(MAN)
70
71# Create release: export clean tree and tag current
72# configuration
73release:
74 git archive master --prefix="sslh-$(VERSION)/" | gzip > /tmp/sslh-$(VERSION).tar.gz
75
76# generic install: install binary and man page
77install: sslh $(MAN)
78 mkdir -p $(DESTDIR)/$(BINDIR)
79 mkdir -p $(DESTDIR)/$(MANDIR)
80 install -p sslh-fork $(DESTDIR)/$(BINDIR)/sslh
81 install -p -m 0644 $(MAN) $(DESTDIR)/$(MANDIR)/$(MAN)
82
83# "extended" install for Debian: install startup script
84install-debian: install sslh $(MAN)
85 sed -e "s+^PREFIX=+PREFIX=$(PREFIX)+" scripts/etc.init.d.sslh > /etc/init.d/sslh
86 chmod 755 /etc/init.d/sslh
87 update-rc.d sslh defaults
88
89uninstall:
90 rm -f $(DESTDIR)$(BINDIR)/sslh $(DESTDIR)$(MANDIR)/$(MAN) $(DESTDIR)/etc/init.d/sslh $(DESTDIR)/etc/default/sslh
91 update-rc.d sslh remove
92
93distclean: clean
94 rm -f tags cscope.*
95
96clean:
97 rm -f sslh-fork sslh-select echosrv version.h $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info
98
99tags:
100 ctags --globals -T *.[ch]
101
102cscope:
103 -find . -name "*.[chS]" >cscope.files
104 -cscope -b -R
105
106test:
107 ./t
108

Built with git-ssb-web