Files: eb3d3be3abfa4a3563a5e6018aa1814010f2fbd4 / Makefile
2484 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 |
9 | BINDIR?=$(PREFIX)/sbin |
10 | MANDIR?=$(PREFIX)/share/man/man8 |
11 | |
12 | MAN=sslh.8.gz # man page name |
13 | |
14 | # End of configuration -- the rest should take care of |
15 | # itself |
16 | |
17 | ifneq ($(strip $(COV_TEST)),) |
18 | CFLAGS_COV=-fprofile-arcs -ftest-coverage |
19 | endif |
20 | |
21 | CC ?= gcc |
22 | CFLAGS ?=-Wall -g $(CFLAGS_COV) |
23 | |
24 | LIBS= |
25 | OBJS=common.o sslh-main.o probe.o |
26 | |
27 | ifneq ($(strip $(USELIBWRAP)),) |
28 | LIBS:=$(LIBS) -lwrap |
29 | CPPFLAGS+=-DLIBWRAP |
30 | endif |
31 | |
32 | ifneq ($(strip $(USELIBCONFIG)),) |
33 | LIBS:=$(LIBS) -lconfig |
34 | CPPFLAGS+=-DLIBCONFIG |
35 | endif |
36 | |
37 | ifneq ($(strip $(USELIBCAP)),) |
38 | LIBS:=$(LIBS) -lcap |
39 | CPPFLAGS+=-DLIBCAP |
40 | endif |
41 | |
42 | all: sslh $(MAN) echosrv |
43 | |
44 | .c.o: *.h |
45 | $(CC) $(CFLAGS) $(CPPFLAGS) -c $< |
46 | |
47 | version.h: |
48 | ./genver.sh >version.h |
49 | |
50 | sslh: sslh-fork sslh-select |
51 | |
52 | sslh-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 | |
56 | sslh-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 | |
60 | echosrv: $(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 |
68 | release: |
69 | git archive master --prefix="sslh-$(VERSION)/" | gzip > /tmp/sslh-$(VERSION).tar.gz |
70 | |
71 | # generic install: install binary and man page |
72 | install: 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 |
79 | install-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 | |
84 | uninstall: |
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 | |
88 | distclean: clean |
89 | rm -f tags cscope.* |
90 | |
91 | clean: |
92 | rm -f sslh-fork sslh-select echosrv version.h $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info |
93 | |
94 | tags: |
95 | ctags --globals -T *.[ch] |
96 | |
97 | cscope: |
98 | -find . -name "*.[chS]" >cscope.files |
99 | -cscope -b -R |
100 | |
101 | test: |
102 | ./t |
103 |
Built with git-ssb-web