git ssb

0+

cel / sslh



Tree: 48164c4d7780fed222c1f94e2ede506d21b5984c

Files: 48164c4d7780fed222c1f94e2ede506d21b5984c / Makefile

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

Built with git-ssb-web