[libgxps/wip/nacho/visibility: 2/7] Add nmake scripts to build with MSVC



commit 9e866ff47fd62110575934f4c7d3e9452c49e49b
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date:   Fri Sep 9 11:41:07 2016 +0200

    Add nmake scripts to build with MSVC
    
    This is the first version of the script that builds only
    the main code. In upcoming patches I will add support
    for the conditional libraries.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771057

 Makefile.am                 |    4 +-
 configure.ac                |    1 +
 nmake/Makefile.am           |   11 ++++
 nmake/Makefile.vc           |   42 +++++++++++++
 nmake/README.txt            |   43 ++++++++++++++
 nmake/build-rules-msvc.mak  |   72 +++++++++++++++++++++++
 nmake/config-msvc.mak       |   45 ++++++++++++++
 nmake/create-lists-msvc.mak |   64 ++++++++++++++++++++
 nmake/create-lists.bat      |   42 +++++++++++++
 nmake/detectenv-msvc.mak    |  136 +++++++++++++++++++++++++++++++++++++++++++
 nmake/generate-msvc.mak     |    8 +++
 nmake/info-msvc.mak         |   55 +++++++++++++++++
 nmake/install.mak           |   11 ++++
 13 files changed, 532 insertions(+), 2 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index fe792ca..c1fe740 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = libgxps tools
+SUBDIRS = libgxps tools nmake
 
 if ENABLE_TEST
 SUBDIRS += test
@@ -54,4 +54,4 @@ ChangeLog:
          echo A git checkout and git log is required to generate this file >> $@); \
        fi
 
-.PHONY: ChangeLog
\ No newline at end of file
+.PHONY: ChangeLog
diff --git a/configure.ac b/configure.ac
index 7adc4a7..8d7a033 100644
--- a/configure.ac
+++ b/configure.ac
@@ -289,6 +289,7 @@ docs/Makefile
 docs/reference/Makefile
 docs/reference/version.xml
 docs/tools/Makefile
+nmake/Makefile
 ])
 
 AC_OUTPUT
diff --git a/nmake/Makefile.am b/nmake/Makefile.am
new file mode 100644
index 0000000..0f8a578
--- /dev/null
+++ b/nmake/Makefile.am
@@ -0,0 +1,11 @@
+EXTRA_DIST = \
+       build-rules-msvc.mak \
+       config-msvc.mak \
+       create-lists.bat \
+       create-lists-msvc.mak \
+       detectenv-msvc.mak \
+       generate-msvc.mak \
+       info-msvc.mak \
+       install.mak \
+       Makefile.vc \
+       README.txt
diff --git a/nmake/Makefile.vc b/nmake/Makefile.vc
new file mode 100644
index 0000000..98e1a60
--- /dev/null
+++ b/nmake/Makefile.vc
@@ -0,0 +1,42 @@
+# NMake Makefile for building GXPS as a DLL on Windows
+
+# The items below this line should not be changed, unless one is maintaining
+# the NMake Makefiles.  Customizations can be done in the following NMake Makefile
+# portions (please see comments in the these files to see what can be customized):
+#
+# detectenv-msvc.mak
+# config-msvc.mak
+
+!include detectenv-msvc.mak
+
+# Include the Makefile portions with the source listings
+!include ..\libgxps\Makefile.sources
+
+# Include the Makefile portion that enables features based on user input
+!include config-msvc.mak
+
+!if "$(VALID_CFGSET)" == "TRUE"
+
+# Include the Makefile portion to convert the source and header lists
+# into the lists we need for compilation and introspection
+!include create-lists-msvc.mak
+
+all: $(GXPS_LIBS) $(EXTRA_TARGETS) all-build-info
+
+tests: all $(GXPS_TESTS)
+
+# Include the build rules for sources, DLLs and executables
+!include build-rules-msvc.mak
+
+# Include the rules for build directory creation and code generation
+!include generate-msvc.mak
+
+!include install.mak
+
+!else
+all: help
+       @echo You need to specify a valid configuration, via
+       @echo CFG=release or CFG=debug
+!endif
+
+!include info-msvc.mak
diff --git a/nmake/README.txt b/nmake/README.txt
new file mode 100644
index 0000000..689baae
--- /dev/null
+++ b/nmake/README.txt
@@ -0,0 +1,43 @@
+Instructions for building GXPS on Visual Studio
+===================================================
+Building the GXPS DLL on Windows is now also supported using Visual Studio
+versions 2008 through 2015, in both 32-bit and 64-bit (x64) flavors, via NMake
+Makefiles.
+
+The following are instructions for performing such a build, as there is a
+number of build configurations supported for the build.  Note that for all
+build configurations, the OpenType and Simple TrueType layout (fallback)
+backends are enabled, as well as the Uniscribe platform shaper, and this
+is the base configuration that is built if no options (see below) are
+specified.  A 'clean' target is provided-it is recommended that one cleans
+the build and redo the build if any configuration option changed.  An
+'install' target is also provided to copy the built items in their appropriate
+locations under $(PREFIX), which is described below.
+
+Invoke the build by issuing the command:
+nmake /f Makefile.vc CFG=[release|debug] [PREFIX=...] <option1=1 option2=1 ...>
+where:
+
+CFG: Required.  Choose from a release or debug build.  Note that 
+     all builds generate a .pdb file for each .dll and .exe built--this refers
+     to the C/C++ runtime that the build uses.
+
+PREFIX: Optional.  Base directory of where the third-party headers, libraries
+        and needed tools can be found, i.e. headers in $(PREFIX)\include,
+        libraries in $(PREFIX)\lib and tools in $(PREFIX)\bin.  If not
+        specified, $(PREFIX) is set as $(srcroot)\..\vs$(X)\$(platform), where
+        $(platform) is win32 for 32-bit builds or x64 for 64-bit builds, and
+        $(X) is the short version of the Visual Studio used, as follows:
+        2008: 9
+        2010: 10
+        2012: 11
+        2013: 12
+        2015: 14
+
+Explanation of options, set by <option>=1:
+------------------------------------------
+PYTHON: Full path to the Python interpretor to be used, if it is not in %PATH%.
+
+PERL: Full path to the PERL interpretor to be used, if it is not in %PATH%.
+
+LIBTOOL_DLL_NAME: Enable libtool-style DLL names.
diff --git a/nmake/build-rules-msvc.mak b/nmake/build-rules-msvc.mak
new file mode 100644
index 0000000..3b95565
--- /dev/null
+++ b/nmake/build-rules-msvc.mak
@@ -0,0 +1,72 @@
+# NMake Makefile portion for compilation rules
+# Items in here should not need to be edited unless
+# one is maintaining the NMake build files.  The format
+# of NMake Makefiles here are different from the GNU
+# Makefiles.  Please see the comments about these formats.
+
+# Inference rules for compiling the .obj files.
+# Used for libs and programs with more than a single source file.
+# Format is as follows
+# (all dirs must have a trailing '\'):
+#
+# {$(srcdir)}.$(srcext){$(destdir)}.obj::
+#      $(CC)|$(CXX) $(cflags) /Fo$(destdir) /c @<<
+# $<
+# <<
+{..\libgxps\}.c{$(CFG)\$(PLAT)\gxps\}.obj::
+       $(CXX) $(CFLAGS) $(GXPS_DEFINES) $(GXPS_LIB_CFLAGS) /Fo$(CFG)\$(PLAT)\gxps\ /c @<<
+$<
+<<
+
+# Inference rules for building the test programs
+# Used for programs with a single source file.
+# Format is as follows
+# (all dirs must have a trailing '\'):
+#
+# {$(srcdir)}.$(srcext){$(destdir)}.exe::
+#      $(CC)|$(CXX) $(cflags) $< /Fo$*.obj  /Fe$@ [/link $(linker_flags) $(dep_libs)]
+{..\tests\}.c{$(CFG)\$(PLAT)\}.exe:
+       $(CXX) $(CFLAGS) $(GXPS_DEFINES) $(GXPS_CFLAGS) /DSRCDIR="\"../../../tests\"" $< /Fo$*.obj /Fe$@ 
/link $(LDFLAGS) $(CFG)\$(PLAT)\gxps.lib $(GXPS_TESTS_DEP_LIBS)
+
+# Rules for building .lib files
+$(CFG)\$(PLAT)\gxps.lib: $(GXPS_DLL_FILENAME).dll
+
+# Rules for linking DLLs
+# Format is as follows (the mt command is needed for MSVC 2005/2008 builds):
+# $(dll_name_with_path): $(dependent_libs_files_objects_and_items)
+#      link /DLL [$(linker_flags)] [$(dependent_libs)] [/def:$(def_file_if_used)] 
[/implib:$(lib_name_if_needed)] -out:$@ @<<
+# $(dependent_objects)
+# <<
+#      @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
+$(GXPS_DLL_FILENAME).dll: $(gxps_dll_OBJS) $(CFG)\$(PLAT)\gxps
+       link /DLL $(LDFLAGS) $(GXPS_DEP_LIBS) /implib:$(CFG)\$(PLAT)\gxps.lib -out:$@ @<<
+$(gxps_dll_OBJS)
+<<
+       @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
+
+# Rules for linking Executables
+# Format is as follows (the mt command is needed for MSVC 2005/2008 builds):
+# $(dll_name_with_path): $(dependent_libs_files_objects_and_items)
+#      link [$(linker_flags)] [$(dependent_libs)] -out:$@ @<<
+# $(dependent_objects)
+# <<
+#      @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
+
+
+# Other .obj files requiring individual attention, that could not be covered by the inference rules.
+# Format is as follows (all dirs must have a trailing '\'):
+#
+# $(obj_file):
+#      $(CC)|$(CXX) $(cflags) /Fo$(obj_destdir) /c @<<
+# $(srcfile)
+# <<
+
+clean:
+       @-del /f /q $(CFG)\$(PLAT)\*.pdb
+       @-del /f /q $(CFG)\$(PLAT)\*.dll.manifest
+       @-del /f /q $(CFG)\$(PLAT)\*.dll
+       @-del /f /q $(CFG)\$(PLAT)\*.ilk
+       @-del /f /q $(CFG)\$(PLAT)\*.obj
+       @-del /f /q $(CFG)\$(PLAT)\gxps\*.obj
+       @-rmdir /s /q $(CFG)\$(PLAT)
+       @-del vc$(VSVER)0.pdb
diff --git a/nmake/config-msvc.mak b/nmake/config-msvc.mak
new file mode 100644
index 0000000..977d75f
--- /dev/null
+++ b/nmake/config-msvc.mak
@@ -0,0 +1,45 @@
+# NMake Makefile portion for enabling features for Windows builds
+
+# GLib is required for all utility programs and tests
+GXPS_MAIN_LIBS = gio-2.0.lib gobject-2.0.lib glib-2.0.lib cairo.lib archive.lib freetype.lib
+
+# Please do not change anything beneath this line unless maintaining the NMake Makefiles
+# Bare minimum features and sources built into GXPS on Windows
+GXPS_DEFINES = /DGXPS_COMPILATION
+
+GXPS_CFLAGS = \
+       /FImsvc_recommended_pragmas.h \
+       /I$(PREFIX)\include\glib-2.0 \
+       /I$(PREFIX)\include\gio-win32-2.0 \
+       /I$(PREFIX)\include\cairo \
+       /I$(PREFIX)\lib\glib-2.0\include
+
+GXPS_SOURCES = \
+       $(GXPS_BASE_SOURCES) \
+       $(GXPS_BASE_NOINST_H_FILES)
+
+GXPS_HEADERS = \
+       $(GXPS_BASE_INST_H_FILES)
+
+# Minimal set of (system) libraries needed for the GXPS DLL
+GXPS_DEP_LIBS = user32.lib Advapi32.lib $(GXPS_MAIN_LIBS)
+
+# We build the GXPS DLL/LIB at least
+GXPS_LIBS = $(CFG)\$(PLAT)\gxps.lib
+
+# Note: All the utility and test programs require GLib support to be present!
+GXPS_TESTS =
+GXPS_TESTS_DEP_LIBS = $(GXPS_MAIN_LIBS)
+
+# Use libtool-style DLL names, if desired
+!if "$(LIBTOOL_DLL_NAME)" == "1"
+GXPS_DLL_FILENAME = $(CFG)\$(PLAT)\libgxps-0
+!else
+GXPS_DLL_FILENAME = $(CFG)\$(PLAT)\gxps-vs$(VSVER)
+!endif
+
+EXTRA_TARGETS =
+
+GXPS_TESTS =
+
+GXPS_LIB_CFLAGS = $(GXPS_CFLAGS) /D_GXPS_EXTERN="__declspec (dllexport) extern"
diff --git a/nmake/create-lists-msvc.mak b/nmake/create-lists-msvc.mak
new file mode 100644
index 0000000..6bd33e6
--- /dev/null
+++ b/nmake/create-lists-msvc.mak
@@ -0,0 +1,64 @@
+# Convert the source listing to object (.obj) listing in
+# another NMake Makefile module, include it, and clean it up.
+# This is a "fact-of-life" regarding NMake Makefiles...
+# This file does not need to be changed unless one is maintaining the NMake Makefiles
+
+# For those wanting to add things here:
+# To add a list, do the following:
+# # $(description_of_list)
+# if [call create-lists.bat header $(makefile_snippet_file) $(variable_name)]
+# endif
+#
+# if [call create-lists.bat file $(makefile_snippet_file) $(file_name)]
+# endif
+#
+# if [call create-lists.bat footer $(makefile_snippet_file)]
+# endif
+# ... (repeat the if [call ...] lines in the above order if needed)
+# !include $(makefile_snippet_file)
+#
+# (add the following after checking the entries in $(makefile_snippet_file) is correct)
+# (the batch script appends to $(makefile_snippet_file), you will need to clear the file unless the 
following line is added)
+#!if [del /f /q $(makefile_snippet_file)]
+#!endif
+
+# In order to obtain the .obj filename that is needed for NMake Makefiles to build DLLs/static LIBs or EXEs, 
do the following
+# instead when doing 'if [call create-lists.bat file $(makefile_snippet_file) $(file_name)]'
+# (repeat if there are multiple $(srcext)'s in $(source_list), ignore any headers):
+# !if [for %c in ($(source_list)) do @if "%~xc" == ".$(srcext)" @call create-lists.bat file 
$(makefile_snippet_file) $(intdir)\%~nc.obj]
+#
+# $(intdir)\%~nc.obj needs to correspond to the rules added in build-rules-msvc.mak
+# %~xc gives the file extension of a given file, %c in this case, so if %c is a.cc, %~xc means .cc
+# %~nc gives the file name of a given file without extension, %c in this case, so if %c is a.cc, %~nc means a
+
+NULL=
+
+# For GXPS
+!if [call create-lists.bat header gxps_objs.mak gxps_dll_OBJS]
+!endif
+
+!if [for %c in ($(GXPS_SOURCES)) do @if "%~xc" == ".c" @call create-lists.bat file gxps_objs.mak 
^$(CFG)\^$(PLAT)\gxps\%~nc.obj]
+!endif
+
+!if [call create-lists.bat footer gxps_objs.mak]
+!endif
+
+!include gxps_objs.mak
+
+!if [del /f /q gxps_objs.mak]
+!endif
+
+# Gather the list of headers
+!if [call create-lists.bat header gxps_srcs.mak GXPS_ACTUAL_HEADERS]
+!endif
+
+!if [for %h in ($(GXPS_HEADERS)) do @call create-lists.bat file gxps_srcs.mak ..\libgxps\%h]
+!endif
+
+!if [call create-lists.bat footer gxps_srcs.mak]
+!endif
+
+!include gxps_srcs.mak
+
+!if [del /f /q gxps_srcs.mak]
+!endif
diff --git a/nmake/create-lists.bat b/nmake/create-lists.bat
new file mode 100644
index 0000000..ef60d5c
--- /dev/null
+++ b/nmake/create-lists.bat
@@ -0,0 +1,42 @@
+@echo off
+rem Simple .bat script for creating the NMake Makefile snippets.
+
+if not "%1" == "header" if not "%1" == "file" if not "%1" == "footer" goto :error_cmd
+if "%2" == "" goto error_no_destfile
+
+if "%1" == "header" goto :header
+if "%1" == "file" goto :addfile
+if "%1" == "footer" goto :footer
+
+:header
+if "%3" == "" goto error_var
+echo %3 =      \>>%2
+goto done
+
+:addfile
+if "%3" == "" goto error_file
+echo.  %3      \>>%2
+goto done
+
+:footer
+echo.  $(NULL)>>%2
+echo.>>%2
+goto done
+
+:error_cmd
+echo Specified command '%1' was invalid.  Valid commands are: header file footer.
+goto done
+
+:error_no_destfile
+echo Destination NMake snippet file must be specified
+goto done
+
+:error_var
+echo A name must be specified for using '%1'.
+goto done
+
+:error_file
+echo A file must be specified for using '%1'.
+goto done
+
+:done
\ No newline at end of file
diff --git a/nmake/detectenv-msvc.mak b/nmake/detectenv-msvc.mak
new file mode 100644
index 0000000..a94ab84
--- /dev/null
+++ b/nmake/detectenv-msvc.mak
@@ -0,0 +1,136 @@
+# Change this (or specify PREFIX= when invoking this NMake Makefile) if
+# necessary, so that the libs and headers of the dependent third-party
+# libraries can be located.  For instance, if building from GLib's
+# included Visual Studio projects, this should be able to locate the GLib
+# build out-of-the-box if they were not moved.  GLib's headers will be
+# found in $(GLIB_PREFIX)\include\glib-2.0 and
+# $(GLIB_PREFIX)\lib\glib-2.0\include and its import library will be found
+# in $(GLIB_PREFIX)\lib.
+
+!if "$(PREFIX)" == ""
+PREFIX = ..\..\vs$(VSVER)\$(PLAT)
+!endif
+
+# Location of the PERL interpretor, for running glib-mkenums.  glib-mkenums
+# needs to be found in $(PREFIX)\bin.  Using either a 32-bit or x64 PERL
+# interpretor are supported for either a 32-bit or x64 build.
+
+!if "$(PERL)" == ""
+PERL = perl
+!endif
+
+# Location of the Python interpretor, for building introspection.  The complete set
+# of Python Modules for introspection (the giscanner Python scripts and the _giscanner.pyd
+# compiled module) needs to be found in $(PREFIX)\lib\gobject-introspection\giscanner, and
+# the g-ir-scanner Python script and g-ir-compiler utility program needs to be found
+# in $(PREFIX)\bin, together with any DLLs they will depend on, if those DLLs are not already
+# in your PATH.
+# Note that the Python interpretor and the introspection modules and utility progam must
+# correspond to the build type (i.e. 32-bit Release for 32-bit Release builds, and so on).
+#
+# For introspection, currently only Python 2.7.x is supported.  This may change when Python 3.x
+# support is added upstream in gobject-introspection--when this happens, the _giscanner.pyd must
+# be the one that is built against the release series of Python that is used here.
+
+!if "$(PYTHON)" == ""
+PYTHON = python
+!endif
+
+# Location of the pkg-config utility program, for building introspection.  It needs to be able
+# to find the pkg-config (.pc) files so that the correct libraries and headers for the needed libraries
+# can be located, using PKG_CONFIG_PATH.  Using either a 32-bit or x64 pkg-config are supported for
+# either a 32-bit or x64 build.
+
+!if "$(PKG_CONFIG)" == ""
+PKG_CONFIG = pkg-config
+!endif
+
+# The items below this line should not be changed, unless one is maintaining
+# the NMake Makefiles.  The exception is for the CFLAGS_ADD line(s) where one
+# could use his/her desired compiler optimization flags, if he/she knows what is
+# being done.
+
+# Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or
+# VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir)
+!if !defined(VCINSTALLDIR) && !defined(WINDOWSSDKDIR)
+MSG = ^
+This Makefile is only for Visual Studio 2008 and later.^
+You need to ensure that the Visual Studio Environment is properly set up^
+before running this Makefile.
+!error $(MSG)
+!endif
+
+ERRNUL  = 2>NUL
+_HASH=^#
+
+!if ![echo VCVERSION=_MSC_VER > vercl.x] \
+    && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \
+    && ![echo PLAT=Win32 >> vercl.x] \
+    && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \
+    && ![echo PLAT=x64 >> vercl.x] \
+    && ![echo $(_HASH)endif >> vercl.x] \
+    && ![cl -nologo -TC -P vercl.x $(ERRNUL)]
+!include vercl.i
+!if ![echo VCVER= ^\> vercl.vc] \
+    && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc]
+!include vercl.vc
+!endif
+!endif
+!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc]
+!endif
+
+!if $(VCVERSION) > 1499 && $(VCVERSION) < 1600
+VSVER = 9
+!elseif $(VCVERSION) > 1599 && $(VCVERSION) < 1700
+VSVER = 10
+!elseif $(VCVERSION) > 1699 && $(VCVERSION) < 1800
+VSVER = 11
+!elseif $(VCVERSION) > 1799 && $(VCVERSION) < 1900
+VSVER = 12
+!elseif $(VCVERSION) > 1899 && $(VCVERSION) < 2000
+VSVER = 14
+!else
+VSVER = 0
+!endif
+
+!if "$(VSVER)" == "0"
+MSG = ^
+This NMake Makefile set supports Visual Studio^
+9 (2008) through 14 (2015).  Your Visual Studio^
+version is not supported.
+!error $(MSG)
+!endif
+
+VALID_CFGSET = FALSE
+!if "$(CFG)" == "release" || "$(CFG)" == "debug"
+VALID_CFGSET = TRUE
+!endif
+
+# One may change these items, but be sure to test
+# the resulting binaries
+!if "$(CFG)" == "release"
+CFLAGS_ADD = /MD /O2 /GL /MP
+!if "$(VSVER)" != "9"
+CFLAGS_ADD = $(CFLAGS_ADD) /d2Zi+
+!endif
+!else
+CFLAGS_ADD = /MDd /Od
+!endif
+
+!if "$(PLAT)" == "x64"
+LDFLAGS_ARCH = /machine:x64
+!else
+LDFLAGS_ARCH = /machine:x86
+!endif
+
+!if "$(VALID_CFGSET)" == "TRUE"
+CFLAGS = $(CFLAGS_ADD) /W3 /Zi /I.. /I..\src /I. /I$(PREFIX)\include
+
+LDFLAGS_BASE = $(LDFLAGS_ARCH) /libpath:$(PREFIX)\lib /DEBUG
+
+!if "$(CFG)" == "debug"
+LDFLAGS = $(LDFLAGS_BASE)
+!else
+LDFLAGS = $(LDFLAGS_BASE) /opt:ref /LTCG
+!endif
+!endif
diff --git a/nmake/generate-msvc.mak b/nmake/generate-msvc.mak
new file mode 100644
index 0000000..ff18efb
--- /dev/null
+++ b/nmake/generate-msvc.mak
@@ -0,0 +1,8 @@
+# NMake Makefile portion for code generation and
+# intermediate build directory creation
+# Items in here should not need to be edited unless
+# one is maintaining the NMake build files.
+
+# Create the build directories
+$(CFG)\$(PLAT)\gxps:
+       @-mkdir $@
diff --git a/nmake/info-msvc.mak b/nmake/info-msvc.mak
new file mode 100644
index 0000000..66b1bf5
--- /dev/null
+++ b/nmake/info-msvc.mak
@@ -0,0 +1,55 @@
+# NMake Makefile portion for displaying config info
+
+INC_FEATURES =
+BUILT_TOOLS =
+BUILT_LIBRARIES = GXPS
+
+build-info-gxps:
+       @echo.
+       @echo ==================================
+       @echo Configuration for GXPS Library
+       @echo ==================================
+
+all-build-info: build-info-gxps
+       @echo.
+       @echo ----------------
+       @echo Other build info
+       @echo ----------------
+       @echo Built Libraries: $(BUILT_LIBRARIES)
+       @echo Built Tools: $(BUILT_TOOLS)
+
+help:
+       @echo.
+       @echo =============================
+       @echo Building GXPS Using NMake
+       @echo =============================
+       @echo nmake /f Makefile.vc CFG=[release^|debug] ^<PREFIX=PATH^> OPTION=1 ...
+       @echo.
+       @echo Where:
+       @echo ------
+       @echo CFG: Required, use CFG=release for an optimized build and CFG=debug
+       @echo for a debug build.  PDB files are generated for all builds.
+       @echo.
+       @echo PREFIX: Optional, the path where dependent libraries and tools may be
+       @echo found, default is ^$(srcrootdir)\..\vs^$(short_vs_ver)\^$(platform),
+       @echo where ^$(short_vs_ver) is 9 for VS 2008, 10 for VS 2010 and so on; and
+       @echo ^$(platform) is Win32 for 32-bit builds and x64 for x64 builds.
+       @echo.
+       @echo LIBTOOL_DLL_NAME:
+       @echo Use a libtool-style DLL name to mimic the DLL file naming generated by
+       @echo MinGW builds.
+       @echo.
+       @echo Note that GLib2 support is required for all utility and test programs.
+       @echo ======
+       @echo A 'clean' target is supported to remove all generated files, intermediate
+       @echo object files and binaries for the specified configuration.
+       @echo.
+       @echo A 'tests' target is supported to build the test programs, if GLib2 support
+       @echo is enabled.  Use after building the libraries and utilities.
+       @echo.
+       @echo An 'install' target is supported to copy the build (DLLs, utility programs,
+       @echo LIBs, along with the introspection files if applicable) to appropriate
+       @echo locations under ^$(PREFIX).
+       @echo ======
+       @echo.
+       
diff --git a/nmake/install.mak b/nmake/install.mak
new file mode 100644
index 0000000..3cb24ad
--- /dev/null
+++ b/nmake/install.mak
@@ -0,0 +1,11 @@
+# NMake Makefile snippet for copying the built libraries, utilities and headers to
+# a path under $(PREFIX).
+
+install: all
+       @if not exist $(PREFIX)\bin\ mkdir $(PREFIX)\bin
+       @if not exist $(PREFIX)\lib\ mkdir $(PREFIX)\lib
+       @if not exist $(PREFIX)\include\libgxps\ mkdir $(PREFIX)\include\libgxps
+       @copy /b $(GXPS_DLL_FILENAME).dll $(PREFIX)\bin
+       @copy /b $(GXPS_DLL_FILENAME).pdb $(PREFIX)\bin
+       @copy /b $(CFG)\$(PLAT)\gxps.lib $(PREFIX)\lib
+       @for %h in ($(GXPS_ACTUAL_HEADERS)) do @copy %h $(PREFIX)\include\libgxps


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]