1#
2#  Copyright (C) 2013-2022 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
3#  Copyright (C) 2007-2013 Sourcefire, Inc.
4#  Copyright (C) 2002-2007 Tomasz Kojm <tkojm@clamav.net>
5#
6#  This program is free software; you can redistribute it and/or modify
7#  it under the terms of the GNU General Public License as published by
8#  the Free Software Foundation; either version 2 of the License, or
9#  (at your option) any later version.
10#
11#  This program is distributed in the hope that it will be useful,
12#  but WITHOUT ANY WARRANTY; without even the implied warranty of
13#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14#  GNU General Public License for more details.
15#
16#  You should have received a copy of the GNU General Public License
17#  along with this program; if not, write to the Free Software
18#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19#  MA 02110-1301, USA.
20
21AM_YFLAGS = -d
22AM_LFLAGS = -d
23AM_CPPFLAGS = -I$(top_srcdir) -I@srcdir@/nsis $(LTDLINCL)
24AM_CFLAGS=@WERR_CFLAGS@
25lib_LTLIBRARIES =
26COMMON_CLEANFILES =
27EXTRA_DIST = c++/Makefile.nollvm.in
28if ENABLE_UNRAR
29
30AM_CPPFLAGS += -DWARN_DLOPEN_FAIL
31libclamunrar_la_CXXFLAGS = $(AM_CPPFLAGS) -DRARDLL  -Wno-switch
32libclamunrar_la_LDFLAGS = @TH_SAFE@ -version-info @LIBCLAMAV_VERSION@ -no-undefined
33
34if VERSIONSCRIPT
35libclamunrar_la_LDFLAGS += -Wl,@VERSIONSCRIPTFLAG@,@top_srcdir@/libclamunrar/libclamunrar.map
36endif
37
38libclamunrar_la_SOURCES = \
39	../libclamunrar/archive.cpp \
40	../libclamunrar/arcread.cpp \
41	../libclamunrar/blake2s.cpp \
42	../libclamunrar/cmddata.cpp \
43	../libclamunrar/consio.cpp \
44	../libclamunrar/crc.cpp \
45	../libclamunrar/crypt.cpp \
46	../libclamunrar/dll.cpp \
47	../libclamunrar/encname.cpp \
48	../libclamunrar/errhnd.cpp \
49	../libclamunrar/extinfo.cpp \
50	../libclamunrar/extract.cpp \
51	../libclamunrar/filcreat.cpp \
52	../libclamunrar/file.cpp \
53	../libclamunrar/filefn.cpp \
54	../libclamunrar/filestr.cpp \
55	../libclamunrar/find.cpp \
56	../libclamunrar/getbits.cpp \
57	../libclamunrar/global.cpp \
58	../libclamunrar/hash.cpp \
59	../libclamunrar/headers.cpp \
60	../libclamunrar/isnt.cpp \
61	../libclamunrar/list.cpp \
62	../libclamunrar/match.cpp \
63	../libclamunrar/options.cpp \
64	../libclamunrar/pathfn.cpp \
65	../libclamunrar/qopen.cpp \
66	../libclamunrar/rar.cpp \
67	../libclamunrar/rarvm.cpp \
68	../libclamunrar/rawread.cpp \
69	../libclamunrar/rdwrfn.cpp \
70	../libclamunrar/recvol.cpp \
71	../libclamunrar/resource.cpp \
72	../libclamunrar/rijndael.cpp \
73	../libclamunrar/rs.cpp \
74	../libclamunrar/rs16.cpp \
75	../libclamunrar/scantree.cpp \
76	../libclamunrar/secpassword.cpp \
77	../libclamunrar/sha1.cpp \
78	../libclamunrar/sha256.cpp \
79	../libclamunrar/smallfn.cpp \
80	../libclamunrar/strfn.cpp \
81	../libclamunrar/strlist.cpp \
82	../libclamunrar/system.cpp \
83	../libclamunrar/threadpool.cpp \
84	../libclamunrar/timefn.cpp \
85	../libclamunrar/ui.cpp \
86	../libclamunrar/unicode.cpp \
87	../libclamunrar/unpack.cpp \
88	../libclamunrar/volume.cpp
89
90lib_LTLIBRARIES += libclamunrar.la
91EXTRA_DIST += @top_srcdir@/libclamunrar/libclamunrar.map
92
93libclamunrar_iface_la_CXXFLAGS = $(AM_CPPFLAGS) -I@top_srcdir@/libclamunrar
94libclamunrar_iface_la_LIBADD = libclamunrar.la
95libclamunrar_iface_la_LDFLAGS = -module @TH_SAFE@ -version-info @LIBCLAMAV_VERSION@ -no-undefined
96
97if VERSIONSCRIPT
98libclamunrar_iface_la_LDFLAGS += -Wl,@VERSIONSCRIPTFLAG@,@top_srcdir@/libclamunrar_iface/libclamunrar_iface.map
99endif
100
101libclamunrar_iface_la_SOURCES = \
102	../libclamunrar_iface/unrar_iface.cpp \
103	../libclamunrar_iface/unrar_iface.h
104
105lib_LTLIBRARIES += libclamunrar_iface.la
106EXTRA_DIST += @top_srcdir@/libclamunrar_iface/libclamunrar_iface.map
107
108IFACELIBADD = -dlopen libclamunrar_iface.la
109IFACEDEP = libclamunrar_iface.la
110endif
111
112# We need libclamunrar_iface in the include path even if we don't build it,
113# because we #include "unrar_iface.h"
114# We still want to support unrar if it is later provided, which is why we don't
115# just wrap all the unrar scanners code with #ifdefs.
116IFACE_CFLAGS = -I@top_srcdir@/libclamunrar_iface
117
118if USE_INTERNAL_MSPACK
119# libmspack version: 0.8alpha (1:0:1)
120LIBMSPACK_VERSION = 1:0:1
121
122libclammspack_la_CFLAGS = -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wno-unused-parameter -I@top_srcdir@/libclammspack/mspack
123libclammspack_la_LDFLAGS = -version-info $(LIBMSPACK_VERSION) -no-undefined -export-symbols-regex '^mspack_'
124
125# if VERSIONSCRIPT
126# libclammspack_la_LDFLAGS += -Wl,@VERSIONSCRIPTFLAG@,@top_srcdir@/libclammspack/libclammspack.map
127# endif
128
129libclammspack_la_SOURCES = \
130	../libclammspack/mspack/cab.h \
131	../libclammspack/mspack/cabc.c \
132	../libclammspack/mspack/cabd.c \
133	../libclammspack/mspack/chm.h \
134	../libclammspack/mspack/chmc.c \
135	../libclammspack/mspack/chmd.c \
136	../libclammspack/mspack/crc32.c \
137	../libclammspack/mspack/crc32.h \
138	../libclammspack/mspack/des.h \
139	../libclammspack/mspack/hlp.h \
140	../libclammspack/mspack/hlpc.c \
141	../libclammspack/mspack/hlpd.c \
142	../libclammspack/mspack/kwaj.h \
143	../libclammspack/mspack/kwajc.c \
144	../libclammspack/mspack/kwajd.c \
145	../libclammspack/mspack/lit.h \
146	../libclammspack/mspack/litc.c \
147	../libclammspack/mspack/litd.c \
148	../libclammspack/mspack/lzss.h \
149	../libclammspack/mspack/lzssd.c \
150	../libclammspack/mspack/lzx.h \
151	../libclammspack/mspack/lzxc.c \
152	../libclammspack/mspack/lzxd.c \
153	../libclammspack/mspack/mspack.h \
154	../libclammspack/mspack/mszip.h \
155	../libclammspack/mspack/mszipc.c \
156	../libclammspack/mspack/mszipd.c \
157	../libclammspack/mspack/oab.h \
158	../libclammspack/mspack/oabc.c \
159	../libclammspack/mspack/oabd.c \
160	../libclammspack/mspack/qtm.h \
161	../libclammspack/mspack/qtmd.c \
162	../libclammspack/mspack/readbits.h \
163	../libclammspack/mspack/readhuff.h \
164	../libclammspack/mspack/sha.h \
165	../libclammspack/mspack/system.c \
166	../libclammspack/mspack/system.h \
167	../libclammspack/mspack/szdd.h \
168	../libclammspack/mspack/szddc.c \
169	../libclammspack/mspack/szddd.c
170
171lib_LTLIBRARIES += libclammspack.la
172# EXTRA_DIST += @top_srcdir@/libclammspack/libclammspack.map
173
174MSPACK_CFLAGS = -I@top_srcdir@/libclammspack/mspack -DHAVE_INTERNAL_MSPACK
175MSPACKLIBADD = -lclammspack
176MSPACKDEP = libclammspack.la
177
178else
179MSPACK_CFLAGS = $(LIBMSPACK_CFLAGS)
180MSPACKLIBADD = $(LIBMSPACK_LIBS)
181MSPACKDEP =
182
183libmspack/Makefile:
184.PHONY: distdir distclean maintainer-clean
185distdir:
186	echo "make distdir requires --with-system-libmspack=no"
187	exit 1
188
189# nothing to do here, rules must exist for distclean to succeed
190distclean:
191	-rm -f Makefile
192maintainer-clean:
193
194distclean-recursive distdir maintainer-clean-recursive: libmspack/Makefile
195endif
196
197libclamav_internal_utils_la_SOURCES= \
198	conv.c \
199	conv.h \
200	crypto.c \
201	iowrap.c \
202	iowrap.h \
203	others_common.c \
204	others.h \
205	qsort.c \
206	regex/cclass.h \
207	regex/cname.h \
208	regex/regcomp.c \
209	regex/regerror.c \
210	regex/regex.h \
211	regex/regex2.h \
212	regex/regexec.c \
213	regex/regfree.c \
214	regex/strlcpy.c \
215	regex/utils.h \
216	str.c \
217	str.h \
218	strlcat.c
219
220libclamav_internal_utils_la_LDFLAGS=-static @SSL_LDFLAGS@ @JSON_LDFLAGS@
221libclamav_internal_utils_la_CFLAGS=$(AM_CFLAGS) $(IFACE_CFLAGS) -fPIC -DPIC @SSL_CPPFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@ @XML_CPPFLAGS@
222libclamav_internal_utils_la_LIBADD=@SSL_LIBS@ @PCRE_LIBS@
223
224SUBDIRS=
225
226if ENABLE_LLVM
227LLVMLIBADD=c++/libclamavcxx.la -lstdc++ -lm
228LLVMDEP=c++/libclamavcxx.la
229SUBDIRS+=c++
230else
231LLVMLIBADD=libclamav_nocxx.la
232LLVMDEP=libclamav_nocxx.la
233c++/Makefile: c++/Makefile.nollvm.in
234	$(AM_V_at) cp $< $@
235distclean-recursive distdir maintainer-clean-recursive: c++/Makefile
236endif
237
238if ENABLE_YARA
239YARA_CFLAGS=-DHAVE_YARA
240endif
241
242libclamav_nocxx_la_SOURCES = bytecode_nojit.c
243libclamav_nocxx_la_CFLAGS=$(AM_CFLAGS) $(IFACE_CFLAGS) @SSL_CPPFLAGS@ @JSON_CPPFLAGS@ @ZLIB_CFLAGS@ @PCRE_CPPFLAGS@
244
245libclamav_la_LIBADD = @SSL_LIBS@ @JSON_LIBS@ @PCRE_LIBS@ @LIBCLAMAV_LIBS@ @ZLIB_LIBS@ @LIBLTDL@ $(XML_LIBS) $(IFACELIBADD) $(MSPACKLIBADD) $(LLVMLIBADD) libclamav_internal_utils.la @THREAD_LIBS@ @LIBM@
246libclamav_la_DEPENDENCIES =  @LTDLDEPS@ $(IFACEDEP) $(LLVMDEP) $(MSPACKDEP) libclamav_internal_utils.la
247libclamav_la_CFLAGS = $(IFACE_CFLAGS) $(MSPACK_CFLAGS) $(AM_CFLAGS) $(YARA_CFLAGS) -DSEARCH_LIBDIR=\"$(libdir)\" @LIBCLAMAV_CPPFLAGS@ @SSL_CPPFLAGS@ @JSON_CPPFLAGS@ @ZLIB_CFLAGS@ @PCRE_CPPFLAGS@ @XML_CPPFLAGS@
248libclamav_la_LDFLAGS = @SSL_LDFLAGS@ @TH_SAFE@ @JSON_LDFLAGS@ @LIBICONV@ $(XML_LIBS) -version-info @LIBCLAMAV_VERSION@ -no-undefined
249
250if VERSIONSCRIPT
251libclamav_la_LDFLAGS += -Wl,@VERSIONSCRIPTFLAG@,@top_srcdir@/libclamav/libclamav.map
252endif
253
254include_HEADERS = clamav.h
255
256libclamav_la_SOURCES = \
257	matcher-ac.c \
258	matcher-ac.h \
259	matcher-bm.c \
260	matcher-bm.h \
261	matcher-hash.c \
262	matcher-hash.h \
263	matcher.c \
264	matcher.h \
265	others.c \
266	others.h \
267	readdb.c \
268	readdb.h \
269	cvd.c \
270	cvd.h \
271	dsig.c \
272	dsig.h \
273	scanners.c \
274	scanners.h \
275	textdet.c \
276	textdet.h \
277	filetypes.c \
278	filetypes.h \
279	filetypes_int.h \
280	rtf.c \
281	rtf.h \
282	blob.c \
283	blob.h \
284	mbox.c \
285	mbox.h \
286	message.c \
287	message.h \
288	table.c \
289	table.h \
290	text.c \
291	text.h \
292	ole2_extract.c \
293	ole2_extract.h \
294	vba_extract.c \
295	vba_extract.h \
296    xlm_extract.c \
297    xlm_extract.h \
298	msexpand.c \
299	msexpand.h \
300	pe.c \
301	pe.h \
302	pe_icons.c \
303	pe_icons.h \
304	pe_structs.h \
305	disasm.c \
306	disasm.h \
307	disasm-common.h \
308	disasmpriv.h \
309	upx.c \
310	upx.h \
311	htmlnorm.c \
312	htmlnorm.h \
313	libmspack.c \
314	libmspack.h \
315	rebuildpe.c \
316	rebuildpe.h \
317	petite.c \
318	petite.h \
319	wwunpack.c \
320	wwunpack.h \
321	unsp.c \
322	unsp.h \
323	aspack.c \
324	aspack.h \
325	packlibs.c \
326	packlibs.h \
327	fsg.c \
328	fsg.h \
329	mew.c \
330	mew.h \
331	upack.c \
332	upack.h \
333	line.c \
334	line.h \
335	untar.c \
336	untar.h \
337	unzip.c \
338	unzip.h \
339	ooxml.c \
340	ooxml.h \
341	inflate64.c \
342	inflate64.h \
343	inffixed64.h \
344	inflate64_priv.h \
345	special.c \
346	special.h \
347	binhex.c \
348	binhex.h \
349	is_tar.c \
350	is_tar.h \
351	tnef.c \
352	tnef.h \
353	autoit.c \
354	autoit.h \
355	unarj.c \
356	unarj.h \
357	nsis/bzlib.c \
358	nsis/bzlib_private.h \
359	nsis/nsis_bzlib.h \
360	nsis/nulsft.c \
361	nsis/nulsft.h \
362	nsis/infblock.c \
363	nsis/nsis_zconf.h \
364	nsis/nsis_zlib.h \
365	nsis/nsis_zutil.h \
366	pdf.c \
367	pdf.h \
368	pdfng.c \
369	pdfdecode.c \
370	pdfdecode.h \
371	spin.c \
372	spin.h \
373	yc.c \
374	yc.h \
375	elf.c \
376	elf.h \
377	execs.h \
378	execs.c \
379	sis.c \
380	sis.h \
381	uuencode.c \
382	uuencode.h \
383	phishcheck.c \
384	phishcheck.h \
385	phish_domaincheck_db.c \
386	phish_domaincheck_db.h \
387	phish_whitelist.c \
388	phish_whitelist.h \
389	iana_cctld.h \
390	iana_tld.h \
391	regex_list.c \
392	regex_list.h \
393	regex_suffix.c \
394	regex_suffix.h \
395	entconv.c \
396	entconv.h \
397	entitylist.h \
398	encoding_aliases.h \
399	hashtab.c \
400	hashtab.h \
401	dconf.c \
402	dconf.h \
403	lzma_iface.c \
404	lzma_iface.h \
405	7z_iface.c \
406	7z_iface.h \
407	7z/7z.h \
408	7z/7zAlloc.c \
409	7z/7zAlloc.h \
410	7z/7zBuf.c \
411	7z/7zBuf.h \
412	7z/7zBuf2.c \
413	7z/7zCrc.c \
414	7z/7zCrc.h \
415	7z/7zDec.c \
416	7z/7zFile.c \
417	7z/7zFile.h \
418	7z/7zIn.c \
419	7z/7zStream.c \
420	7z/7zVersion.h \
421	7z/Bcj2.c \
422	7z/Bcj2.h \
423	7z/Bra.c \
424	7z/Bra.h \
425	7z/Bra86.c \
426	7z/CpuArch.h \
427	7z/Lzma2Dec.c \
428	7z/Lzma2Dec.h \
429	7z/LzmaDec.c \
430	7z/LzmaDec.h \
431	7z/Ppmd.h \
432	7z/Ppmd7.c \
433	7z/Ppmd7.h \
434	7z/Ppmd7Dec.c \
435	7z/Types.h \
436	7z/Xz.c \
437	7z/Xz.h \
438	7z/XzCrc64.c \
439	7z/XzCrc64.h \
440	7z/XzDec.c \
441	7z/XzIn.c \
442	7z/Delta.c \
443	7z/Delta.h \
444	7z/Alloc.h \
445	7z/BraIA64.c \
446	7z/CpuArch.c \
447	7z/CpuArch.h \
448	7z/7zCrcOpt.c \
449	7z/RotateDefs.h \
450	explode.c \
451	explode.h \
452	textnorm.c \
453	textnorm.h \
454	dlp.c \
455	dlp.h \
456	jsparse/js-norm.c \
457	jsparse/js-norm.h \
458	jsparse/lexglobal.h \
459	jsparse/textbuf.h \
460	uniq.c \
461	uniq.h \
462	version.c\
463	version.h\
464	mpool.c\
465	mpool.h \
466	filtering.h\
467	filtering.c\
468	fmap.c \
469	fmap.h \
470	perflogging.c\
471	perflogging.h\
472	default.h\
473	bytecode.c\
474	bytecode.h\
475	bytecode_vm.c\
476	bytecode_priv.h\
477	clambc.h \
478	cpio.c \
479	cpio.h \
480	macho.c \
481	macho.h \
482	ishield.c \
483	ishield.h \
484	type_desc.h \
485	bcfeatures.h \
486	bytecode_api.c \
487	bytecode_api_decl.c \
488	bytecode_api.h \
489	bytecode_api_impl.h \
490	bytecode_hooks.h \
491	cache.c \
492	cache.h \
493	bytecode_detect.c \
494	bytecode_detect.h\
495	builtin_bytecodes.h\
496	events.c\
497	events.h \
498	adc.c \
499	adc.h \
500	dmg.c \
501	dmg.h \
502	xar.c \
503	xar.h \
504	xdp.c \
505	xdp.h \
506	mbr.c \
507	mbr.h \
508	gpt.c \
509	gpt.h \
510	apm.c \
511	apm.h \
512	partition_intersection.c \
513	partition_intersection.h \
514	json_api.c\
515	json_api.h\
516	xz_iface.c \
517	xz_iface.h \
518	sf_base64decode.c \
519	sf_base64decode.h \
520	hfsplus.c \
521	hfsplus.h \
522	swf.c \
523	swf.h \
524	gif.c \
525	gif.h \
526	jpeg.c \
527	jpeg.h \
528	png.c \
529	png.h \
530	iso9660.c \
531	iso9660.h \
532	arc4.c \
533	arc4.h \
534	rijndael.c \
535	rijndael.h \
536	crtmgr.c \
537	crtmgr.h \
538	asn1.c \
539	asn1.h \
540	fpu.c \
541	fpu.h \
542	stats.c \
543	stats.h \
544	www.c \
545	www.h \
546	stats_json.c \
547	stats_json.h \
548	hostid_internal.c \
549	hostid_internal.h \
550	openioc.c \
551	openioc.h \
552	msdoc.c \
553	msdoc.h \
554	matcher-pcre.c \
555	matcher-pcre.h \
556	regex_pcre.c \
557	regex_pcre.h \
558	msxml.c \
559	msxml.h \
560	msxml_parser.c \
561	msxml_parser.h \
562	tiff.c \
563	tiff.h \
564	hwp.c \
565	hwp.h \
566	lzw/lzwdec.c \
567	lzw/lzwdec.h \
568	matcher-byte-comp.c \
569	matcher-byte-comp.h \
570	egg.c \
571	egg.h \
572	queue.h
573
574if ENABLE_YARA
575libclamav_la_SOURCES += yara_arena.c \
576	yara_arena.h \
577	yara_compiler.c \
578	yara_compiler.h \
579	yara_exec.c \
580	yara_exec.h \
581	yara_hash.c \
582	yara_hash.h \
583	yara_grammar.y \
584	yara_lexer.l \
585	yara_lexer.h \
586	yara_parser.c \
587	yara_parser.h \
588	yara_clam.h
589endif
590
591libclamav_la_SOURCES += bignum.h\
592	bignum_fast.h\
593	tomsfastmath/addsub/fp_add.c\
594	tomsfastmath/addsub/fp_add_d.c\
595	tomsfastmath/addsub/fp_addmod.c\
596	tomsfastmath/addsub/fp_cmp.c\
597	tomsfastmath/addsub/fp_cmp_d.c\
598	tomsfastmath/addsub/fp_cmp_mag.c\
599	tomsfastmath/addsub/fp_sub.c\
600	tomsfastmath/addsub/fp_sub_d.c\
601	tomsfastmath/addsub/fp_submod.c\
602	tomsfastmath/addsub/s_fp_add.c\
603	tomsfastmath/addsub/s_fp_sub.c\
604	tomsfastmath/bin/fp_radix_size.c\
605	tomsfastmath/bin/fp_read_radix.c\
606	tomsfastmath/bin/fp_read_signed_bin.c\
607	tomsfastmath/bin/fp_read_unsigned_bin.c\
608	tomsfastmath/bin/fp_reverse.c\
609	tomsfastmath/bin/fp_s_rmap.c\
610	tomsfastmath/bin/fp_signed_bin_size.c\
611	tomsfastmath/bin/fp_to_signed_bin.c\
612	tomsfastmath/bin/fp_to_unsigned_bin.c\
613	tomsfastmath/bin/fp_toradix.c\
614	tomsfastmath/bin/fp_toradix_n.c\
615	tomsfastmath/bin/fp_unsigned_bin_size.c\
616	tomsfastmath/bit/fp_cnt_lsb.c\
617	tomsfastmath/bit/fp_count_bits.c\
618	tomsfastmath/bit/fp_div_2.c\
619	tomsfastmath/bit/fp_div_2d.c\
620	tomsfastmath/bit/fp_lshd.c\
621	tomsfastmath/bit/fp_mod_2d.c\
622	tomsfastmath/bit/fp_rshd.c\
623	tomsfastmath/divide/fp_div.c\
624	tomsfastmath/divide/fp_div_d.c\
625	tomsfastmath/divide/fp_mod.c\
626	tomsfastmath/divide/fp_mod_d.c\
627	tomsfastmath/exptmod/fp_2expt.c\
628	tomsfastmath/exptmod/fp_exptmod.c\
629	tomsfastmath/misc/fp_ident.c\
630	tomsfastmath/misc/fp_set.c\
631	tomsfastmath/mont/fp_montgomery_calc_normalization.c\
632	tomsfastmath/mont/fp_montgomery_reduce.c\
633	tomsfastmath/mont/fp_montgomery_setup.c\
634	tomsfastmath/mul/fp_mul.c\
635	tomsfastmath/mul/fp_mul_comba.c\
636	tomsfastmath/mul/fp_mul_2.c\
637	tomsfastmath/mul/fp_mul_2d.c\
638	tomsfastmath/mul/fp_mul_comba_12.c\
639	tomsfastmath/mul/fp_mul_comba_17.c\
640	tomsfastmath/mul/fp_mul_comba_20.c\
641	tomsfastmath/mul/fp_mul_comba_24.c\
642	tomsfastmath/mul/fp_mul_comba_28.c\
643	tomsfastmath/mul/fp_mul_comba_3.c\
644	tomsfastmath/mul/fp_mul_comba_32.c\
645	tomsfastmath/mul/fp_mul_comba_4.c\
646	tomsfastmath/mul/fp_mul_comba_48.c\
647	tomsfastmath/mul/fp_mul_comba_6.c\
648	tomsfastmath/mul/fp_mul_comba_64.c\
649	tomsfastmath/mul/fp_mul_comba_7.c\
650	tomsfastmath/mul/fp_mul_comba_8.c\
651	tomsfastmath/mul/fp_mul_comba_9.c\
652	tomsfastmath/mul/fp_mul_comba_small_set.c\
653	tomsfastmath/mul/fp_mul_d.c\
654	tomsfastmath/mul/fp_mulmod.c\
655	tomsfastmath/numtheory/fp_invmod.c\
656	tomsfastmath/sqr/fp_sqr.c\
657	tomsfastmath/sqr/fp_sqr_comba_12.c\
658	tomsfastmath/sqr/fp_sqr_comba_17.c\
659	tomsfastmath/sqr/fp_sqr_comba_20.c\
660	tomsfastmath/sqr/fp_sqr_comba_24.c\
661	tomsfastmath/sqr/fp_sqr_comba_28.c\
662	tomsfastmath/sqr/fp_sqr_comba_3.c\
663	tomsfastmath/sqr/fp_sqr_comba_32.c\
664	tomsfastmath/sqr/fp_sqr_comba_4.c\
665	tomsfastmath/sqr/fp_sqr_comba_48.c\
666	tomsfastmath/sqr/fp_sqr_comba_6.c\
667	tomsfastmath/sqr/fp_sqr_comba_64.c\
668	tomsfastmath/sqr/fp_sqr_comba_7.c\
669	tomsfastmath/sqr/fp_sqr_comba_8.c\
670	tomsfastmath/sqr/fp_sqr_comba_9.c\
671	tomsfastmath/sqr/fp_sqr_comba_generic.c\
672	tomsfastmath/sqr/fp_sqr_comba_small_set.c\
673	tomsfastmath/sqr/fp_sqrmod.c
674
675.PHONY2: version.h.tmp
676version.c: version.h
677version.h: version.h.tmp
678	$(AM_V_GEN) if test -f version.h.static; then\
679		cp version.h.static version.h;\
680	elif ! diff $@ version.h.tmp >/dev/null 2>/dev/null; then\
681		cp version.h.tmp $@;\
682	fi
683
684version.h.tmp:
685	$(AM_V_GEN) test -f version.h || touch version.h;\
686	rm -f $@;\
687	REVISION="$$(LANG=C git --git-dir "$(top_srcdir)"/.git describe --always 2>/dev/null || echo "exported")";\
688	if test "$$REVISION" = "exported"; then\
689	    REVISION="";\
690	fi;\
691	if test -n "$$REVISION"; then\
692		echo "#define REPO_VERSION \"devel-$$REVISION\"" >> $@;\
693	else\
694		touch version.h.tmp;\
695	fi
696
697lib_LTLIBRARIES += libclamav.la
698noinst_LTLIBRARIES = libclamav_internal_utils.la libclamav_nocxx.la
699EXTRA_DIST += regex/engine.c tomsfastmath/sqr/fp_sqr_comba.c tomsfastmath/mul/fp_mul_comba.c libclamav.map libclamav_main.c \
700	     jsparse/generated/operators.h jsparse/generated/keywords.h jsparse/future_reserved_words.list\
701	     jsparse/keywords.list jsparse/special_keywords.list jsparse/operators.gperf version.h.in
702COMMON_CLEANFILES+=version.h version.h.tmp *.gcda *.gcno
703
704BUILT_SOURCES = yara_grammar.h
705
706if MAINTAINER_MODE
707BUILT_SOURCES += jsparse/generated/operators.h jsparse/generated/keywords.h jsparse-keywords.gperf
708
709GPERF_FLAGS=-E -t -L ANSI-C -C -F ', TOK_ERROR' -c
710
711jsparse-keywords.gperf: jsparse/keywords.list jsparse/future_reserved_words.list jsparse/special_keywords.list
712	echo -e "struct keyword { const char *name; int val; };\n%%" >keywords-g-tmp
713	for i in `cat @srcdir@/jsparse/keywords.list`; do j=`echo $$i |tr \[a-z\] \[A-Z\]`; echo "$$i, TOK_$$j" >>keywords-g-tmp; done
714	for i in `cat @srcdir@/jsparse/future_reserved_words.list`; do echo "$$i, TOK_FUTURE_RESERVED_WORD" >>keywords-g-tmp; done
715	cat @srcdir@/jsparse/special_keywords.list >>keywords-g-tmp
716	mv keywords-g-tmp $@
717
718jsparse/generated/operators.h: jsparse/operators.gperf
719	$(GPERF) $(GPERF_FLAGS) -H op_hash -N in_op_set -W oplist $< >operators-tmp-g
720	grep -v '^#line' <operators-tmp-g | sed -e 's/^const struct/static const struct/' -e 's/register //g' >operators-tmp
721	rm operators-tmp-g
722	mv operators-tmp @srcdir@/jsparse/generated/operators.h
723
724jsparse/generated/keywords.h: jsparse-keywords.gperf
725	$(GPERF) $(GPERF_FLAGS) $< >keywords-tmp-g
726	grep -v '^#line' <keywords-tmp-g |  sed -e 's/^const struct/static const struct/' -e 's/register //g' >keywords-tmp
727	rm keywords-tmp-g
728	mv keywords-tmp @srcdir@/jsparse/generated/keywords.h
729
730CLEANFILES=$(COMMON_CLEANFILES) @srcdir@/jsparse/generated/operators.h @srcdir@/jsparse/generated/keywords.h
731else
732CLEANFILES=$(COMMON_CLEANFILES)
733endif
734