forked from a2o/snoopy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
87 lines (69 loc) · 2.29 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Makefile for snoopy
CC=@CC@
CFLAGS=@CFLAGS@ @DEFS@
LIBS=-ldl
LDFLAGS=@LDFLAGS@ @LIBS@
prefix=@prefix@
exec_prefix=@exec_prefix@
LIBDIR=@libdir@
SNOOPY_EXCLUDE_PREFIX=@SNOOPY_EXCLUDE_PREFIX@
SNOOPY_EXTERNAL_FILTER=@SNOOPY_EXTERNAL_FILTER@
SNOOPY_FILTER_COMMAND=@SNOOPY_FILTER_COMMAND@
SNOOPY_FILTER_COMMAND_DIR=`dirname @SNOOPY_FILTER_COMMAND@`
all: snoopy.so detect
snoopy.so: snoopy.c snoopy.h config.h
$(CC) $(CFLAGS) -shared -O3 -fomit-frame-pointer -fPIC snoopy.c -osnoopy.so $(LDFLAGS)
detect: detect.c
$(CC) detect.c -odetect $(LDFLAGS)
install: all
ifeq ($(SNOOPY_EXTERNAL_FILTER), yes)
install -m 755 -d $(SNOOPY_EXCLUDE_PREFIX)
install -m 755 -d $(SNOOPY_FILTER_COMMAND_DIR)
if test ! -e $(SNOOPY_EXCLUDE_PREFIX)/sh; then \
ln -s /bin/sh $(SNOOPY_EXCLUDE_PREFIX)/sh; \
fi
if test ! -e $(SNOOPY_EXCLUDE_PREFIX)/bash; then \
ln -s /bin/bash $(SNOOPY_EXCLUDE_PREFIX)/bash; \
fi
if test ! -e $(SNOOPY_EXCLUDE_PREFIX)/cat; then \
ln -s /usr/bin/cat $(SNOOPY_EXCLUDE_PREFIX)/cat; \
fi
if test ! -e $(SNOOPY_EXCLUDE_PREFIX)/cut; then \
ln -s /usr/bin/cut $(SNOOPY_EXCLUDE_PREFIX)/cut; \
fi
if test ! -e $(SNOOPY_EXCLUDE_PREFIX)/echo; then \
ln -s /usr/bin/echo $(SNOOPY_EXCLUDE_PREFIX)/echo; \
fi
if test ! -e $(SNOOPY_EXCLUDE_PREFIX)/getent; then \
ln -s /usr/bin/getent $(SNOOPY_EXCLUDE_PREFIX)/getent; \
fi
if test ! -e $(SNOOPY_EXCLUDE_PREFIX)/grep; then \
ln -s /usr/bin/grep $(SNOOPY_EXCLUDE_PREFIX)/grep; \
fi
if test ! -e $(SNOOPY_EXCLUDE_PREFIX)/sed; then \
ln -s /usr/bin/sed $(SNOOPY_EXCLUDE_PREFIX)/sed; \
fi
if test ! -e $(SNOOPY_FILTER_COMMAND); then \
install -m 755 snoopy-filter.sh $(SNOOPY_FILTER_COMMAND); \
fi
@echo
@echo Your external filter is installed here:
@echo $(SNOOPY_FILTER_COMMAND)
@echo
endif
install -m 755 -d $(DESTDIR)$(LIBDIR)
install -m 755 snoopy.so $(DESTDIR)$(LIBDIR)/snoopy.so
@echo -e "\nSnoopy shared library installed in $(DESTDIR)$(LIBDIR)."
@echo -e "Run 'make enable' to actually enable snoopy logging.\n"
enable:
./enable.sh $(DESTDIR)$(LIBDIR)
clean:
rm -f detect snoopy.so
rm -f snoopy-filter.sh
rm -f contrib/sles/snoopy.spec
distclean: clean
rm -f autoscan.log config.h config.log config.status
rm -rf autom4te.cache
rm -f Makefile
realclean: distclean
rm -f configure configure.scan