SHELL=/bin/sh #-------------------------------- makefile help ------------------------------------------ #target: pre-requisites #comand #comand # #target is normally the name of the resultant file #target:: = phony target #pre-requisites are necessary files for this step # \ to continue lines #-------------------------------- Unused Components ------------------------------------------ # 6-CURL #INCLUDE_CURL= #LINKER_CURL=-lcurl -L/usr/kerberos/lib -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv -ldl -lz -lssl -lcrypto # 3-Soap (using GLib & libxml2) #INCLUDE_SOUP=-I/usr/local/include/soup-0.7.10 #INCLUDE_GLIB=-I/home/anewholm/installation/glib/glib-2.4.7 -I/home/anewholm/installation/glib/glib-2.4.7/glib ##INCLUDE_GLIB= -I/usr/local/include/glib-2.0/ -I/usr/local/include/glib-2.0/glib/ #INCLUDE_XML=-I/usr/include/libxml2 ##various libxml libraries exist (libxml2.so, libxml2.so.2.5.4) having SegFaults so... #LINKER_LIBXML=/usr/lib/libxml2.so.2.5.4 #LINKER_SOUP=/usr/lib/libsoup.so.3.3.4 # 7-regex #INCLUDE_REGEX=-I/usr/include/regex #LINKER_REGEX=-lcppre #-------------------------------- Components ------------------------------------------ # 1-GRETA regex is static included # 2-WordNet (explicitly linked from /usr/local) INCLUDE_WORDNET=-I/usr/local/WordNet-2.0/include LINKER_WORDNET=-L/usr/local/WordNet-2.0/lib -lwn # 4-Threading LINKER_THREADS=-lpthread # 5-PostGres INCLUDE_PGSQL=-I/usr/local/pgsql/include/ LINKER_PGSQL=/usr/lib/libpq.so.3 # 8-PDFtoHTML INCLUDE_PDF2HTML= LINKER_PDF2HTML=-lpdftohtml #-------------------------------- macros ------------------------------------------ #macros # MACROS=-D_DEBUG INCLUDE_DIRS=$(INCLUDE_WORDNET) $(INCLUDE_PGSQL) LINKER_DIRS= $(LINKER_WORDNET) $(LINKER_PGSQL) $(LINKER_THREADS) $(LINKER_PDF2HTML) # O3 turns on inline functions (-finline-functions) which is good for GRETA (can run out of stack space otherwise) # REMEMBER to rm *.o to re-compile the GRETA functionality with inline function optimisation # -foptimize-sibling-calls -finline-functions -fno-stack-limit # -foverloaded-virtual -fctor-dtor-privacy -fnon-virtual-dtor (not found in 3.2.2!) # -fno-rtti (RTTI required by GRETA) # -fstack-check (causes segmentation fault) OPTIMIZATION=-O3 -finline-functions # MISCFLAGS=-ggdb WARNINGS= ALLFLAGS=$(MACROS) $(OPTIMIZATION) $(MISCFLAGS) $(WARNINGS) #object files #HTProfil.o/lo not included because it doesn't seem to be able to link to the symbols from the file #despite using readelf -s HTProfil.o to check them OBJECTS_CUSTOM=Spider.o SpiderManager.o ResourceUseEventSink.o \ StringMap.o debug.o Streams.o extensions.o FilterGroup.o md5.o \ InternetResource.o InternetURIRequest.o HTMLPage.o XMLPage.o JavaScript.o PDF.o \ Database.o PostGresDatabase.o XMLHTTPDatabase.o TIPsDatabase.o \ Protocol.o HTTP.o FTP.o HTTPS.o \ Domain.o DomainConnection.o WebServer.o ReportCommand.o InputOutput.o \ Report.o Report_Full.o Report_Index.o Report_DomainSummary.o Report_Summary.o Report_Repeaters.o \ HTMLTagStore.o HTMLAttribute.o HTMLEntity.o HTMLTag.o ContentType.o \ DBObject.o DBEntity.o Summary.o Article.o Company.o Country.o Person.o Product.o ProductType.o \ Parser.o HTMLParser.o HTMLGeneralParser.o HTMLArticleParser.o HTMLObjectParser.o PDFParser.o ParseRule.o OBJECTS_EXTERNAL=regexpr2.o syntax2.o OBJECTS=$(OBJECTS_CUSTOM) $(OBJECTS_EXTERNAL) #-------------------------------- main ------------------------------------------ #linking $(OBJECTS) is the list of requirements before link will be attempted all: $(OBJECTS) g++ $(ALLFLAGS) -o Spider $(INCLUDE_DIRS) main.cpp $(OBJECTS) $(LINKER_DIRS) #compile .cpp.o: $*.cpp g++ $(ALLFLAGS) -c $*.cpp $(INCLUDE_DIRS) clear: rm $(OBJECTS_CUSTOM)