libclamav/Makefile.am
e3aaff8e
 #
f377e052
 #  Copyright (C) 2002 - 2007 Tomasz Kojm <tkojm@clamav.net>
e3aaff8e
 #
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
 #  the Free Software Foundation; either version 2 of the License, or
 #  (at your option) any later version.
 #
 #  This program is distributed in the hope that it will be useful,
 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #  GNU General Public License for more details.
 #
 #  You should have received a copy of the GNU General Public License
 #  along with this program; if not, write to the Free Software
48b7b4a7
 #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 #  MA 02110-1301, USA.
e3aaff8e
 
f377e052
 SUBDIRS = lzma .
e3aaff8e
 
bb7bd3ab
 AM_CPPFLAGS = -I$(top_srcdir) -I@srcdir@/nsis -I@srcdir@/lzma $(LTDLINCL)
e3aaff8e
 
bb7bd3ab
 lib_LTLIBRARIES =
 EXTRA_DIST =
e3aaff8e
 
bb7bd3ab
 
 if ENABLE_UNRAR
5ed60260
 
33d52089
 AM_CPPFLAGS += -DWARN_DLOPEN_FAIL
5ed60260
 libclamunrar_la_LDFLAGS = @TH_SAFE@ -version-info @LIBCLAMAV_VERSION@ -no-undefined
 
 if VERSIONSCRIPT
 libclamunrar_la_LDFLAGS += -Wl,@VERSIONSCRIPTFLAG@,@top_srcdir@/libclamunrar/libclamunrar.map
 endif
 
 libclamunrar_la_SOURCES = \
 	../libclamunrar/unrar15.c \
 	../libclamunrar/unrar20.h \
 	../libclamunrar/unrar.h \
 	../libclamunrar/unrar15.h \
 	../libclamunrar/unrar.c \
 	../libclamunrar/unrar20.c \
 	../libclamunrar/unrarcmd.h \
 	../libclamunrar/unrarfilter.h \
 	../libclamunrar/unrarppm.c \
 	../libclamunrar/unrarvm.c \
 	../libclamunrar/unrarcmd.c \
 	../libclamunrar/unrarfilter.c \
 	../libclamunrar/unrar.h \
 	../libclamunrar/unrarppm.h \
 	../libclamunrar/unrarvm.h \
 	../libclamunrar/unrarhlp.c \
af84980b
 	../libclamunrar/unrarhlp.h
5ed60260
 
 lib_LTLIBRARIES += libclamunrar.la
 EXTRA_DIST += @top_srcdir@/libclamunrar/libclamunrar.map
 
 
 libclamunrar_iface_la_LIBADD = libclamunrar.la
bb7bd3ab
 libclamunrar_iface_la_LDFLAGS = -module @TH_SAFE@ -version-info @LIBCLAMAV_VERSION@ -no-undefined
 
 if VERSIONSCRIPT
 libclamunrar_iface_la_LDFLAGS += -Wl,@VERSIONSCRIPTFLAG@,@top_srcdir@/libclamunrar_iface/libclamunrar_iface.map
 endif
 
 libclamunrar_iface_la_SOURCES = \
 	../libclamunrar_iface/unrar_iface.c \
 	../libclamunrar_iface/unrar_iface.h
 
 lib_LTLIBRARIES += libclamunrar_iface.la
 EXTRA_DIST += @top_srcdir@/libclamunrar_iface/libclamunrar_iface.map
33d52089
 
 IFACELIBADD = -dlopen libclamunrar_iface.la
 IFACEDEP = libclamunrar_iface.la
bb7bd3ab
 endif
 
b070a1d2
 libclamav_internal_utils_la_SOURCES=str.c\
 				    str.h\
 				    md5.c\
 				    md5.h\
3b053173
 				    others_common.c \
 				    others.h \
 				    regex/strlcpy.c \
 				    regex/regcomp.c \
 				    regex/regerror.c \
 				    regex/regexec.c \
 				    regex/regfree.c \
 				    regex/cclass.h \
 				    regex/cname.h \
 				    regex/regex.h \
 				    regex/regex2.h \
b070a1d2
 				    regex/utils.h
3b053173
 
 libclamav_internal_utils_la_LDFLAGS=-static
 libclamav_internal_utils_la_CFLAGS=  -fPIC -DPIC
bb7bd3ab
 
b070a1d2
 libclamav_internal_utils_nothreads_la_SOURCES=str.c\
 				    str.h\
 				    md5.c\
 				    md5.h\
 				    others_common.c \
 				    others.h \
 				    regex/strlcpy.c \
 				    regex/regcomp.c \
 				    regex/regerror.c \
 				    regex/regexec.c \
 				    regex/regfree.c \
 				    regex/cclass.h \
 				    regex/cname.h \
 				    regex/regex.h \
 				    regex/regex2.h \
 				    regex/utils.h
 
 libclamav_internal_utils_nothreads_la_LDFLAGS=-static
 libclamav_internal_utils_nothreads_la_CFLAGS=-DCL_NOTHREADS
 
02b5f26c
 libclamav_la_LIBADD = @LIBLTDL@ $(IFACELIBADD) lzma/liblzma.la libclamav_internal_utils.la @LIBCLAMAV_LIBS@ @THREAD_LIBS@
ac3eae77
 libclamav_la_DEPENDENCIES =  @LTDLDEPS@ $(IFACEDEP) libclamav_internal_utils.la
cd0a934f
 libclamav_la_CFLAGS = -DSEARCH_LIBDIR=\"$(libdir)\"
02b4b0c7
 libclamav_la_LDFLAGS = @TH_SAFE@ -version-info @LIBCLAMAV_VERSION@ -no-undefined
e3aaff8e
 
097455e1
 if VERSIONSCRIPT
80cf6309
 libclamav_la_LDFLAGS += -Wl,@VERSIONSCRIPTFLAG@,@top_srcdir@/libclamav/libclamav.map
097455e1
 endif
 
e3aaff8e
 include_HEADERS = clamav.h
 
 libclamav_la_SOURCES = \
77e42428
 	clamav.h \
8000d078
         matcher-ac.c \
         matcher-ac.h \
         matcher-bm.c \
         matcher-bm.h \
e3aaff8e
         matcher.c \
         matcher.h \
         others.c \
         others.h \
         readdb.c \
68fb8dd1
 	readdb.h \
43be1fc1
 	cvd.c \
6a2532ca
 	cvd.h \
 	dsig.c \
 	dsig.h \
e3aaff8e
 	scanners.c \
85dd8460
 	scanners.h \
c8f2d060
 	textdet.c \
 	textdet.h \
888f5794
 	filetypes.c \
 	filetypes.h \
7021b545
 	filetypes_int.h \
52c2a8bd
 	rtf.c \
 	rtf.h \
e3aaff8e
 	blob.c \
 	blob.h \
 	mbox.c \
 	mbox.h \
 	message.c \
 	message.h \
 	table.c \
 	table.h \
 	text.c \
47bbbc56
 	text.h \
 	ole2_extract.c \
 	ole2_extract.h \
 	vba_extract.c \
f893c0f3
 	vba_extract.h \
341e5433
 	cltypes.h \
 	msexpand.c \
6307ca15
 	msexpand.h \
 	pe.c \
414abe87
 	pe.h \
4c4651ad
 	disasm.c \
 	disasm.h \
 	disasmpriv.h \
342e27a5
 	upx.c \
888f5794
 	upx.h \
 	htmlnorm.c \
a5373b64
 	htmlnorm.h \
 	chmunpack.c \
85dd8460
 	chmunpack.h \
 	rebuildpe.c \
 	rebuildpe.h \
 	petite.c \
5f1a932b
 	petite.h \
60cd49c9
 	wwunpack.c \
 	wwunpack.h \
81030038
 	unsp.c \
 	unsp.h \
2f73b977
 	aspack.c \
 	aspack.h \
5d048883
 	packlibs.c \
 	packlibs.h \
5f1a932b
 	fsg.c \
1a83f3b9
 	fsg.h \
4aa4a05c
 	mew.c \
 	mew.h \
e8042398
 	upack.c \
 	upack.h \
1a83f3b9
 	line.c \
2b259453
 	line.h \
 	untar.c \
c3a3be2d
 	untar.h \
f133da7a
 	unzip.c \
 	unzip.h \
f377e052
 	inflate64.c \
 	inflate64.h \
 	inffixed64.h \
 	inflate64_priv.h \
c3a3be2d
 	special.c \
0f5e1958
 	special.h \
 	binhex.c \
a7f5fd00
 	binhex.h \
 	is_tar.c \
f0bc32bd
 	is_tar.h \
 	tnef.c \
478ce4b2
 	tnef.h \
ed93f138
 	autoit.c \
 	autoit.h \
9d96e4b6
 	unarj.c \
 	unarj.h \
faaf436a
 	nsis/bzlib.c \
 	nsis/bzlib_private.h \
 	nsis/nsis_bzlib.h \
 	nsis/nulsft.c \
 	nsis/nulsft.h \
84f4e2bb
 	nsis/infblock.c \
8a65cd5a
 	nsis/nsis_zconf.h \
 	nsis/nsis_zlib.h \
 	nsis/nsis_zutil.h \
798308de
 	pdf.c \
c2dfe70e
 	pdf.h \
 	spin.c \
094116b2
 	spin.h \
822930fc
 	yc.c \
 	yc.h \
094116b2
 	elf.c \
01302683
 	elf.h \
bf45bf13
 	execs.h \
 	sis.c \
3953039b
 	sis.h \
 	uuencode.c \
bb03e766
 	uuencode.h \
bd912dd8
 	phishcheck.c \
 	phishcheck.h \
 	phish_domaincheck_db.c \
 	phish_domaincheck_db.h \
 	phish_whitelist.c \
 	phish_whitelist.h \
b6927a7c
 	iana_cctld.h \
0a1fef4f
 	iana_tld.h \
bd912dd8
 	regex_list.c \
5b68299b
 	regex_list.h \
5ee56e41
 	regex_suffix.c \
 	regex_suffix.h \
24fd05e1
 	mspack.c \
 	mspack.h \
 	cab.c \
3506ac49
 	cab.h \
 	entconv.c \
 	entconv.h \
 	entitylist.h \
 	encoding_aliases.h \
 	hashtab.c \
bc93eda0
 	hashtab.h \
 	dconf.c \
06646acf
 	dconf.h \
f377e052
 	lzma_iface.c \
f8be651b
 	lzma_iface.h \
 	explode.c \
3064a542
 	explode.h \
 	textnorm.c \
a6e38800
 	textnorm.h \
 	dlp.c \
fd08e02e
 	dlp.h \
 	jsparse/js-norm.c \
 	jsparse/js-norm.h \
4a6ade44
 	jsparse/lexglobal.h \
937ade08
 	jsparse/textbuf.h \
 	uniq.c \
04f9bedf
 	uniq.h \
a5f0eabf
 	version.c\
885c2bf5
 	version.h\
 	mpool.c\
589d8d8e
 	mpool.h \
4e46d65d
 	default.h\
 	sha256.c\
b070a1d2
 	sha256.h\
 	bignum.h
 
 if !LINK_TOMMATH
 libclamav_la_SOURCES += bignum.c \
 		     bignum_class.h
 endif
04f9bedf
 
 .PHONY: version.h.tmp
a391afb9
 version.c: version.h
04f9bedf
 version.h: version.h.tmp
add738d2
 	@if test -f version.h.static; then\
 		cp version.h.static version.h;\
 	elif ! diff $@ version.h.tmp >/dev/null 2>/dev/null; then\
 		cp version.h.tmp $@;\
04f9bedf
 	fi
 
 version.h.tmp:
a5f0eabf
 	@test -f version.h || touch version.h;\
 	rm -f $@;\
04f9bedf
 	REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)";\
 	if test $$REVISION = "exported"; then\
1d60f70d
 		REVISION="$$(LANG=C cd "$(top_srcdir)"; git svn info configure 2>/dev/null| awk '/Revision:/ { print $$2 }' || echo)";\
add738d2
 		if test -n "$$REVISION"; then\
1d60f70d
 			REVISION="$$REVISION-$$(LANG=C cd "$(top_srcdir)"; git describe --always 2>/dev/null)";\
04f9bedf
 		fi;\
 	fi;\
add738d2
 	if test -n "$$REVISION"; then\
 		echo "#define REPO_VERSION \"devel-r$$REVISION\"" >> $@;\
 	else\
 		touch version.h.tmp;\
 	fi
097455e1
 
bb7bd3ab
 lib_LTLIBRARIES += libclamav.la
b070a1d2
 noinst_LTLIBRARIES = libclamav_internal_utils.la libclamav_internal_utils_nothreads.la
bb7bd3ab
 EXTRA_DIST += regex/engine.c libclamav.map \
4a6ade44
 	     jsparse/generated/operators.h jsparse/generated/keywords.h jsparse/future_reserved_words.list\
 	     jsparse/keywords.list jsparse/special_keywords.list jsparse/operators.gperf
dfc0c031
 COMMON_CLEANFILES=version.h version.h.tmp *.gcda *.gcno lzma/*.gcda lzma/*.gcno
fd08e02e
 if MAINTAINER_MODE
 BUILT_SOURCES=jsparse/generated/operators.h jsparse/generated/keywords.h jsparse-keywords.gperf
 
 GPERF_FLAGS=-E -t -L ANSI-C -C -F ', TOK_ERROR' -c
 
 jsparse-keywords.gperf: jsparse/keywords.list jsparse/future_reserved_words.list jsparse/special_keywords.list
 	echo -e "struct keyword { const char *name; int val; };\n%%" >keywords-g-tmp
 	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
 	for i in `cat @srcdir@/jsparse/future_reserved_words.list`; do echo "$$i, TOK_FUTURE_RESERVED_WORD" >>keywords-g-tmp; done
 	cat @srcdir@/jsparse/special_keywords.list >>keywords-g-tmp
 	mv keywords-g-tmp $@
 
 jsparse/generated/operators.h: jsparse/operators.gperf
 	$(GPERF) $(GPERF_FLAGS) -H op_hash -N in_op_set -W oplist $< >operators-tmp-g
 	grep -v '^#line' <operators-tmp-g | sed -e 's/^const struct/static const struct/' -e 's/register //g' >operators-tmp
 	rm operators-tmp-g
 	mv operators-tmp @srcdir@/jsparse/generated/operators.h
 
 jsparse/generated/keywords.h: jsparse-keywords.gperf
 	$(GPERF) $(GPERF_FLAGS) $< >keywords-tmp-g
 	grep -v '^#line' <keywords-tmp-g |  sed -e 's/^const struct/static const struct/' -e 's/register //g' >keywords-tmp
 	rm keywords-tmp-g
 	mv keywords-tmp @srcdir@/jsparse/generated/keywords.h
 
dfc0c031
 CLEANFILES=$(COMMON_CLEANFILES) @srcdir@/jsparse/generated/operators.h @srcdir@/jsparse/generated/keywords.h
04f9bedf
 else
dfc0c031
 CLEANFILES=$(COMMON_CLEANFILES)
fd08e02e
 endif