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