Files: 48164c4d7780fed222c1f94e2ede506d21b5984c / Makefile
2412 bytesRaw
1 | # Configuration |
2 | |
3 | VERSION=$(shell ./genver.sh -r) |
4 | USELIBCONFIG=1 # Use libconfig? (necessary to use configuration files) |
5 | USELIBWRAP?= # Use libwrap? |
6 | USELIBCAP= # Use libcap? |
7 | COV_TEST= # Perform test coverage? |
8 | PREFIX=/usr/local |
9 | |
10 | MAN=sslh.8.gz # man page name |
11 | |
12 | # End of configuration -- the rest should take care of |
13 | # itself |
14 | |
15 | ifneq ($(strip $(COV_TEST)),) |
16 | CFLAGS_COV=-fprofile-arcs -ftest-coverage |
17 | endif |
18 | |
19 | CC ?= gcc |
20 | CFLAGS ?=-Wall -g $(CFLAGS_COV) |
21 | |
22 | LIBS= |
23 | OBJS=common.o sslh-main.o probe.o |
24 | |
25 | ifneq ($(strip $(USELIBWRAP)),) |
26 | LIBS:=$(LIBS) -lwrap |
27 | CPPFLAGS+=-DLIBWRAP |
28 | endif |
29 | |
30 | ifneq ($(strip $(USELIBCONFIG)),) |
31 | LIBS:=$(LIBS) -lconfig |
32 | CPPFLAGS+=-DLIBCONFIG |
33 | endif |
34 | |
35 | ifneq ($(strip $(USELIBCAP)),) |
36 | LIBS:=$(LIBS) -lcap |
37 | CPPFLAGS+=-DLIBCAP |
38 | endif |
39 | |
40 | all: sslh $(MAN) echosrv |
41 | |
42 | .c.o: *.h |
43 | $(CC) $(CFLAGS) $(CPPFLAGS) -c $< |
44 | |
45 | version.h: |
46 | ./genver.sh >version.h |
47 | |
48 | sslh: sslh-fork sslh-select |
49 | |
50 | sslh-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 | |
54 | sslh-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 | |
58 | echosrv: $(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 |
66 | release: |
67 | git archive master --prefix="sslh-$(VERSION)/" | gzip > /tmp/sslh-$(VERSION).tar.gz |
68 | |
69 | # generic install: install binary and man page |
70 | install: 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 |
75 | install-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 | |
80 | uninstall: |
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 | |
84 | distclean: clean |
85 | rm -f tags cscope.* |
86 | |
87 | clean: |
88 | rm -f sslh-fork sslh-select echosrv version.h $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info |
89 | |
90 | tags: |
91 | ctags --globals -T *.[ch] |
92 | |
93 | cscope: |
94 | -find . -name "*.[chS]" >cscope.files |
95 | -cscope -b -R |
96 | |
97 | test: |
98 | ./t |
99 | |
100 |
Built with git-ssb-web