1
- AM_CFLAGS =-Wall -I$(srcdir ) /libyara/include
1
+ ABI_VERSION = 9:0:1
2
+
3
+ AM_CFLAGS =-Wall -D_GNU_SOURCE -I$(srcdir ) /libyara/include
4
+
5
+ #
6
+ # When bison is used in POSIX yacc emulation mode (-y/--yacc option) it
7
+ # produces warnings if we use Bison-specific features that are not supported
8
+ # by yacc. With -Wno-yacc we turn off those warnings. Ideally we should call
9
+ # bison without the -y/--yacc option, but autoconf insists on using bison in
10
+ # yacc compatibility mode because of AC_PROG_YACC, and AC_PROG_BISON doesn't
11
+ # exist.
12
+ #
13
+ AM_YFLAGS =-d -Wno-yacc
2
14
3
15
if GCOV
4
16
5
17
check :
6
18
@tests/gcov-summary
7
19
8
- MOSTLYCLEANFILES = {cli,tests}/*.gc{no,da,ov}
20
+ MOSTLYCLEANFILES = {cli,tests,libyara,libyara/proc,libyara/modules/* }/*.gc{no,da,ov}
9
21
AM_CFLAGS+ =-O0 -g -ftest-coverage -fprofile-arcs
10
22
11
23
else
@@ -30,12 +42,221 @@ if UB_SANITIZER
30
42
AM_CFLAGS+=-fsanitize =undefined -fno-sanitize-recover=undefined
31
43
endif
32
44
33
- # Build the library in the hand subdirectory first.
34
- SUBDIRS = libyara
35
- DIST_SUBDIRS = libyara
36
-
37
45
ACLOCAL_AMFLAGS =-I m4
38
46
47
+ # Rules for generating YARA modules from .proto files. For each .proto file
48
+ # three files are generated: .c, .pb-c.c, and .pb-c.h. The .c file is generated
49
+ # by protoc-gen-yara and the other two by protoc-gen-c. This is done only if
50
+ # protoc is found, if not, files already in the repository are used instead
51
+ # of generating fresh ones from the .proto file.
52
+ #
53
+ if PROTOC
54
+ # SUFFIXES = .proto .pb-c.c .pb-c.h .c
55
+ .proto.pb-c.c :
56
+ $(PROTOC ) --c_out=$(builddir ) $^ -Ilibyara/pb/ -I=$(srcdir )
57
+
58
+ .proto.pb-c.h :
59
+ $(PROTOC ) --c_out=$(builddir ) $^ -Ilibyara/pb/ -I=$(srcdir )
60
+
61
+ .proto.c :
62
+ $(PROTOC ) --c_out=$(builddir ) $^ -Ilibyara/pb/ -I=$(srcdir )
63
+ endif
64
+
65
+ MODULES = libyara/modules/tests/tests.c
66
+
67
+ MODULES += libyara/modules/elf/elf.c
68
+
69
+ MODULES += libyara/modules/math/math.c
70
+
71
+ MODULES += libyara/modules/time/time.c
72
+
73
+ MODULES += libyara/modules/pe/pe.c
74
+ MODULES += libyara/modules/pe/pe_utils.c
75
+
76
+ MODULES += libyara/modules/console/console.c
77
+
78
+ MODULES += libyara/modules/string/string.c
79
+
80
+ if CUCKOO_MODULE
81
+ MODULES += libyara/modules/cuckoo/cuckoo.c
82
+ endif
83
+
84
+ if MAGIC_MODULE
85
+ MODULES += libyara/modules/magic/magic.c
86
+ endif
87
+
88
+ if HASH_MODULE
89
+ MODULES += libyara/modules/hash/hash.c
90
+ endif
91
+
92
+ if DOTNET_MODULE
93
+ MODULES += libyara/modules/dotnet/dotnet.c
94
+ endif
95
+
96
+ if MACHO_MODULE
97
+ MODULES += libyara/modules/macho/macho.c
98
+ endif
99
+
100
+ if DEX_MODULE
101
+ MODULES += libyara/modules/dex/dex.c
102
+ endif
103
+
104
+ if PB_TESTS_MODULE
105
+ MODULES += libyara/modules/pb_tests/pb_tests.c
106
+ MODULES += libyara/modules/pb_tests/pb_tests.pb-c.c
107
+ endif
108
+
109
+ if AUTHENTICODE_MODULE
110
+ MODULES += libyara/modules/pe/authenticode-parser/authenticode.c
111
+ MODULES += libyara/modules/pe/authenticode-parser/certificate.c
112
+ MODULES += libyara/modules/pe/authenticode-parser/helper.c
113
+ MODULES += libyara/modules/pe/authenticode-parser/countersignature.c
114
+ MODULES += libyara/modules/pe/authenticode-parser/structs.c
115
+ endif
116
+
117
+ #
118
+ # Add your modules here:
119
+ #
120
+ # MODULES += libyara/modules/yourmodule.c
121
+ #
122
+
123
+ include_HEADERS = libyara/include/yara.h
124
+
125
+ yaraincludedir = $(includedir ) /yara
126
+ yarainclude_HEADERS = \
127
+ libyara/include/yara/ahocorasick.h \
128
+ libyara/include/yara/arena.h \
129
+ libyara/include/yara/atoms.h \
130
+ libyara/include/yara/base64.h \
131
+ libyara/include/yara/bitmask.h \
132
+ libyara/include/yara/compiler.h \
133
+ libyara/include/yara/error.h \
134
+ libyara/include/yara/exec.h \
135
+ libyara/include/yara/exefiles.h \
136
+ libyara/include/yara/filemap.h \
137
+ libyara/include/yara/hash.h \
138
+ libyara/include/yara/integers.h \
139
+ libyara/include/yara/libyara.h \
140
+ libyara/include/yara/limits.h \
141
+ libyara/include/yara/mem.h \
142
+ libyara/include/yara/modules.h \
143
+ libyara/include/yara/notebook.h \
144
+ libyara/include/yara/object.h \
145
+ libyara/include/yara/parser.h \
146
+ libyara/include/yara/proc.h \
147
+ libyara/include/yara/re.h \
148
+ libyara/include/yara/rules.h \
149
+ libyara/include/yara/scan.h \
150
+ libyara/include/yara/scanner.h \
151
+ libyara/include/yara/simple_str.h \
152
+ libyara/include/yara/sizedstr.h \
153
+ libyara/include/yara/stack.h \
154
+ libyara/include/yara/stopwatch.h \
155
+ libyara/include/yara/stream.h \
156
+ libyara/include/yara/strutils.h \
157
+ libyara/include/yara/threading.h \
158
+ libyara/include/yara/types.h \
159
+ libyara/include/yara/unaligned.h \
160
+ libyara/include/yara/utils.h
161
+
162
+ noinst_HEADERS = \
163
+ libyara/crypto.h \
164
+ libyara/exception.h \
165
+ libyara/include/yara/dotnet.h \
166
+ libyara/include/yara/elf.h \
167
+ libyara/include/yara/endian.h \
168
+ libyara/include/yara/globals.h \
169
+ libyara/include/yara/hex_lexer.h \
170
+ libyara/include/yara/lexer.h \
171
+ libyara/include/yara/pe.h \
172
+ libyara/include/yara/pe_utils.h \
173
+ libyara/include/yara/re_lexer.h \
174
+ libyara/modules/module_list
175
+
176
+ dist_noinst_DATA = libyara/pb/yara.proto
177
+
178
+ lib_LTLIBRARIES = libyara.la
179
+
180
+ libyara_la_CFLAGS = $(AM_CFLAGS ) -I$(srcdir ) /libyara
181
+ libyara_la_LDFLAGS = -version-number $(ABI_VERSION )
182
+
183
+ BUILT_SOURCES = \
184
+ libyara/lexer.c \
185
+ libyara/hex_lexer.c \
186
+ libyara/re_lexer.c \
187
+ libyara/grammar.c libyara/grammar.h \
188
+ libyara/hex_grammar.c libyara/hex_grammar.h \
189
+ libyara/re_grammar.c libyara/re_grammar.h
190
+
191
+ libyara_la_SOURCES = \
192
+ $(MODULES ) \
193
+ libyara/grammar.y \
194
+ libyara/ahocorasick.c \
195
+ libyara/arena.c \
196
+ libyara/atoms.c \
197
+ libyara/base64.c \
198
+ libyara/bitmask.c \
199
+ libyara/compiler.c \
200
+ libyara/endian.c \
201
+ libyara/exec.c \
202
+ libyara/exefiles.c \
203
+ libyara/filemap.c \
204
+ libyara/hash.c \
205
+ libyara/hex_grammar.y \
206
+ libyara/hex_lexer.l \
207
+ libyara/lexer.l \
208
+ libyara/libyara.c \
209
+ libyara/mem.c \
210
+ libyara/modules.c \
211
+ libyara/notebook.c \
212
+ libyara/object.c \
213
+ libyara/parser.c \
214
+ libyara/proc.c \
215
+ libyara/re.c \
216
+ libyara/re_grammar.y \
217
+ libyara/re_lexer.l \
218
+ libyara/rules.c \
219
+ libyara/scan.c \
220
+ libyara/scanner.c \
221
+ libyara/simple_str.c \
222
+ libyara/sizedstr.c \
223
+ libyara/stack.c \
224
+ libyara/stopwatch.c \
225
+ libyara/strutils.c \
226
+ libyara/stream.c \
227
+ libyara/tlshc/tlsh.c \
228
+ libyara/tlshc/tlsh_impl.c \
229
+ libyara/tlshc/tlsh_util.c \
230
+ libyara/threading.c
231
+
232
+
233
+ if USE_WINDOWS_PROC
234
+ libyara_la_SOURCES += libyara/proc/windows.c
235
+ endif
236
+
237
+ if USE_LINUX_PROC
238
+ libyara_la_SOURCES += libyara/proc/linux.c
239
+ endif
240
+
241
+ if USE_FREEBSD_PROC
242
+ libyara_la_SOURCES += libyara/proc/freebsd.c
243
+ endif
244
+
245
+ if USE_OPENBSD_PROC
246
+ libyara_la_SOURCES += libyara/proc/openbsd.c
247
+ endif
248
+
249
+ if USE_MACH_PROC
250
+ libyara_la_SOURCES += libyara/proc/mach.c
251
+ endif
252
+
253
+ if USE_NO_PROC
254
+ libyara_la_SOURCES += libyara/proc/none.c
255
+ endif
256
+
257
+ pkgconfigdir = $(libdir ) /pkgconfig
258
+ nodist_pkgconfig_DATA = yara.pc
259
+
39
260
bin_PROGRAMS = yara yarac
40
261
41
262
yara_SOURCES = \
@@ -47,8 +268,7 @@ yara_SOURCES = \
47
268
cli/threading.h \
48
269
cli/yara.c
49
270
50
- yara_LDADD = -Llibyara/.libs -lyara
51
- yara_DEPENDENCIES = libyara/.libs/libyara.la
271
+ yara_LDADD = libyara.la
52
272
53
273
yarac_SOURCES = \
54
274
cli/args.c \
@@ -57,43 +277,42 @@ yarac_SOURCES = \
57
277
cli/common.h \
58
278
cli/yarac.c
59
279
60
- yarac_LDADD = -Llibyara/.libs -lyara
61
- yarac_DEPENDENCIES = libyara/.libs/libyara.la
280
+ yarac_LDADD = libyara.la
62
281
63
282
tests_mapper_SOURCES = tests/mapper.c
64
283
tests_mapper_CFLAGS = -O0
65
284
66
285
test_alignment_SOURCES = tests/test-alignment.c tests/util.c
67
- test_alignment_LDADD = libyara/.libs/libyara.a
286
+ test_alignment_LDADD = libyara.la
68
287
test_arena_SOURCES = tests/test-arena.c tests/util.c
69
- test_arena_LDADD = libyara/.libs/libyara.a
288
+ test_arena_LDADD = libyara.la
70
289
test_atoms_SOURCES = tests/test-atoms.c tests/util.c
71
- test_atoms_LDADD = libyara/.libs/libyara.a
290
+ test_atoms_LDADD = libyara.la
72
291
test_rules_SOURCES = tests/test-rules.c tests/util.c
73
- test_rules_LDADD = libyara/.libs/libyara.a
292
+ test_rules_LDADD = libyara.la
74
293
if POSIX
75
294
EXTRA_test_rules_DEPENDENCIES = tests/mapper$(EXEEXT )
76
295
endif
77
296
test_pe_SOURCES = tests/test-pe.c tests/util.c
78
- test_pe_LDADD = libyara/.libs/libyara.a
297
+ test_pe_LDADD = libyara.la
79
298
test_elf_SOURCES = tests/test-elf.c tests/util.c
80
- test_elf_LDADD = libyara/.libs/libyara.a
299
+ test_elf_LDADD = libyara.la
81
300
test_version_SOURCES = tests/test-version.c tests/util.c
82
- test_version_LDADD = libyara/.libs/libyara.a
301
+ test_version_LDADD = libyara.la
83
302
test_api_SOURCES = tests/test-api.c tests/util.c
84
- test_api_LDADD = libyara/.libs/libyara.a
303
+ test_api_LDADD = libyara.la
85
304
test_bitmask_SOURCES = tests/test-bitmask.c tests/util.c
86
- test_bitmask_LDADD = libyara/.libs/libyara.a
305
+ test_bitmask_LDADD = libyara.la
87
306
test_math_SOURCES = tests/test-math.c tests/util.c
88
- test_math_LDADD = libyara/.libs/libyara.a
307
+ test_math_LDADD = libyara.la
89
308
test_string_SOURCES = tests/test-string.c tests/util.c
90
- test_string_LDADD = libyara/.libs/libyara.a
309
+ test_string_LDADD = libyara.la
91
310
test_stack_SOURCES = tests/test-stack.c tests/util.c
92
- test_stack_LDADD = libyara/.libs/libyara.a
311
+ test_stack_LDADD = libyara.la
93
312
test_re_split_SOURCES = tests/test-re-split.c tests/util.c
94
- test_re_split_LDADD = libyara/.libs/libyara.a
313
+ test_re_split_LDADD = libyara.la
95
314
test_async_SOURCES = tests/test-async.c tests/util.c
96
- test_async_LDADD = libyara/.libs/libyara.a
315
+ test_async_LDADD = libyara.la
97
316
98
317
TESTS = $(check_PROGRAMS )
99
318
TESTS_ENVIRONMENT = TOP_SRCDIR=$(top_srcdir ) TOP_BUILDDIR=$(top_builddir )
@@ -123,38 +342,38 @@ if POSIX
123
342
if !ADDRESS_SANITIZER
124
343
check_PROGRAMS+ =test-exception
125
344
test_exception_SOURCES = tests/test-exception.c tests/util.c
126
- test_exception_LDADD = libyara/.libs/libyara.a
345
+ test_exception_LDADD = libyara.la
127
346
endif
128
347
endif
129
348
130
349
if MACHO_MODULE
131
350
check_PROGRAMS+ =test-macho
132
351
test_macho_SOURCES = tests/test-macho.c tests/util.c
133
- test_macho_LDADD = libyara/.libs/libyara.a
352
+ test_macho_LDADD = libyara.la
134
353
endif
135
354
136
355
if DEX_MODULE
137
356
check_PROGRAMS+ =test-dex
138
357
test_dex_SOURCES = tests/test-dex.c tests/util.c
139
- test_dex_LDADD = libyara/.libs/libyara.a
358
+ test_dex_LDADD = libyara.la
140
359
endif
141
360
142
361
if DOTNET_MODULE
143
362
check_PROGRAMS+ =test-dotnet
144
363
test_dotnet_SOURCES = tests/test-dotnet.c tests/util.c
145
- test_dotnet_LDADD = libyara/.libs/libyara.a
364
+ test_dotnet_LDADD = libyara.la
146
365
endif
147
366
148
367
if MAGIC_MODULE
149
368
check_PROGRAMS+ =test-magic
150
369
test_magic_SOURCES = tests/test-magic.c tests/util.c
151
- test_magic_LDADD = libyara/.libs/libyara.a
370
+ test_magic_LDADD = libyara.la
152
371
endif
153
372
154
373
if PB_TESTS_MODULE
155
374
check_PROGRAMS+ =test-pb
156
375
test_pb_SOURCES = tests/test-pb.c tests/util.c
157
- test_pb_LDADD = libyara/.libs/libyara.a
376
+ test_pb_LDADD = libyara.la
158
377
endif
159
378
160
379
# man pages
0 commit comments