--- /dev/null
+# Makefile for rrdtool using Microsoft (Visual) C\r
+#\r
+# Usage:\r
+# nmake -f win32/Makefile_vcpkg.msc (for 32 bit Windows target)\r
+# nmake -f win32/Makefile_vcpkg.msc USE_64BIT=1 (for 64 bit Windows target)\r
+# nmake -f win32/Makefile_vcpkg.msc clean (to remove all generated files)\r
+\r
+# The toplevel directory of the source tree\r
+#\r
+TOP = .\r
+RRD_LIB_NAME=librrd-4\r
+ARCH_PATH_X86=vcpkg\installed\x86-windows\r
+ARCH_PATH_X64=vcpkg\installed\x64-windows\r
+\r
+\r
+!ifndef USE_64BIT\r
+LD_FLAGS=/RELEASE /MACHINE:X86\r
+ARCH_PATH=$(ARCH_PATH_X86)\r
+CPPFLAGS = /arch:SSE2\r
+!else\r
+LD_FLAGS=/RELEASE /MACHINE:X64\r
+ARCH_PATH=$(ARCH_PATH_X64)\r
+!endif\r
+\r
+CPPFLAGS = $(CPPFLAGS) /TC /EHsc /O2 /Zi /Fd$(TOP)/win32/vc.pdb \\r
+ /I $(TOP)/win32 /I $(TOP)/src \\r
+ /I $(ARCH_PATH)\include \\r
+ /I $(ARCH_PATH)\include\cairo \\r
+ /I $(ARCH_PATH)\include\pango-1.0 \\r
+ /I $(ARCH_PATH)\include\glib-2.0 \\r
+ /I $(ARCH_PATH)\lib\glib-2.0\include \\r
+ /I $(ARCH_PATH)\include\libxml2\r
+\r
+THIRD_PARTY_LIB = /LIBPATH:$(ARCH_PATH)\lib \\r
+ libpng16.lib libxml2.lib \\r
+ glib-2.0.lib gobject-2.0.lib \\r
+ pango-1.0.lib pangocairo-1.0.lib cairo.lib \\r
+ Ws2_32.lib zlib.lib\r
+\r
+RRD_LIB_OBJ_LIST = \\r
+ $(TOP)/src/hash_32.obj \\r
+ $(TOP)/src/mkstemp.obj \\r
+ $(TOP)/src/mutex.obj \\r
+ $(TOP)/src/optparse.obj \\r
+ $(TOP)/src/plbasename.obj \\r
+ $(TOP)/src/pngsize.obj \\r
+ $(TOP)/src/quicksort.obj \\r
+ $(TOP)/src/rrd_client.obj \\r
+ $(TOP)/src/rrd_create.obj \\r
+ $(TOP)/src/rrd_diff.obj \\r
+ $(TOP)/src/rrd_dump.obj \\r
+ $(TOP)/src/rrd_error.obj \\r
+ $(TOP)/src/rrd_fetch.obj \\r
+ $(TOP)/src/rrd_fetch_cb.obj \\r
+ $(TOP)/src/rrd_first.obj \\r
+ $(TOP)/src/rrd_flushcached.obj \\r
+ $(TOP)/src/rrd_format.obj \\r
+ $(TOP)/src/rrd_gfx.obj \\r
+ $(TOP)/src/rrd_graph.obj \\r
+ $(TOP)/src/rrd_graph_helper.obj \\r
+ $(TOP)/src/rrd_hw.obj \\r
+ $(TOP)/src/rrd_hw_math.obj \\r
+ $(TOP)/src/rrd_hw_update.obj \\r
+ $(TOP)/src/rrd_info.obj \\r
+ $(TOP)/src/rrd_last.obj \\r
+ $(TOP)/src/rrd_lastupdate.obj \\r
+ $(TOP)/src/rrd_list.obj \\r
+ $(TOP)/src/rrd_modify.obj \\r
+ $(TOP)/src/rrd_nan_inf.obj \\r
+ $(TOP)/src/rrd_open.obj \\r
+ $(TOP)/src/rrd_parsetime.obj \\r
+ $(TOP)/src/rrd_resize.obj \\r
+ $(TOP)/src/rrd_restore.obj \\r
+ $(TOP)/src/rrd_rpncalc.obj \\r
+ $(TOP)/src/rrd_snprintf.obj \\r
+ $(TOP)/src/rrd_strtod.obj \\r
+ $(TOP)/src/rrd_thread_safe_nt.obj \\r
+ $(TOP)/src/rrd_tune.obj \\r
+ $(TOP)/src/rrd_update.obj \\r
+ $(TOP)/src/rrd_utils.obj \\r
+ $(TOP)/src/rrd_version.obj \\r
+ $(TOP)/src/rrd_xport.obj \\r
+ $(TOP)/win32/asprintf.obj \\r
+ $(TOP)/win32/vasprintf-msvc.obj \\r
+ $(TOP)/win32/win32-glob.obj\r
+# win32comp.obj is not added to RRD_LIB_OBJ_LIST, because definitions are already in rrd_thread_safe_nt.obj\r
+\r
+all: $(TOP)/win32/$(RRD_LIB_NAME).dll $(TOP)/win32/rrdtool.exe \\r
+ $(TOP)/win32/rrdupdate.exe $(TOP)/win32/rrdcgi.exe\r
+\r
+clean:\r
+ -@del /F /Q $(TOP)\src\*.obj 2>NUL\r
+ -@del /F /Q $(TOP)\win32\*.obj 2>NUL\r
+ -@del /F /Q $(TOP)\win32\*.res 2>NUL\r
+ -@del /F /Q $(TOP)\win32\*.exe 2>NUL\r
+ -@del /F /Q $(TOP)\win32\*.pdb 2>NUL\r
+ -@del /F /Q $(TOP)\win32\$(RRD_LIB_NAME).dll 2>NUL\r
+ -@del /F /Q $(TOP)\win32\$(RRD_LIB_NAME).exp 2>NUL\r
+ -@del /F /Q $(TOP)\win32\$(RRD_LIB_NAME).lib 2>NUL\r
+\r
+$(TOP)/win32/$(RRD_LIB_NAME).dll $(TOP)/win32/$(RRD_LIB_NAME).lib: \\r
+ $(TOP)/win32/$(RRD_LIB_NAME).def $(TOP)/win32/$(RRD_LIB_NAME).res \\r
+ $(RRD_LIB_OBJ_LIST)\r
+ cl /nologo /MD /LD /Zi /Fe$(TOP)/win32/$(RRD_LIB_NAME).dll \\r
+ /Fd$(TOP)/win32/$(RRD_LIB_NAME).pdb \\r
+ $(TOP)/win32/$(RRD_LIB_NAME).def $(TOP)/win32/$(RRD_LIB_NAME).res \\r
+ $(RRD_LIB_OBJ_LIST) /link $(THIRD_PARTY_LIB) $(LD_FLAGS)\r
+\r
+$(TOP)/win32/rrdtool.exe: $(TOP)/win32/rrdtool.res $(TOP)/src/rrd_tool.obj \\r
+ $(TOP)/win32/$(RRD_LIB_NAME).lib\r
+ cl /nologo /MD /Zi /Fe$@ $(TOP)/win32/rrdtool.res $(TOP)/src/rrd_tool.obj \\r
+ $(TOP)/win32/$(RRD_LIB_NAME).lib /link $(LD_FLAGS)\r
+#Just waiting for antivirus program to finished check tasks\r
+ -@ping 1.1.1.1 -n 1 -w 1000 > NUL\r
+ -mt -manifest $(TOP)/win32/uac.manifest -outputresource:$(TOP)/win32/rrdtool.exe;#1\r
+\r
+$(TOP)/win32/rrdupdate.exe: $(TOP)/win32/rrdupdate.res $(TOP)/src/rrdupdate.obj \\r
+ $(TOP)/src/plbasename.obj $(TOP)/win32/$(RRD_LIB_NAME).lib\r
+ cl /nologo /MD /Zi /Fe$@ $(TOP)/win32/rrdupdate.res $(TOP)/src/rrdupdate.obj \\r
+ $(TOP)/src/plbasename.obj $(TOP)/win32/$(RRD_LIB_NAME).lib /link $(LD_FLAGS)\r
+#Just waiting for antivirus program to finished check tasks\r
+ -@ping 1.1.1.1 -n 1 -w 1000 > NUL\r
+ -mt -manifest $(TOP)/win32/uac.manifest -outputresource:$(TOP)/win32/rrdupdate.exe;#1\r
+\r
+$(TOP)/win32/rrdcgi.exe: $(TOP)/win32/rrdcgi.res $(TOP)/src/rrd_cgi.obj \\r
+ $(TOP)/src/optparse.obj \\r
+ $(TOP)/win32/$(RRD_LIB_NAME).lib\r
+ cl /nologo /MD /Zi /Fe$@ $(TOP)/win32/rrdcgi.res $(TOP)/src/rrd_cgi.obj \\r
+ $(TOP)/src/optparse.obj \\r
+ $(TOP)/win32/$(RRD_LIB_NAME).lib /link $(LD_FLAGS)\r
+#Just waiting for antivirus program to finished check tasks\r
+ -@ping 1.1.1.1 -n 1 -w 1000 > NUL\r
+ -mt -manifest $(TOP)/win32/uac.manifest -outputresource:$(TOP)/win32/rrdcgi.exe;#1\r
+\r
+{$(TOP)/src}.c{$(TOP)/src}.obj:\r
+ cl /nologo /MD /DWIN32 /c $(CPPFLAGS) /Fo$@ $<\r
+\r
+{$(TOP)/win32}.rc{$(TOP)/win32}.res:\r
+ rc /nologo /I./src /fo$@ $<\r
+\r
+{$(TOP)/win32}.c{$(TOP)/win32}.obj:\r
+ cl /nologo /MD /DWIN32 /c $(CPPFLAGS) /Fo$@ $<\r
-Win32 Build Instructions:\r
+Win32 Build Instructions (using nmake Makefile):\r
\r
1) See build-rrdtool.dot (build-rrdtool.svg or build-rrdtool.pdf) for build\r
dependency.\r
\r
-2) If you do not want to build the build-dependencies, you can download prebuilt\r
- versions from the following address:\r
+2) An efficient way, to obtain up-to-date build-dependencies, is using vcpkg.\r
+ Install the headers and libraries the following way into the vcpkg directory:\r
+ .\vcpkg install cairo expat fontconfig freetype gettext glib libpng libxml2 pango pcre zlib --triplet x86-windows\r
+ .\vcpkg install cairo expat fontconfig freetype gettext glib libpng libxml2 pango pcre zlib --triplet x64-windows\r
+\r
+ If you do not want to build the build-dependencies, you can download prebuilt\r
+ (but in the meantime outdated) versions from the following address:\r
\r
32bit dependencies should then be extracted into the contrib directory:\r
http://ftp.gnome.org/pub/gnome/binaries/win32/\r
from the following address:\r
http://msinttypes.googlecode.com/svn/trunk/stdint.h\r
\r
-4) Adjust the include path, library path, and library names which in the\r
- Makefile.msc, to correspond with your local path or names.\r
+4) Adjust the include path, library path, and library names found in\r
+ Makefile_vcpkg.msc or Makefile.msc, to correspond to your local path or names.\r
+\r
+5) Run 'nmake -f win32\Makefile_vcpkg.msc' for 32 bit Windows target,\r
+ Run 'nmake -f win32\Makefile_vcpkg.msc USE_64BIT=1' for 64 bit Windows target.\r
+ Run 'nmake -f win32\Makefile_vcpkg.msc clean' to remove all generated files.\r
\r
-5) Run 'nmake -f win32\Makefile.msc' for 32 bit Windows target,\r
- Run 'nmake -f win32\Makefile.msc USE_64BIT=1' for 64 bit Windows target.\r
- Run 'nmake -f win32\Makefile.msc clean' to remove all generated files.\r
+ If you use headers and libraries in the contrib or the contrib-x64 folder,\r
+ use Makefile.msc instead of Makefile_vcpkg.msc in the three commands above.\r
\r
6) librrd-4.dll, librrd-4.lib, rrdtool.exe, rrdupdate.exe, rrdcgi.exe, and\r
these corresponding pdb files will be located in the win32 directory.\r