/
Makefile
134 lines (107 loc) · 2.93 KB
/
Makefile
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
PACKAGE = cfailban
VERSION = 0.1.2
srcdir = $(dir $(firstword $(MAKEFILE_LIST)))
include $(srcdir)/ensc-lib/build-simple.mk
VPATH += $(abs_top_srcdir)
AM_CPPFLAGS = \
-I $(abs_top_srcdir) -I $(abs_top_builddir) \
-D PACKAGE=\"$(PACKAGE)\" -D VERSION=\"$(VERSION)\" \
-D _GNU_SOURCE -D CONFIG_DYNAMIC_DEBUG_LEVEL
AM_CFLAGS = \
-std=gnu99 ${C_FLTO}
AM_LDFLAGS = \
-Wl,-as-needed \
${LD_FLTO}
CFLAGS = -Wall -W -Werror -Wno-unused-parameter -Wmissing-prototypes -Wshadow \
-O1 -g3 -D_FORTIFY_SOURCE=2
extra_CPPFLAGS := \
$(call _find_symbol,iniparser_getsecnkeys,\#include <iniparser.h>) \
$(call _find_symbol,CLOCK_BOOTTIME,\#include <time.h>)
AM_CPPFLAGS += ${extra_CPPFLAGS}
sbin_PROGRAMS = cfailban
test_PROGRAMS = testsuite/source-fifo
test_SCRIPTS = testsuite/run_source-fifo
cfailban_SOURCES = \
src/configuration-rules.c \
src/configuration-source.c \
src/configuration-filter.c \
src/configuration-whitelist.c \
src/configuration.c \
src/configuration.h \
src/failban.c \
src/failban.ggo.in \
src/failban.h \
src/filter.c \
src/iniparser-legacy.c \
src/iniparser-legacy.h \
src/logging.h \
src/rules.c \
src/rules.h \
src/source-fifo.c \
src/source-socket.c \
src/source-generic.c \
src/source-generic.h \
src/source.c \
src/source.h \
src/util.h \
ensc-lib/compiler-gcc.h \
ensc-lib/compiler-lint.h \
ensc-lib/compiler.h \
ensc-lib/iniparser-pwdb.c \
ensc-lib/iniparser.h \
ensc-lib/i18n.h \
ensc-lib/io.c \
ensc-lib/io.h \
ensc-lib/list.h \
ensc-lib/logging.c \
ensc-lib/logging.h \
ensc-lib/safe_calloc.h \
ensc-lib/strbuf.h \
ensc-lib/timespec.h \
ensc-lib/xalloc.h \
cfailban_OBJECTS = \
src/failban-cmdline.o
cfailban_LIBS = \
-liniparser \
-lcom_err \
-lrt
CFLAGS_src/failban-cmdline.o = -Wno-unused-but-set-variable
CPPFLAGS_cfailban = -I ${abs_top_builddir}/src
testsuite/source-fifo_SOURCES = \
testsuite/source-fifo.c \
src/source-fifo.c \
src/source-generic.c \
src/source-generic.h \
src/source.h \
ensc-lib/logging.c \
ensc-lib/logging.h \
testsuite/source-fifo_LIBS = \
-lcom_err
BUILT_SOURCES = \
src/failban.ggo \
src/failban-cmdline.c \
src/failban-cmdline.h \
ALL_SOURCES = \
COPYING \
README.org \
Makefile \
cfailban.conf \
${cfailban_SOURCES} \
${testsuite/source-fifo_SOURCES} \
${test_SCRIPTS}
SED_CMD = \
-e 's!@SYSCONFDIR@!${sysconfdir}!g'
#################################
all: $(sbin_PROGRAMS) $(test_PROGRAMS)
cfailban: ${cfailban_SOURCES} ${cfailban_OBJECTS}
$(CC) $(call _buildflags,C) $(filter %.c %.o,$^) -o $@ $($@_LIBS)
testsuite/source-fifo: ${testsuite/source-fifo_SOURCES} ${testsuite/source-fifo_OBJECTS} \
| testsuite/.dirstamp
$(CC) $(call _buildflags,C) $(filter %.c %.o,$^) -o $@ $($@_LIBS)
clean:
rm -f .*stamp */.*stamp *.o */*.o
rm -f ${BUILT_SOURCES} ${sbin_PROGRAMS} ${test_PROGRAMS}
$(eval $(call build_ggo,src/failban))
$(eval $(call _distrule,.xz,${ALL_SOURCES}))
$(eval $(call _checkrules,${ALL_SOURCES}))
$(eval $(call _installrule,sbin))