git ssb

0+

cel / sslh



Tree: ba945f1a8f77d414f5e48f9c4166f5759ca7ece4

Files: ba945f1a8f77d414f5e48f9c4166f5759ca7ece4 / Makefile

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

Built with git-ssb-web