git ssb

0+

cel / sslh



Tree: 6cc33820d166bc790c79f8e42aec8f53bcefd2ba

Files: 6cc33820d166bc790c79f8e42aec8f53bcefd2ba / Makefile

3074 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
70$(OBJS): version.h
71
72sslh-fork: version.h $(OBJS) sslh-fork.o Makefile common.h
73 $(CC) $(CFLAGS) $(LDFLAGS) -o sslh-fork sslh-fork.o $(OBJS) $(LIBS)
74 #strip sslh-fork
75
76sslh-select: version.h $(OBJS) sslh-select.o Makefile common.h
77 $(CC) $(CFLAGS) $(LDFLAGS) -o sslh-select sslh-select.o $(OBJS) $(LIBS)
78 #strip sslh-select
79
80systemd-sslh-generator: systemd-sslh-generator.o
81 $(CC) $(CFLAGS) $(LDFLAGS) -o systemd-sslh-generator systemd-sslh-generator.o -lconfig
82
83echosrv: $(OBJS) echosrv.o
84 $(CC) $(CFLAGS) $(LDFLAGS) -o echosrv echosrv.o probe.o common.o tls.o $(LIBS)
85
86$(MAN): sslh.pod Makefile
87 pod2man --section=8 --release=$(VERSION) --center=" " sslh.pod | gzip -9 - > $(MAN)
88
89# Create release: export clean tree and tag current
90# configuration
91release:
92 git archive master --prefix="sslh-$(VERSION)/" | gzip > /tmp/sslh-$(VERSION).tar.gz
93
94# generic install: install binary and man page
95install: sslh $(MAN)
96 mkdir -p $(DESTDIR)/$(BINDIR)
97 mkdir -p $(DESTDIR)/$(MANDIR)
98 install -p sslh-fork $(DESTDIR)/$(BINDIR)/sslh
99 install -p -m 0644 $(MAN) $(DESTDIR)/$(MANDIR)/$(MAN)
100
101# "extended" install for Debian: install startup script
102install-debian: install sslh $(MAN)
103 sed -e "s+^PREFIX=+PREFIX=$(PREFIX)+" scripts/etc.init.d.sslh > /etc/init.d/sslh
104 chmod 755 /etc/init.d/sslh
105 update-rc.d sslh defaults
106
107uninstall:
108 rm -f $(DESTDIR)$(BINDIR)/sslh $(DESTDIR)$(MANDIR)/$(MAN) $(DESTDIR)/etc/init.d/sslh $(DESTDIR)/etc/default/sslh
109 update-rc.d sslh remove
110
111distclean: clean
112 rm -f tags cscope.*
113
114clean:
115 rm -f sslh-fork sslh-select echosrv version.h $(MAN) systemd-sslh-generator *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info
116
117tags:
118 ctags --globals -T *.[ch]
119
120cscope:
121 -find . -name "*.[chS]" >cscope.files
122 -cscope -b -R
123
124test:
125 ./t
126

Built with git-ssb-web