19
20
CFLAGS ?=-Wall -g $(CFLAGS_COV)
22
23
OBJS=common.o sslh-main.o probe.o
24
25
ifneq ($(strip $(USELIBWRAP)),)
25
26
LIBS:=$(LIBS) -lwrap
26
CFLAGS:=$(CFLAGS) -DLIBWRAP
29
30
ifneq ($(strip $(USELIBCONFIG)),)
30
31
LIBS:=$(LIBS) -lconfig
31
CFLAGS:=$(CFLAGS) -DLIBCONFIG
35
ifneq ($(strip $(USELIBCAP)),)
34
40
all: sslh $(MAN) echosrv
37
$(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -c $<
40
sslh: $(OBJS) sslh-fork sslh-select
42
sslh-fork: $(OBJS) sslh-fork.o Makefile common.h
43
$(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -o sslh-fork sslh-fork.o $(OBJS) $(LIBS)
43
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
46
./genver.sh >version.h
48
sslh: sslh-fork sslh-select
50
sslh-fork: version.h $(OBJS) sslh-fork.o Makefile common.h
51
$(CC) $(CFLAGS) $(LDFLAGS) -o sslh-fork sslh-fork.o $(OBJS) $(LIBS)
46
sslh-select: $(OBJS) sslh-select.o Makefile common.h
47
$(CC) $(CFLAGS) -D'VERSION=$(VERSION)' -o sslh-select sslh-select.o $(OBJS) $(LIBS)
54
sslh-select: version.h $(OBJS) sslh-select.o Makefile common.h
55
$(CC) $(CFLAGS) $(LDFLAGS) -o sslh-select sslh-select.o $(OBJS) $(LIBS)
50
58
echosrv: $(OBJS) echosrv.o
51
$(CC) $(CFLAGS) -o echosrv echosrv.o probe.o common.o $(LIBS)
59
$(CC) $(CFLAGS) $(LDFLAGS) -o echosrv echosrv.o probe.o common.o $(LIBS)
53
61
$(MAN): sslh.pod Makefile
54
62
pod2man --section=8 --release=$(VERSION) --center=" " sslh.pod | gzip -9 - > $(MAN)
61
69
# generic install: install binary and man page
62
70
install: sslh $(MAN)
63
install -D sslh-fork $(PREFIX)/sbin/sslh
64
install -D -m 0644 $(MAN) $(PREFIX)/share/man/man8/$(MAN)
71
install -pD sslh-fork $(DESTDIR)$(PREFIX)/sbin/sslh
72
install -pD -m 0644 $(MAN) $(DESTDIR)$(PREFIX)/share/man/man8/$(MAN)
66
74
# "extended" install for Debian: install startup script
67
75
install-debian: install sslh $(MAN)
71
79
update-rc.d sslh defaults
74
rm -f $(PREFIX)/sbin/sslh $(PREFIX)/share/man/man8/$(MAN) /etc/init.d/sslh /etc/default/sslh
82
rm -f $(DESTDIR)$(PREFIX)/sbin/sslh $(DESTDIR)$(PREFIX)/share/man/man8/$(MAN) $(DESTDIR)/etc/init.d/sslh $(DESTDIR)/etc/default/sslh
75
83
update-rc.d sslh remove
78
rm -f sslh-fork sslh-select echosrv $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info
89
rm -f sslh-fork sslh-select echosrv version.h $(MAN) *.o *.gcov *.gcno *.gcda *.png *.html *.css *.info
81
92
ctags --globals -T *.[ch]
95
-find . -name "*.[chS]" >cscope.files