git ssb

0+

cel / sslh



Tree: 414ed7de1108da241c640db0319e0b18a3d5b4c8

Files: 414ed7de1108da241c640db0319e0b18a3d5b4c8 / Makefile

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

Built with git-ssb-web