summaryrefslogtreecommitdiff
path: root/tests/typedetect/GNUmakefile
blob: 793e11082a86788df6db052e4cfa846f3187d974 (plain)
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
TOPDIR = ../..

SUBDIRS =

#INCLUDE_CXXFLAGS = \
#	-DUSE_MODULELOADER
	
INCLUDE_DIRS = \
	-I$(TOPDIR)/src \
	-I$(TOPDIR)/include/util \
	-I$(TOPDIR)/include/module \
	-I$(TOPDIR)/include/crawler \
	-I$(TOPDIR)/src/modules/typedetect/libmagic \
	-I$(TOPDIR)/src/modules/fetcher/file \
	-I$(TOPDIR)/src/modules/fetcher/libfetch \
	-I$(TOPDIR)/src/modules/urlnormalizer/simpleurl

INCLUDE_LDFLAGS = \
	-L$(TOPDIR)/src/libcrawler \
	-L$(TOPDIR)/src/liblogger \
	-L$(TOPDIR)/libfetch

ifeq ($(WITH_LUA),1)
INCLUDE_LDFLAGS += \
	-L$(TOPDIR)/src/libluaglue \
	-L$(TOPDIR)/src/libutil \
	$(TOLUA_LDFLAGS)
endif

INCLUDE_LIBS = \
	$(TOPDIR)/src/modules/typedetect/libmagic/liblibmagictypedetect.a \
	-lmagic \
	$(TOPDIR)/src/modules/fetcher/file/libfilefetcher.a \
	$(TOPDIR)/src/modules/fetcher/libfetch/liblibfetchfetcher.a \
	-lfetch \
	$(TOPDIR)/src/modules/urlnormalizer/simpleurl/libsimpleurlnormalizer.a \
	-lcrawler \
	-llogger

ifeq ($(WITH_LUA),1)
INCLUDE_LIBS += \
	-lluaglue \
	-lutil \
	-llua \
	$(TOLUA_LIBS)
endif

# openssl
ifeq ($(WITH_SSL),1)

INCLUDE_CFLAGS += \
	-DWITH_SSL

INCLUDE_LIBS += \
	$(OPENSSL_LIBS)
endif

TEST_CPP_BINS = \
	test1$(EXE)

OBJS =

-include $(TOPDIR)/makefiles/gmake/sub.mk

local_all:

local_clean:
	-@rm -f *.RES *.DIFF

local_distclean:

local_test:
	@-echo "Using fetcher 'file'.."
	@-for METHOD in libmagic_typedetect; do \
		echo "Using MIME type detector '$$METHOD'.." ; \
		./exec_test test1 test1 "detect a simple C++ file" $$METHOD file_fetcher file://localhost/`pwd`/test1.cpp ; \
		./exec_test test1 test2 "detect a Msword file" $$METHOD file_fetcher file://localhost/`pwd`/test2.doc ; \
		./exec_test test1 test3 "detect a Excel file" $$METHOD file_fetcher file://localhost/`pwd`/test3.xls ; \
		./exec_test test1 test4 "detect a HTML file" $$METHOD file_fetcher file://localhost/`pwd`/test4.html ; \
		./exec_test test1 test5 "detect a CSS file" $$METHOD file_fetcher file://localhost/`pwd`/test5.css ; \
		./exec_test test1 test6 "detect a Javascript file" $$METHOD file_fetcher file://localhost/`pwd`/test6.js ; \
		./exec_test test1 test7 "detect an XML file" $$METHOD file_fetcher file://localhost/`pwd`/test7.xml ; \
		./exec_test test1 test8 "detect a robots.txt file" $$METHOD file_fetcher file://localhost/`pwd`/test8.txt ; \
		./exec_test test1 test9 "detect a DOCX file" $$METHOD file_fetcher file://localhost/`pwd`/test9.docx ; \
		./exec_test test1 test10 "detect a Libreoffice text file" $$METHOD file_fetcher file://localhost/`pwd`/test10.odt ; \
	done
	@-echo "Using fetcher 'libfetch'"
	@-for METHOD in libmagic_typedetect; do \
		echo "Using MIME type detector '$$METHOD'.." ; \
		./exec_test test1 test100 "detect a HTML file" $$METHOD libfetch_fetcher http://www.andreasbaumann.cc ; \
	done