summaryrefslogtreecommitdiff
path: root/makefiles
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-08-10 14:44:17 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-08-10 14:44:17 +0200
commit4a6b24a567142317a24a98d2ab998f5093a581cc (patch)
tree522107a269c040e69b933fc9f69fe330703562b5 /makefiles
parent9fe78b708868dcb5bdbfc88ed96dee18c6f1f6b3 (diff)
downloadcrawler-4a6b24a567142317a24a98d2ab998f5093a581cc.tar.gz
crawler-4a6b24a567142317a24a98d2ab998f5093a581cc.tar.bz2
first porting attempts to Windows:
nmake support from Wolframe module loader adapted tests for typeinfo and template trickery
Diffstat (limited to 'makefiles')
-rw-r--r--makefiles/nmake/clean.mk40
-rw-r--r--makefiles/nmake/compiler.mk93
-rwxr-xr-xmakefiles/nmake/config.mk65
-rw-r--r--makefiles/nmake/doc.mk18
-rw-r--r--makefiles/nmake/dochelp.mk6
-rwxr-xr-xmakefiles/nmake/help.mk50
-rwxr-xr-xmakefiles/nmake/platform.mk27
-rw-r--r--makefiles/nmake/sub.mk28
-rw-r--r--makefiles/nmake/top.mk35
9 files changed, 362 insertions, 0 deletions
diff --git a/makefiles/nmake/clean.mk b/makefiles/nmake/clean.mk
new file mode 100644
index 0000000..6019e56
--- /dev/null
+++ b/makefiles/nmake/clean.mk
@@ -0,0 +1,40 @@
+# cleans up directories
+#
+# requires:
+# - SUBDIRS: for recursive cleaning
+# - local_clean, local_distclean targets in local GNUmakefile
+# - all artifacts to clean (the rest is cleaned with wildcards):
+# - OBJS, DLL_OBJS
+#
+# provides:
+# - target: clean
+# - target: distclean
+
+clean_recursive:
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 clean & cd ..
+
+clean: clean_recursive local_clean
+ -@erase *.bak 2>NUL
+ -@erase *~ 2>NUL
+ -@erase *.d 2>NUL
+ -@erase *.exe 2>NUL
+ -@erase *.exe.manifest 2>NUL
+ -@erase *.obj 2>NUL
+ -@erase $(OBJS) 2>NUL
+ -@erase *.pdb 2>NUL
+ -@erase *.rc 2>NUL
+ -@erase *.res 2>NUL
+ -@erase MSG*.bin 2>NUL
+ -@erase *.dllobj 2>NUL
+ -@erase *.dll 2>NUL
+ -@erase *.lib 2>NUL
+ -@erase $(DLL_OBJS) 2>NUL
+ -@erase *.exp 2>NUL
+ -@erase *.ilk 2>NUL
+ -@erase *.idb 2>NUL
+ -@erase *.manifest 2>NUL
+
+distclean_recursive:
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 distclean & cd ..
+
+distclean: distclean_recursive local_distclean clean
diff --git a/makefiles/nmake/compiler.mk b/makefiles/nmake/compiler.mk
new file mode 100644
index 0000000..f4461de
--- /dev/null
+++ b/makefiles/nmake/compiler.mk
@@ -0,0 +1,93 @@
+# sets compiler settings
+#
+# requires:
+# - INCLUDE_DIRS: directories searched for includes (/I)
+# - INCLUDE_CFLAGS: specific compilation flags (C)
+# - INCLUDE_CXXFLAGS: specific compilation flags (C++)
+# - INCLUDE_LDFLAGS: library flags like like link location (/L)
+# - INCLUDE_LIBS: additional libraries to link against (e.g. advapi32.dll)
+# provides:
+# - generic implicit rules for compilation/linking
+#
+
+# TODO: which flags to enable?
+# /nologo: disable MS disclaimer
+# /EHsc: enable C++ exception handling
+# /Ox: optimize what you can
+# /Zi: enable debug information
+# /MD: multithreaded runtime
+# /W <n>: show warnings (level 1 to 4)
+# /Wp64: warn about possible 64-bit issues
+# using /W2 for now, /W3 shows lots of problems
+# in boost/asio/openssl (size_t -> int conversion)
+# /Wp64 breaks Qt and SSL
+# /Wall: enable all warnings (produces tons of warnings!)
+# /WX: treat warnings as errors
+
+# compilation flags and compilers (release)
+!IFNDEF DEBUG
+COMMON_COMPILE_FLAGS = /MD /W2 /WX /nologo /O2 /EHsc /c $(INCLUDE_DIRS)
+!ENDIF
+
+# compilation flags and compilers (debug)
+!IFDEF DEBUG
+COMMON_COMPILE_FLAGS = /MDd /Zi /W2 /WX /nologo /O2 /EHsc /c $(INCLUDE_DIRS)
+!ENDIF
+
+COMPILE_FLAGS = $(COMMON_COMPILE_FLAGS)
+
+CXX_COMPILE_FLAGS = $(COMMON_COMPILE_FLAGS) /EHsc
+
+CFLAGS = $(COMPILE_FLAGS) $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_CFLAGS) $(DEBUGLEVELFLAGS)
+CXXFLAGS = $(CXX_COMPILE_FLAGS) $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_CXXFLAGS) $(DEBUGLEVELFLAGS)
+CC = cl.exe
+CXX = cl.exe
+MC = mc.exe
+MT = mt.exe
+RC = rc.exe
+
+# linking flags (release)
+!IFNDEF DEBUG
+LDFLAGS = /nologo /manifest $(INCLUDE_LDFLAGS)
+STATIC_LDFLAGS = /nologo $(INCLUDE_LDFLAGS)
+!ENDIF
+
+# linking flags (debug)
+!IFDEF DEBUG
+LDFLAGS = /nologo /manifest /debug $(INCLUDE_LDFLAGS)
+STATIC_LDFLAGS = /nologo $(INCLUDE_LDFLAGS)
+!ENDIF
+
+LIBS = $(INCLUDE_LIBS)
+LINK = link.exe
+CXX_LINK = link.exe
+
+.SUFFIXES: .c .cpp .cc .obj .exe .mc .rc .res
+
+.c.obj:
+ $(CC) $(CFLAGS) /Fo$@ $<
+
+.cpp.obj:
+ $(CXX) $(CXXFLAGS) /Fo$@ $<
+
+.cc.obj:
+ $(CXX) $(CXXFLAGS) /Fo$@ $<
+
+.c.dllobj:
+ $(CC) $(CFLAGS) /D "BUILD_SHARED" /Fo$@ $<
+
+.cpp.dllobj:
+ $(CXX) $(CXXFLAGS) /D "BUILD_SHARED" /Fo$@ $<
+
+.cc.dllobj:
+ $(CXX) $(CXXFLAGS) /D "BUILD_SHARED" /Fo$@ $<
+
+.obj.exe:
+ $(CXX_LINK) $(LDFLAGS) $(LIBS) /out:$@ $(OBJS) $**
+ $(MT) -nologo -manifest $@.manifest -outputresource:$@;1
+
+.mc.rc:
+ "$(MC)" -h $(@D) -r $(@D) $<
+
+.rc.res:
+ $(RC) $<
diff --git a/makefiles/nmake/config.mk b/makefiles/nmake/config.mk
new file mode 100755
index 0000000..a3d0484
--- /dev/null
+++ b/makefiles/nmake/config.mk
@@ -0,0 +1,65 @@
+# Configuration supposed to be configured here by the user
+#
+# must configure:
+#
+# optionally:
+# - OPENSSL_DIR: location of the OpenSSL library (WITH_SSL=1 only)
+# - PGSQL_DIR: location of Postgres libpq and header files (WITH_PGSQL=1 only)
+
+# please customize
+
+# OpenSSL (http://www.slproweb.com/products/Win32OpenSSL.html)
+##############################################################
+
+OPENSSL_DIR = C:\OpenSSL\openssl-1.0.1-win32-debug
+
+# Postgresql libpq
+# (http://www.postgresql.org/)
+##############################
+
+PGSQL_DIR = C:\cygwin\home\Andreas Baumann\postgresql-9.1.3-win32-debug
+
+# enable depending on libintl.dll and libiconv.dll (deployment only)
+PGDLL_WITHOUT_MAJOR_VERSION = 1
+
+# libxml2
+#########
+
+LIBXML2_DIR = C:\cygwin\home\Andreas Baumann\libxml2-2.7.8-win32-debug
+
+# libxslt
+#########
+
+LIBXSLT_DIR = C:\cygwin\home\Andreas Baumann\libxslt-1.1.26-win32-debug
+
+# Windows Installer (WIX)
+# used for deployment only!
+#########################
+
+WIX_DIR = C:\Program Files\Windows Installer XML v3.5
+
+#WIX_LIBS = dutil_2008.lib wcautil_2008.lib
+WIX_LIBS = dutil_2008_x64.lib wcautil_2008_x64.lib
+
+# architecture of resulting msi
+#WIX_ARCH = x86
+WIX_ARCH = x64
+
+#PGDLL_LIBRARIES=1
+
+#PGDLL_WITHOUT_MAJOR_VERSION=1
+
+# DocBook and Stylesheets
+#########################
+
+XSLT_HTMLHELP_STYLESHEET = C:\cygwin\home\Andreas Baumann\docbook-xsl-1.76.1\htmlhelp\htmlhelp.xsl
+
+# Doxygen binary to generate API documentation (for docu and deployment)
+########################################################################
+
+DOXYGEN = C:\Program Files\Doxygen\bin\doxygen.exe
+
+# Microsoft HTML Help Workshop (for documentation building and deployment)
+##########################################################################
+
+HHC_LOCATION = C:\Program Files\HTML Help Workshop\hhc.exe
diff --git a/makefiles/nmake/doc.mk b/makefiles/nmake/doc.mk
new file mode 100644
index 0000000..bd9ee2d
--- /dev/null
+++ b/makefiles/nmake/doc.mk
@@ -0,0 +1,18 @@
+# makefile for a sub package
+#
+# requires:
+# - TOPDIR
+#
+# provides:
+# - target: help
+
+!INCLUDE $(TOPDIR)\makefiles\nmake\platform.mk
+
+all: local_all
+
+test: local_test
+
+clean: local_clean
+
+help:
+ @more $(TOPDIR)\makefiles\nmake\dochelp.mk
diff --git a/makefiles/nmake/dochelp.mk b/makefiles/nmake/dochelp.mk
new file mode 100644
index 0000000..d578117
--- /dev/null
+++ b/makefiles/nmake/dochelp.mk
@@ -0,0 +1,6 @@
+
+Available targets:
+
+make doc create all documentation (except man pages and epub)
+make doc-doxygen build CHM version of doxygen documentation
+make doc-htmlhelp build CHM version of the Wolframe documentation
diff --git a/makefiles/nmake/help.mk b/makefiles/nmake/help.mk
new file mode 100755
index 0000000..f2bdf8f
--- /dev/null
+++ b/makefiles/nmake/help.mk
@@ -0,0 +1,50 @@
+
+Available targets:
+
+nmake [all] create all artifacts
+nmake test create test binaries and execute tests and execute
+ fast tests
+nmake longtest execute all tests, including long lasting ones
+nmake doc build the documentation
+nmake clean clean up build artifacts
+nmake distclean clean up all generated artifacts
+nmake help show this very help page
+
+Available optional features:
+
+WITH_SSL=1 use OpenSSL additionally for communication encryption
+
+frontier implementations:
+
+WITH_SYSTEM_SQLITE3=1 use the system version of sqlite3
+WITH_LOCAL_SQLITE=1 use the bundled version of sqlite3
+WITH_PGSQL=1 build the Postgresql frontier
+
+fetcher protocol implementations:
+
+WITH_SYSTEM_LIBFETCH=1 use the system version of BSD libfetch
+WITH_LOCAL_LIBFETCH=1 use the bundled version of BSD libfetch
+
+parser implementations:
+
+WITH_LOCAL_STREAMHTMLPARSER=1 use Google stream HTML 4 parser
+
+WITH_LIBXML2=1 build the libxml2 parser
+
+URL parsing and normalization:
+
+WITH_LOCAL_GOOGLEURL=1 use Google URL for normalization/parsing
+WITH_ICU=1 enable ICU support for URL parsing in Google URL
+
+scripting support:
+
+WITH_LUA=1 use Lua for configuration and scripting
+
+Avaliable optional features during testing only:
+
+DEBUG=1 build using debug compiler and linker flags
+
+Example:
+nmake /nologo /f Makefile.W32 WITH_SSL=1 WITH_SQLITE3=1 WITH_PGSQL=1
+ WITH_LOCAL_LIBFETCH=1 WITH_LIBXML2=1 WITH_LOCAL_GOOGLEURL=1
+ WITH_ICU=1 WITH_LUA=1
diff --git a/makefiles/nmake/platform.mk b/makefiles/nmake/platform.mk
new file mode 100755
index 0000000..3a04b36
--- /dev/null
+++ b/makefiles/nmake/platform.mk
@@ -0,0 +1,27 @@
+# Sets Windows specific variables
+#
+# provides:
+# - OPENSSL_LIBS: libraries to link against for SSL/TLS support
+
+!INCLUDE $(TOPDIR)\makefiles\nmake\config.mk
+
+# OpenSSL
+#########
+
+!IFDEF WITH_SSL
+OPENSSL_LIBS = libeay32.lib ssleay32.lib
+!ENDIF
+
+# WIX Microsoft Installer (for deployment)
+##########################################
+
+CANDLE = "$(WIX_DIR)\bin\candle.exe"
+LIGHT = "$(WIX_DIR)\bin\light.exe"
+LIT = "$(WIX_DIR)\bin\lit.exe"
+SMOKE = "$(WIX_DIR)\bin\smoke.exe"
+SETUPBLD = "$(WIX_DIR)\bin\setupbld.exe"
+
+# XSLT processor
+################
+
+XSLTPROC = $(LIBXSLT_DIR)\bin\xsltproc.exe
diff --git a/makefiles/nmake/sub.mk b/makefiles/nmake/sub.mk
new file mode 100644
index 0000000..056031d
--- /dev/null
+++ b/makefiles/nmake/sub.mk
@@ -0,0 +1,28 @@
+# makefile for a sub package
+#
+# requires:
+# - TOPDIR
+# - SUBDIRS
+# - INCLUDE_DIRS
+#
+# provides:
+# - target: all
+# - target 'test'
+# - target 'longtest'
+# indirectly (via clean.mk):
+# - target 'clean'
+# - target 'distclean'
+
+!INCLUDE $(TOPDIR)\makefiles\nmake\platform.mk
+!INCLUDE $(TOPDIR)\makefiles\nmake\compiler.mk
+
+all: local_all
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 all & cd ..
+
+test: $(OBJS) $(TEST_OBJS) $(CPPOBJS) $(BIN_OBJS) $(BINS) $(CPP_BINS) $(TEST_BIN_OBJS) $(TEST_BINS) $(TEST_CPP_BINS) local_test
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 test & cd ..
+
+longtest: $(OBJS) $(TEST_OBJS) $(CPPOBJS) $(BIN_OBJS) $(BINS) $(CPP_BINS) $(TEST_BIN_OBJS) $(TEST_BINS) $(TEST_CPP_BINS) local_test
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 longtest & cd ..
+
+!INCLUDE $(TOPDIR)\makefiles\nmake\clean.mk
diff --git a/makefiles/nmake/top.mk b/makefiles/nmake/top.mk
new file mode 100644
index 0000000..f31c040
--- /dev/null
+++ b/makefiles/nmake/top.mk
@@ -0,0 +1,35 @@
+# top-level makefile for a package
+#
+# requires:
+# - TOPDIR
+# - SUBDIRS
+#
+# provides:
+# - target 'all'
+# - target 'clean'
+# - target 'distclean'
+# - target 'test'
+# - target 'longtest'
+# - target 'doc'
+# - target 'help'
+
+all:
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 all & cd ..
+
+clean:
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 clean & cd ..
+
+distclean:
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 distclean & cd ..
+
+test: all
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 test & cd ..
+
+longtest: test
+ @if not "$(SUBDIRS)" == "" @for %%d IN ( $(SUBDIRS) ) do @cd %%d & $(MAKE) /nologo /f Makefile.w32 longtest & cd ..
+
+doc:
+ @cd docs & $(MAKE) /nologo /f Makefile.W32 doc
+
+help:
+ @type makefiles\nmake\help.mk