git ssb

0+

cel / sslh



Tree: 975560aa4a197bc7aeb4a8952ed8a764b8a90e3a

Files: 975560aa4a197bc7aeb4a8952ed8a764b8a90e3a / Makefile

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

Built with git-ssb-web