Files: 2781c75ff99cd5da7b25f6b883d78ff3de987308 / Makefile
2273 bytesRaw
1 | # Configuration |
2 | |
3 | VERSION="1.14" |
4 | USELIBCONFIG=1 # Use libconfig? (necessary to use configuration files) |
5 | USELIBWRAP= # Use libwrap? |
6 | COV_TEST= # Perform test coverage? |
7 | PREFIX=/usr/local |
8 | |
9 | MAN=sslh.8.gz # man page name |
10 | |
11 | # End of configuration -- the rest should take care of |
12 | # itself |
13 | |
14 | ifneq ($(strip $(COV_TEST)),) |
15 | CFLAGS_COV=-fprofile-arcs -ftest-coverage |
16 | endif |
17 | |
18 | CC ?= gcc |
19 | CFLAGS ?=-Wall -g $(CFLAGS_COV) |
20 | |
21 | LIBS=$(LDFLAGS) |
22 | OBJS=common.o sslh-main.o probe.o |
23 | |
24 | ifneq ($(strip $(USELIBWRAP)),) |
25 | LIBS:=$(LIBS) -lwrap |
26 | CFLAGS:=$(CFLAGS) -DLIBWRAP |
27 | endif |
28 | |
29 | ifneq ($(strip $(USELIBCONFIG)),) |
30 | LIBS:=$(LIBS) -lconfig |
31 | CFLAGS:=$(CFLAGS) -DLIBCONFIG |
32 | endif |
33 | |
34 | all: sslh $(MAN) echosrv |
35 | |
36 | .c.o: *.h |
37 | $(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -c $< |
38 | |
39 | |
40 | sslh: $(OBJS) sslh-fork sslh-select |
41 | |
42 | sslh-fork: $(OBJS) sslh-fork.o Makefile common.h |
43 | $(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -o sslh-fork sslh-fork.o $(OBJS) $(LIBS) |
44 | #strip sslh-fork |
45 | |
46 | sslh-select: $(OBJS) sslh-select.o Makefile common.h |
47 | $(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -o sslh-select sslh-select.o $(OBJS) $(LIBS) |
48 | #strip sslh-select |
49 | |
50 | echosrv: $(OBJS) echosrv.o |
51 | $(CC) $(CFLAGS) -o echosrv echosrv.o probe.o common.o $(LIBS) |
52 | |
53 | $(MAN): sslh.pod Makefile |
54 | pod2man --section=8 --release=$(VERSION) --center=" " sslh.pod | gzip -9 - > $(MAN) |
55 | |
56 | # Create release: export clean tree and tag current |
57 | # configuration |
58 | release: |
59 | svn export . /tmp/sslh-$(VERSION) |
60 | ( cd /tmp; tar zcvf /tmp/sslh-$(VERSION).tar.gz sslh-$(VERSION) ) |
61 | ( cd .. ; svn copy trunk tags/sslh-$(VERSION) ; cd tags/sslh-$(VERSION) ; make clean ) |
62 | |
63 | # generic install: install binary and man page |
64 | install: sslh $(MAN) |
65 | install -D sslh-fork $(PREFIX)/sbin/sslh |
66 | install -D -m 0644 $(MAN) $(PREFIX)/share/man/man8/$(MAN) |
67 | |
68 | # "extended" install for Debian: install startup script |
69 | install-debian: install sslh $(MAN) |
70 | sed -e "s+^PREFIX=+PREFIX=$(PREFIX)+" scripts/etc.init.d.sslh > /etc/init.d/sslh |
71 | chmod 755 /etc/init.d/sslh |
72 | cp scripts/etc.default.sslh /etc/default/sslh |
73 | update-rc.d sslh defaults |
74 | |
75 | uninstall: |
76 | rm -f $(PREFIX)/sbin/sslh $(PREFIX)/share/man/man8/$(MAN) /etc/init.d/sslh /etc/default/sslh |
77 | update-rc.d sslh remove |
78 | |
79 | clean: |
80 | rm -f sslh-fork sslh-select echosrv $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info |
81 | |
82 | tags: |
83 | ctags --globals -T *.[ch] |
84 | |
85 | test: |
86 | ./t |
87 | |
88 |
Built with git-ssb-web