[libpeas/msvc: 11/12] build: Add a set of NMake Makefiles



commit a5c901cbb462755e7c78ee23c6f8ff924f868aae
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Oct 15 17:34:11 2018 +0800

    build: Add a set of NMake Makefiles
    
    This adds a set of NMake Makefiles that can be used to build libpeas
    (libpeas, libpeas-gtk, the loaders if applicable and the introspection
    files) with the peas-demo demo program.

 configure.ac                      |   1 +
 win32/Makefile.am                 |  15 +++
 win32/Makefile.vc                 |  57 +++++++++
 win32/build-rules-msvc.mak        | 263 ++++++++++++++++++++++++++++++++++++++
 win32/config-msvc.mak             | 147 +++++++++++++++++++++
 win32/configpy.py                 |  31 +++++
 win32/create-lists-msvc.mak       | 141 ++++++++++++++++++++
 win32/create-lists.bat            |  42 ++++++
 win32/detectenv-msvc.mak          | 138 ++++++++++++++++++++
 win32/generate-msvc.mak           |  60 +++++++++
 win32/info-msvc.mak               |  63 +++++++++
 win32/introspection-msvc.mak      |  94 ++++++++++++++
 win32/luaconfig.mak               |  19 +++
 win32/peas-introspection-msvc.mak |  79 ++++++++++++
 win32/pythonconfig.mak            | 117 +++++++++++++++++
 15 files changed, 1267 insertions(+)
---
diff --git a/configure.ac b/configure.ac
index 07d68b7..bdd76e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -574,6 +574,7 @@ tests/plugins/has-dep/Makefile
 tests/plugins/loadable/Makefile
 tests/plugins/self-dep/Makefile
 tests/testing-util/Makefile
+win32/Makefile
 win32/config.h.win32
 ])
 
diff --git a/win32/Makefile.am b/win32/Makefile.am
new file mode 100644
index 0000000..de2830d
--- /dev/null
+++ b/win32/Makefile.am
@@ -0,0 +1,15 @@
+EXTRA_DIST =   \
+       build-rules-msvc.mak    \
+       config.h.win32  \
+       configpy.py     \
+       config-msvc.mak \
+       create-lists.bat        \
+       create-lists-msvc.mak   \
+       detectenv-msvc.mak      \
+       generate-msvc.mak       \
+       info-msvc.mak   \
+       introspection-msvc.mak  \
+       luaconfig.mak   \
+       Makefile.vc     \
+       pythonconfig.mak        \
+       peas-introspection-msvc.mak
diff --git a/win32/Makefile.vc b/win32/Makefile.vc
new file mode 100644
index 0000000..dbb583a
--- /dev/null
+++ b/win32/Makefile.vc
@@ -0,0 +1,57 @@
+# NMake Makefile for building HarfBuzz 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 pythonconfig.mak
+!include detectenv-msvc.mak
+
+# Include the Makefile portions with the source listings
+!include ..\libpeas\peas-sources.mak
+!include ..\libpeas-gtk\peas-gtk-sources.mak
+!include ..\loaders\python\python-loader-sources.mak
+!include ..\loaders\lua5.1\lua-loader-srcs.mak
+!include ..\peas-demo\peas-demo-srcs.mak
+!include ..\peas-demo\plugins\helloworld\demo-helloworld-srcs.mak
+!include ..\peas-demo\plugins\secondtime\demo-secondtime-srcs.mak
+
+# Include the Makefile portion that enables features based on user input
+!include config-msvc.mak
+
+!if "$(VALID_CFGSET)" == "TRUE"
+
+!if "$(INTROSPECTION)" == "1"
+INTROSPECTION_ITEMS = Peas-1.0.gir Peas-1.0.typelib PeasGtk-1.0.gir PeasGtk-1.0.typelib
+!else
+INTROSPECTION_ITEMS =
+!endif
+
+# 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: $(PEAS_LIBS) $(PEAS_LOADERS) $(INTROSPECTION_ITEMS) $(PEAS_DEMOS) all-build-info
+
+tests: all $(HB_TESTS)
+
+!include peas-introspection-msvc.mak
+
+# 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/win32/build-rules-msvc.mak b/win32/build-rules-msvc.mak
new file mode 100644
index 0000000..3eae655
--- /dev/null
+++ b/win32/build-rules-msvc.mak
@@ -0,0 +1,263 @@
+# 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 @<<
+# $<
+# <<
+{..\libpeas\}.c{$(CFG)\$(PLAT)\peas\}.obj::
+       $(CC) $(CFLAGS) $(PEAS_LIB_DEFINES) $(PEAS_CFLAGS) /Fo$(CFG)\$(PLAT)\peas\ /c @<<
+$<
+<<
+
+{$(CFG)\$(PLAT)\peas\}.c{$(CFG)\$(PLAT)\peas\}.obj::
+       $(CC) $(CFLAGS) $(PEAS_LIB_DEFINES) $(PEAS_CFLAGS) /Fo$(CFG)\$(PLAT)\peas\ /c @<<
+$<
+<<
+
+{..\libpeas-gtk\}.c{$(CFG)\$(PLAT)\peas-gtk\}.obj::
+       $(CC) $(CFLAGS) $(PEAS_LIB_DEFINES) $(PEAS_GTK_CFLAGS) /Fo$(CFG)\$(PLAT)\peas-gtk\ /c @<<
+$<
+<<
+
+{..\loaders\python\}.c{$(CFG)\$(PLAT)\loaders-py\}.obj::
+       $(CC) $(CFLAGS) $(PEAS_DEFINES) $(PYTHON_LOADER_CFLAGS) /Fo$(CFG)\$(PLAT)\loaders-py\ /c @<<
+$<
+<<
+
+{..\loaders\python3\}.c{$(CFG)\$(PLAT)\loaders-py3\}.obj::
+       $(CC) $(CFLAGS) $(PEAS_DEFINES) $(PYTHON3_LOADER_CFLAGS) /Fo$(CFG)\$(PLAT)\loaders-py3\ /c @<<
+$<
+<<
+
+{..\loaders\python\}.c{$(CFG)\$(PLAT)\loaders-py3\}.obj::
+       $(CC) $(CFLAGS) $(PEAS_DEFINES) $(PYTHON3_LOADER_CFLAGS) /Fo$(CFG)\$(PLAT)\loaders-py3\ /c @<<
+$<
+<<
+
+{..\loaders\lua5.1\}.c{$(CFG)\$(PLAT)\loaders-lua\}.obj::
+       $(CC) $(CFLAGS) $(LUA_CFLAGS) /Fo$(CFG)\$(PLAT)\loaders-lua\ /c @<<
+$<
+<<
+
+{$(CFG)\$(PLAT)\loaders-py\}.c{$(CFG)\$(PLAT)\loaders-py\}.obj::
+       $(CC) $(CFLAGS) $(PYTHON_LOADER_CFLAGS) /Fo$(CFG)\$(PLAT)\loaders-py\ /c @<<
+$<
+<<
+
+{$(CFG)\$(PLAT)\loaders-py3\}.c{$(CFG)\$(PLAT)\loaders-py3\}.obj::
+       $(CC) $(CFLAGS) $(PYTHON3_LOADER_CFLAGS) /Fo$(CFG)\$(PLAT)\loaders-py3\ /c @<<
+$<
+<<
+
+{$(CFG)\$(PLAT)\loaders-lua\}.c{$(CFG)\$(PLAT)\loaders-lua\}.obj::
+       $(CC) $(CFLAGS) $(LUA_CFLAGS) /Fo$(CFG)\$(PLAT)\loaders-lua\ /c @<<
+$<
+<<
+
+# Inference rules for demos
+{..\peas-demo\}.c{$(CFG)\$(PLAT)\peas-demo\}.obj::
+       $(CC) $(CFLAGS) $(PEAS_GTK_CFLAGS) $(PEAS_DEFINES)      \
+       /DPEAS_BUILDDIR=\"$(PEAS_BUILDDIR)\"    \
+       /Fo$(CFG)\$(PLAT)\peas-demo\ /c @<<
+$<
+<<
+
+{..\peas-demo\plugins\helloworld\}.c{$(CFG)\$(PLAT)\peas-demo-helloworld\}.obj::
+       $(CC) $(CFLAGS) $(PEAS_DEFINES) $(PEAS_GTK_CFLAGS) /Fo$(CFG)\$(PLAT)\peas-demo-helloworld\ /c @<<
+$<
+<<
+
+{..\peas-demo\plugins\secondtime\}.c{$(CFG)\$(PLAT)\peas-demo-secondtime\}.obj::
+       $(CC) $(CFLAGS) $(PEAS_DEFINES) $(PEAS_GTK_CFLAGS) /Fo$(CFG)\$(PLAT)\peas-demo-secondtime\ /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)]
+{..\src\}.cc{$(CFG)\$(PLAT)\}.exe:
+       $(CXX) $(CFLAGS) $(HB_DEFINES) $(HB_CFLAGS) $< /Fo$*.obj  /Fe$@ /link $(LDFLAGS) 
$(CFG)\$(PLAT)\harfbuzz.lib $(HB_TESTS_DEP_LIBS)
+
+{..\test\api\}.c{$(CFG)\$(PLAT)\}.exe:
+       $(CXX) $(CFLAGS) $(HB_DEFINES) $(HB_CFLAGS) /DSRCDIR="\"../../../test/api\"" $< /Fo$*.obj /Fe$@ /link 
$(LDFLAGS) $(CFG)\$(PLAT)\harfbuzz.lib $(HB_TESTS_DEP_LIBS)
+
+# 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
+$(CFG)\$(PLAT)\peas-$(APIVERSION).lib: $(PEAS_DLL)
+$(CFG)\$(PLAT)\peas-gtk-$(APIVERSION).lib: $(PEAS_GTK_DLL)
+
+$(PEAS_DLL): config.h $(CFG)\$(PLAT)\peas $(peas_marshaller_sources) $(peas_OBJS)
+       link /DLL $(PEAS_LDFLAGS) $(PEAS_DEP_LIBS) -out:$@ -implib:$(CFG)\$(PLAT)\peas-$(APIVERSION).lib @<<
+$(peas_OBJS)
+<<
+       @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
+       @-if exist $@.manifest del $@.manifest
+
+$(PEAS_GTK_DLL): $(CFG)\$(PLAT)\peas-$(APIVERSION).lib $(CFG)\$(PLAT)\peas-gtk $(peas_gtk_OBJS)
+       link /DLL $(PEAS_LDFLAGS) $(CFG)\$(PLAT)\peas-$(APIVERSION).lib $(PEAS_GTK_LIBS) -out:$@ 
-implib:$(CFG)\$(PLAT)\peas-gtk-$(APIVERSION).lib @<<
+$(peas_gtk_OBJS)
+<<
+       @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
+       @-if exist $@.manifest del $@.manifest
+
+$(CFG)\$(PLAT)\libpythonloader.dll:    \
+$(PEAS_LIBS)   \
+$(CFG)\$(PLAT)\loaders-py      \
+$(CFG)\$(PLAT)\loaders-py\peas-python-resources.c      \
+$(peas_py_OBJS)
+       link /DLL $(PYTHON_LOADER_LDFLAGS) $(PEAS_LIBS) $(PEAS_DEP_LIBS) -out:$@ @<<
+$(peas_py_OBJS)
+<<
+       @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
+       @-if exist $@.manifest del $@.manifest
+
+$(CFG)\$(PLAT)\libpython3loader.dll:   \
+$(PEAS_LIBS)   \
+$(CFG)\$(PLAT)\loaders-py3     \
+$(CFG)\$(PLAT)\loaders-py3\peas-python3-resources.c    \
+$(peas_py3_OBJS)
+       link /DLL $(PYTHON3_LOADER_LDFLAGS) $(PEAS_LIBS) $(PEAS_DEP_LIBS) -out:$@ @<<
+$(peas_py3_OBJS)
+<<
+       @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
+       @-if exist $@.manifest del $@.manifest
+
+$(CFG)\$(PLAT)\liblua51loader.dll:     \
+$(PEAS_LIBS)   \
+$(CFG)\$(PLAT)\loaders-lua     \
+$(CFG)\$(PLAT)\loaders-lua\peas-lua-resources.c        \
+$(peas_lua_OBJS)
+       link /DLL $(PEAS_LDFLAGS) $(PEAS_LIBS) lua$(LUAVER).lib $(PEAS_DEP_LIBS) -out:$@ @<<
+$(peas_lua_OBJS)
+<<
+       @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
+       @-if exist $@.manifest del $@.manifest
+
+$(CFG)\$(PLAT)\libhelloworld.dll:      \
+$(PEAS_LIBS)   \
+$(CFG)\$(PLAT)\peas-demo-helloworld    \
+$(peas_demo_helloworld_OBJS)
+       link /DLL $(PEAS_LDFLAGS) $(PEAS_LIBS) $(PEAS_GTK_LIBS) -out:$@ @<<
+$(peas_demo_helloworld_OBJS)
+<<
+       @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
+       @-if exist $@.manifest del $@.manifest
+
+$(CFG)\$(PLAT)\libsecondtime.dll:      \
+$(PEAS_LIBS)   \
+$(CFG)\$(PLAT)\peas-demo-secondtime    \
+$(peas_demo_secondtime_OBJS)
+       link /DLL $(PEAS_LDFLAGS) $(PEAS_LIBS) $(PEAS_GTK_LIBS) -out:$@ @<<
+$(peas_demo_secondtime_OBJS)
+<<
+       @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
+       @-if exist $@.manifest del $@.manifest
+
+# Rules for linking EXEs
+# Format is as follows (the mt command is needed for MSVC 2005/2008 builds):
+# $(exe_name_with_path): $(dependent_libs_files_objects_and_items)
+#      link /DLL [$(linker_flags)] [$(dependent_libs)] -out:$@ @<<
+# $(dependent_objects)
+# <<
+#      @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
+$(CFG)\$(PLAT)\peas-demo.exe: $(PEAS_LIBS) $(CFG)\$(PLAT)\peas-demo $(peas_demo_OBJS)
+       link $(PEAS_LDFLAGS) $(PEAS_LIBS) $(PEAS_GTK_LIBS) -out:$@ @<<
+$(peas_demo_OBJS)
+<<
+       @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
+       @-if exist $@.manifest del $@.manifest
+
+clean:
+       @for %%x in (dll pdb) do @if exist ..\loaders\python3\libpython3loader.%%x del /f /q 
..\loaders\python3\libpython3loader.%%x
+       @for %%x in (dll pdb) do @if exist ..\loaders\lua5.1\liblua51loader.%%x del /f /q  
..\loaders\lua5.1\liblua51loader.%%x
+       @for %%x in (dll pdb) do @if exist ..\peas-demo\plugins\helloworld\libhelloworld.%%x del /f /q 
..\peas-demo\plugins\helloworld\libhelloworld.%%x
+       @for %%x in (dll pdb) do @if exist ..\peas-demo\plugins\secondtime\libsecondtime.%%x del /f /q 
..\peas-demo\plugins\secondtime\libsecondtime.%%x
+       @for %%x in (dll pdb) do @if exist ..\peas-demo\$(PEAS_DLL_NAME).%%x del /f /q 
..\peas-demo\$(PEAS_DLL_NAME).%%x
+       @for %%x in (dll pdb) do @if exist ..\peas-demo\$(PEAS_GTK_DLL_NAME).%%x del /f /q 
..\peas-demo\$(PEAS_GTK_DLL_NAME).%%x
+       @for %%x in (exe pdb) do @if exist ..\peas-demo\peas-demo.%%x del /f /q ..\peas-demo\peas-demo.%%x
+       @if exist PeasGtk-$(APIVERSION).typelib del PeasGtk-$(APIVERSION).typelib
+       @if exist PeasGtk-$(APIVERSION).gir del PeasGtk-$(APIVERSION).gir
+       @if exist Peas-$(APIVERSION).typelib del Peas-$(APIVERSION).typelib
+       @if exist Peas-$(APIVERSION).gir del Peas-$(APIVERSION).gir
+       @-del /f /q $(CFG)\$(PLAT)\*.pdb
+       @for %%f in ($(CFG)\$(PLAT)\*.manifest) do @del /f /q $(CFG)\$(PLAT)\%%f
+       @-del /f /q $(CFG)\$(PLAT)\*.exe
+       @-del /f /q $(CFG)\$(PLAT)\*.dll
+       @-del /f /q $(CFG)\$(PLAT)\*.lib
+       @-del /f /q $(CFG)\$(PLAT)\*.exp
+       @for %%f in ($(CFG)\$(PLAT)\*.ilk) do @del /f /q $(CFG)\$(PLAT)\%%f
+       @if exist $(CFG)\$(PLAT)\peas-demo-secondtime\ del /f /q $(CFG)\$(PLAT)\peas-demo-secondtime\*.obj
+       @if exist $(CFG)\$(PLAT)\peas-demo-helloworld\ del /f /q $(CFG)\$(PLAT)\peas-demo-helloworld\*.obj
+       @if exist $(CFG)\$(PLAT)\peas-demo\ del /f /q $(CFG)\$(PLAT)\peas-demo\*.obj
+       @if exist $(CFG)\$(PLAT)\loaders-lua\ del /f /q $(CFG)\$(PLAT)\loaders-lua\*.obj
+       @if exist $(CFG)\$(PLAT)\loaders-lua\ del /f /q $(CFG)\$(PLAT)\loaders-lua\peas-lua-resources.c
+       @if exist $(CFG)\$(PLAT)\loaders-py3\ del /f /q $(CFG)\$(PLAT)\loaders-py3\*.obj
+       @if exist $(CFG)\$(PLAT)\loaders-py3\ del /f /q $(CFG)\$(PLAT)\loaders-py3\peas-python3-resources.c
+       @if exist $(CFG)\$(PLAT)\loaders-py\ del /f /q $(CFG)\$(PLAT)\loaders-py\*.obj
+       @if exist $(CFG)\$(PLAT)\loaders-py\ del /f /q $(CFG)\$(PLAT)\loaders-py\peas-python-resources.c
+       @if exist $(CFG)\$(PLAT)\peas-gtk\ del /f /q $(CFG)\$(PLAT)\peas-gtk\*.obj
+       @-del /f /q $(CFG)\$(PLAT)\peas\*.obj
+       @-del /f /q $(peas_marshaller_sources)
+       @if exist $(CFG)\$(PLAT)\peas-demo-secondtime\ rmdir /s /q $(CFG)\$(PLAT)\peas-demo-secondtime
+       @if exist $(CFG)\$(PLAT)\peas-demo-helloworld\ rmdir /s /q $(CFG)\$(PLAT)\peas-demo-helloworld
+       @if exist $(CFG)\$(PLAT)\peas-demo\ rmdir /s /q $(CFG)\$(PLAT)\peas-demo
+       @if exist $(CFG)\$(PLAT)\loaders-lua\ rmdir /s /q $(CFG)\$(PLAT)\loaders-lua
+       @if exist $(CFG)\$(PLAT)\loaders-py3\ rmdir /s /q $(CFG)\$(PLAT)\loaders-py3
+       @if exist $(CFG)\$(PLAT)\loaders-py\ rmdir /s /q $(CFG)\$(PLAT)\loaders-py
+       @if exist $(CFG)\$(PLAT)\peas-gtk\ rmdir /s /q $(CFG)\$(PLAT)\peas-gtk
+       @-rmdir /s /q $(CFG)\$(PLAT)\peas
+       @-del /f /q vc$(VSVER)0.pdb
+
+install:
+       @if not exist $(PREFIX)\bin mkdir $(PREFIX)\bin
+       @if not exist $(PREFIX)\lib mkdir $(PREFIX)\lib
+       @if not exist $(PREFIX)\include\libpeas-1.0\libpeas\ mkdir $(PREFIX)\include\libpeas-1.0\libpeas
+       @if "$(PEAS_NO_GTK)" == "" if not exist $(PREFIX)\include\libpeas-1.0\libpeas-gtk\ mkdir 
$(PREFIX)\include\libpeas-1.0\libpeas-gtk
+       @for %f in ($(PEAS_DLLS)) do @(copy /b /y %~dpnf.pdb $(PREFIX)\bin\) & (copy /b /y %f $(PREFIX)\bin\)
+       @for %f in ($(PEAS_LIBS)) do @copy /b /y %f $(PREFIX)\lib
+       @for %h in ($(PEAS_PUBLIC_HEADERS)) do @copy /y ..\libpeas\%h $(PREFIX)\include\libpeas-1.0\libpeas
+       @if "$(PEAS_NO_GTK)" == "" @(for %h in ($(PEAS_GTK_PUBLIC_HEADERS)) do @copy /y ..\libpeas-gtk\%h 
$(PREFIX)\include\libpeas-1.0\libpeas-gtk\)
+       @if not "$(PEAS_LOADERS)" == "" @(if not exist $(PREFIX)\lib\libpeas-1.0\loaders\ mkdir 
$(PREFIX)\lib\libpeas-1.0\loaders)
+       @if not "$(PEAS_LOADERS)" == "" @(for %f in ($(PEAS_LOADERS))do @(copy /b /y %~dpnf.pdb 
$(PREFIX)\lib\libpeas-1.0\loaders\) & (copy /b /y %f $(PREFIX)\lib\libpeas-1.0\loaders\))
+       @for %f in ($(CFG)\$(PLAT)\peas-demo.exe) do @(if exist %f (copy /b /y %~dpnf.pdb $(PREFIX)\bin\) & 
(copy /b /y %f $(PREFIX)\bin\))
+       @for %f in ($(CFG)\$(PLAT)\libhelloworld.dll) do @(if exist %f (if not exist 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\helloworld\ mkdir 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\helloworld) & (copy /b /y %~dpnf.pdb 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\helloworld\) & (copy /b /y %f 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\helloworld\) & (copy /y 
..\peas-demo\plugins\helloworld\helloworld.plugin $(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\helloworld\))
+       @for %f in ($(CFG)\$(PLAT)\libsecondtime.dll) do @(if exist %f (if not exist 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\secondtime\ mkdir 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\secondtime) & (copy /b /y %~dpnf.pdb 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\secondtime\) & (copy /b /y %f 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\secondtime\) & (copy /y 
..\peas-demo\plugins\secondtime\secondtime.plugin $(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\secondtime\))
+       @for %f in ($(CFG)\$(PLAT)\libpython3loader.dll) do @(if exist %f (if not exist 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\pythonhello\ mkdir 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\pythonhello) & (copy /y 
..\peas-demo\plugins\pythonhello\pythonhello.py $(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\pythonhello\) & 
(copy /y ..\peas-demo\plugins\pythonhello\pythonhello.plugin 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\pythonhello\))
+       @for %f in ($(CFG)\$(PLAT)\liblua51loader.dll) do @(if exist %f (if not exist 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\luahello\ mkdir 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\luahello) & (copy /y ..\peas-demo\plugins\luahello\luahello.lua 
$(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\luahello\) & (copy /y 
..\peas-demo\plugins\luahello\luahello.plugin $(PREFIX)\lib\libpeas-1.0\peas-demo\plugins\luahello\))
+       @if exist Peas-1.0.gir (if not exist $(PREFIX)\share\gir-1.0\ mkdir $(PREFIX)\share\gir-1.0) & (copy 
/y Peas-1.0.gir $(PREFIX)\share\gir-1.0\)
+       @if exist Peas-1.0.typelib (if not exist $(PREFIX)\lib\girepository-1.0\ mkdir 
$(PREFIX)\lib\girepository-1.0) & (copy /y Peas-1.0.typelib $(PREFIX)\lib\girepository-1.0\)
+       @if exist PeasGtk-1.0.gir (copy /y PeasGtk-1.0.gir $(PREFIX)\share\gir-1.0\)
+       @if exist PeasGtk-1.0.typelib (copy /y PeasGtk-1.0.typelib $(PREFIX)\lib\girepository-1.0\)
+
+prep-run-demo:
+       @if not exist $(CFG)\$(PLAT)\peas-demo.exe (echo peas-demo is not built!) & (goto :eof)
+       @for %%x in (exe pdb) do @copy /b /y $(CFG)\$(PLAT)\peas-demo.%%x ..\peas-demo
+       @for %%x in (dll pdb) do @copy /b /y $(CFG)\$(PLAT)\$(PEAS_GTK_DLL_NAME).%%x ..\peas-demo
+       @for %%x in (dll pdb) do @copy /b /y $(CFG)\$(PLAT)\$(PEAS_DLL_NAME).%%x ..\peas-demo
+       @for %%x in (dll pdb) do @copy /b /y $(CFG)\$(PLAT)\libhelloworld.%%x ..\peas-demo\plugins\helloworld
+       @for %%x in (dll pdb) do @copy /b /y $(CFG)\$(PLAT)\libsecondtime.%%x ..\peas-demo\plugins\secondtime
+       @for %%x in (dll pdb) do @if exist $(CFG)\$(PLAT)\libpython3loader.%%x copy /b /y 
$(CFG)\$(PLAT)\libpython3loader.%%x ..\loaders\python3
+       @for %%x in (dll pdb) do @if exist $(CFG)\$(PLAT)\liblua51loader.%%x copy /b /y 
$(CFG)\$(PLAT)\liblua51loader.%%x ..\loaders\lua5.1
+       @echo Please set the environment variables as follows to run the peas-demo program
+       @echo directly from the build:
+       @echo set GI_TYPELIB_PATH=%%CD%%
+       @echo Ensure that the lgi files can be loaded by your Lua installation
+       @echo Go to ..\peas-demo and run "peas-demo.exe --run-from-build-dir"
\ No newline at end of file
diff --git a/win32/config-msvc.mak b/win32/config-msvc.mak
new file mode 100644
index 0000000..97b4b45
--- /dev/null
+++ b/win32/config-msvc.mak
@@ -0,0 +1,147 @@
+# NMake Makefile portion for enabling features for Windows builds
+
+# You may change these lines to customize the .lib files that will be linked to
+
+# gobject-introspection, GLib and libffi are required for everything
+
+PEAS_BASE_LIBS = \
+       girepository-1.0.lib    \
+       gio-2.0.lib             \
+       gobject-2.0.lib         \
+       glib-2.0.lib            \
+       
+PEAS_DEP_LIBS =        \
+       gmodule-2.0.lib         \
+       $(PEAS_BASE_LIBS)       \
+       intl.lib
+
+PEAS_GTK_LIBS =        \
+       gtk-3.0.lib     \
+       gdk-3.0.lib     \
+       $(PEAS_BASE_LIBS)
+
+# Please do not change anything beneath this line unless maintaining the NMake Makefiles
+
+APIVERSION = 1.0
+
+# Get libpeas basedir, in forward-slash form
+!if [echo PEAS_BUILDDIR_DOS=%CD%\.. > peasdir.x]
+!endif
+
+!include peasdir.x
+
+!if [del /f peasdir.x]
+!endif
+
+PEAS_BUILDDIR = $(PEAS_BUILDDIR_DOS:\=/)
+
+# Configure for built loaders
+PEAS_LOADERS =
+PEAS_LOADERS_BUILT =
+
+# We include pythonconfig.mak in Makefile.vc because
+# we want to check on Python before setting PYTHON as
+# 'python' unconditionally
+!include luaconfig.mak
+
+PEAS_DEFINES =         \
+       /DHAVE_CONFIG_H \
+       /FImsvc_recommended_pragmas.h
+
+PEAS_LIB_DEFINES =     \
+       $(PEAS_DEFINES) \
+       /D_PEAS_EXTERN=__declspec(dllexport)extern
+
+PEAS_BASE_INCLUDES =   \
+       /I$(PREFIX)\include\gobject-introspection-1.0\girepository      \
+       /I$(PREFIX)\include\glib-2.0    \
+       /I$(PREFIX)\lib\glib-2.0\include        \
+       /I$(PREFIX)\include
+
+PEAS_CFLAGS =                          \
+       /I..                    \
+       /I..\libpeas                    \
+       /I$(CFG)\$(PLAT)\peas   \
+       /I.     \
+       $(PEAS_BASE_INCLUDES)
+
+PEAS_GTK_CFLAGS =                      \
+       /I..                    \
+       /I..\libpeas-gtk                \
+       /I.     \
+       /I$(PREFIX)\include\gtk-3.0     \
+       /I$(PREFIX)\include\gdk-pixbuf-2.0      \
+       /I$(PREFIX)\include\pango-1.0   \
+       /I$(PREFIX)\include\atk-1.0             \
+       $(PEAS_BASE_INCLUDES)
+
+PYTHON_LOADER_CFLAGS = \
+       /I$(PYTHON2PREFIX)\include\pygobject-3.0        \
+       /I$(PYTHON2PREFIX)\include                                      \
+       /DENABLE_PYTHON2        \
+       $(PEAS_CFLAGS)
+
+PYTHON3_LOADER_CFLAGS =        \
+       /I$(PYTHON3PREFIX)\include\pygobject-3.0        \
+       /I$(PYTHON3PREFIX)\include                                      \
+       /DENABLE_PYTHON3        \
+       $(PEAS_CFLAGS)
+
+PEAS_LDFLAGS =                                         \
+       $(LDFLAGS)                                              \
+       /libpath:$(PREFIX)\libs
+
+PYTHON_LOADER_LDFLAGS =        \
+       /libpath:$(PYTHON2PREFIX)\libs  \
+       $(PEAS_LDFLAGS)
+
+PYTHON3_LOADER_LDFLAGS =       \
+       /libpath:$(PYTHON3PREFIX)\libs  \
+       $(PEAS_LDFLAGS)
+
+!if "$(ADDITIONAL_LIB_DIR)" != ""
+PEAS_LDFLAGS = /libpath:$(ADDITIONAL_LIB_DIR) $(PYGI_LDFLAGS)
+!endif
+
+!if "$(USE_LIBTOOL_DLL_NAMES)" == "1"
+PEAS_DLL_NAME = libpeas-1-0
+PEAS_GTK_DLL_NAME = libpeas-gtk-1-0
+!else
+PEAS_DLL_NAME = peas-1-vs$(VSVER)
+PEAS_GTK_DLL_NAME = peas-gtk-1-vs$(VSVER)
+!endif
+
+PEAS_DLL = $(CFG)\$(PLAT)\$(PEAS_DLL_NAME).dll
+PEAS_GTK_DLL = $(CFG)\$(PLAT)\$(PEAS_GTK_DLL_NAME).dll
+
+PEAS_DLLS = $(PEAS_DLL)
+PEAS_LIBS = $(CFG)\$(PLAT)\peas-$(APIVERSION).lib
+PEAS_DEMOS =
+
+!if "$(PEAS_NO_GTK)" == ""
+PEAS_DLLS = $(PEAS_DLLS) $(PEAS_GTK_DLL)
+PEAS_LIBS = $(PEAS_LIBS) $(CFG)\$(PLAT)\peas-gtk-$(APIVERSION).lib
+PEAS_DEMOS =   \
+       $(CFG)\$(PLAT)\peas-demo.exe $(PEAS_DEMOS)      \
+       $(CFG)\$(PLAT)\libhelloworld.dll        \
+       $(CFG)\$(PLAT)\libsecondtime.dll
+!endif
+
+!if "$(BUILD_PY2_LOADER)" == "1"
+PEAS_LOADERS = $(CFG)\$(PLAT)\libpythonloader.dll $(PEAS_LOADERS)
+PEAS_LOADERS_BUILT = python2 $(PEAS_LOADERS_BUILT)
+!endif
+!if "$(BUILD_PY3_LOADER)" == "1"
+PEAS_LOADERS = $(CFG)\$(PLAT)\libpython3loader.dll $(PEAS_LOADERS)
+PEAS_LOADERS_BUILT = python3 $(PEAS_LOADERS_BUILT)
+!endif
+
+!if "$(LGI_ERR)" == "0"
+PEAS_LOADERS = $(CFG)\$(PLAT)\liblua51loader.dll $(PEAS_LOADERS)
+PEAS_LOADERS_BUILT = lua $(PEAS_LOADERS_BUILT)
+
+LUA_CFLAGS = $(PEAS_DEFINES) $(PEAS_CFLAGS)
+!if "$(LUA_EXTRA_CFLAGS)" != ""
+LUA_CFLAGS = $(LUA_EXTRA_CFLAGS) $(LUA_CFLAGS)
+!endif
+!endif
\ No newline at end of file
diff --git a/win32/configpy.py b/win32/configpy.py
new file mode 100644
index 0000000..613db60
--- /dev/null
+++ b/win32/configpy.py
@@ -0,0 +1,31 @@
+# Find out configuration of Python installation
+import sys
+import platform
+
+def configpy(type):
+    # Test whether python is in PATH
+    if type == 'testrun':
+        print(sys.version)
+        return
+
+    # Find Python setup info
+    confignmake = open('configpy.mak', 'a')
+    pyver = platform.python_version().split('.')
+    compiler_details = platform.python_compiler().split()
+    compiler_ver = compiler_details[1][2:compiler_details[1].find('00')]
+
+    confignmake.write('PYTHON%sPREFIX=%s\n' % (type, sys.prefix))
+    confignmake.write('PYTHON%sMAJ=%s\n' % (type, pyver[0]))
+    confignmake.write('PYTHON%sSERIESDOT=%s.%s\n' % (type, pyver[0], pyver[1]))
+    try:
+        from gi.repository import GLib
+        confignmake.write('PYTHON%sPYGOBJECT=1\n' % type)
+    except ImportError:
+        confignmake.write('PYTHON%sPYGOBJECT=\n' % type)
+    confignmake.close()
+
+if __name__ == '__main__':
+    if len(sys.argv) > 1:
+        configpy(sys.argv[1])
+    else:
+        configpy('')
\ No newline at end of file
diff --git a/win32/create-lists-msvc.mak b/win32/create-lists-msvc.mak
new file mode 100644
index 0000000..be29749
--- /dev/null
+++ b/win32/create-lists-msvc.mak
@@ -0,0 +1,141 @@
+# 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 libpeas
+!if [call create-lists.bat header peas_objs.mak peas_OBJS]
+!endif
+
+!if [for %c in ($(PEAS_SOURCES) $(PEAS_MARSHAL_SOURCES)) do @if "%~xc" == ".c" @call create-lists.bat file 
peas_objs.mak ^$(CFG)\^$(PLAT)\peas\%~nc.obj]
+!endif
+
+!if [call create-lists.bat footer peas_objs.mak]
+!endif
+
+!if [call create-lists.bat header peas_objs.mak peas_marshaller_sources]
+!endif
+
+!if [for %c in ($(PEAS_MARSHAL_SOURCES)) do @call create-lists.bat file peas_objs.mak 
^$(CFG)\^$(PLAT)\peas\%c]
+!endif
+
+!if [call create-lists.bat footer peas_objs.mak]
+!endif
+
+!if [call create-lists.bat header peas_objs.mak peas_introspection_sources]
+!endif
+
+!if [for %c in ($(PEAS_PUBLIC_HEADERS) $(PEAS_SOURCES)) do @call create-lists.bat file peas_objs.mak 
..\libpeas\%c]
+!endif
+
+!if [call create-lists.bat footer peas_objs.mak]
+!endif
+
+# For libpeas-gtk
+!if [call create-lists.bat header peas_objs.mak peas_gtk_OBJS]
+!endif
+
+!if [for %c in ($(PEAS_GTK_SOURCES)) do @if "%~xc" == ".c" @call create-lists.bat file peas_objs.mak 
^$(CFG)\^$(PLAT)\peas-gtk\%~nc.obj]
+!endif
+
+!if [call create-lists.bat footer peas_objs.mak]
+!endif
+
+!if [call create-lists.bat header peas_objs.mak peas_gtk_introspection_sources]
+!endif
+
+!if [for %c in ($(PEAS_GTK_PUBLIC_HEADERS) $(PEAS_GTK_SOURCES)) do @call create-lists.bat file peas_objs.mak 
..\libpeas-gtk\%c]
+!endif
+
+!if [call create-lists.bat footer peas_objs.mak]
+!endif
+
+# For Python Loaders
+!if [call create-lists.bat header peas_objs.mak peas_py_OBJS]
+!endif
+
+!if [for %c in ($(PYTHON_LOADER_SOURCES) peas-python-resources.c) do @if "%~xc" == ".c" @call 
create-lists.bat file peas_objs.mak ^$(CFG)\^$(PLAT)\loaders-py\%~nc.obj]
+!endif
+
+!if [call create-lists.bat footer peas_objs.mak]
+!endif
+
+!if [call create-lists.bat header peas_objs.mak peas_py3_OBJS]
+!endif
+
+!if [for %c in ($(PYTHON_LOADER_SOURCES) peas-python3-resources.c) do @if "%~xc" == ".c" @call 
create-lists.bat file peas_objs.mak ^$(CFG)\^$(PLAT)\loaders-py3\%~nc.obj]
+!endif
+
+!if [call create-lists.bat footer peas_objs.mak]
+!endif
+
+!if [call create-lists.bat header peas_objs.mak peas_lua_OBJS]
+!endif
+
+!if [for %c in ($(lua51loader_sources) peas-lua-resources.c) do @if "%~xc" == ".c" @call create-lists.bat 
file peas_objs.mak ^$(CFG)\^$(PLAT)\loaders-lua\%~nc.obj]
+!endif
+
+!if [call create-lists.bat footer peas_objs.mak]
+!endif
+
+!if [call create-lists.bat header peas_objs.mak peas_demo_OBJS]
+!endif
+
+!if [for %c in ($(PEAS_DEMO_SOURCES)) do @if "%~xc" == ".c" @call create-lists.bat file peas_objs.mak 
^$(CFG)\^$(PLAT)\peas-demo\%~nc.obj]
+!endif
+
+!if [call create-lists.bat footer peas_objs.mak]
+!endif
+
+!if [call create-lists.bat header peas_objs.mak peas_demo_helloworld_OBJS]
+!endif
+
+!if [for %c in ($(DEMO_HELLOWORLD_SOURCES)) do @if "%~xc" == ".c" @call create-lists.bat file peas_objs.mak 
^$(CFG)\^$(PLAT)\peas-demo-helloworld\%~nc.obj]
+!endif
+
+!if [call create-lists.bat footer peas_objs.mak]
+!endif
+
+!if [call create-lists.bat header peas_objs.mak peas_demo_secondtime_OBJS]
+!endif
+
+!if [for %c in ($(DEMO_SECONDTIME_SOURCES)) do @if "%~xc" == ".c" @call create-lists.bat file peas_objs.mak 
^$(CFG)\^$(PLAT)\peas-demo-secondtime\%~nc.obj]
+!endif
+
+!if [call create-lists.bat footer peas_objs.mak]
+!endif
+
+!include peas_objs.mak
+
+!if [del /f /q peas_objs.mak]
+!endif
\ No newline at end of file
diff --git a/win32/create-lists.bat b/win32/create-lists.bat
new file mode 100644
index 0000000..ef60d5c
--- /dev/null
+++ b/win32/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/win32/detectenv-msvc.mak b/win32/detectenv-msvc.mak
new file mode 100644
index 0000000..88b206a
--- /dev/null
+++ b/win32/detectenv-msvc.mak
@@ -0,0 +1,138 @@
+# 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) < 1910
+VSVER = 14
+!elseif $(VCVERSION) > 1909 && $(VCVERSION) < 2000
+VSVER = 15
+!else
+VSVER = 0
+!endif
+
+!if "$(VSVER)" == "0"
+MSG = ^
+This NMake Makefile set supports Visual Studio^
+9 (2008) through 15 (2017).  Your Visual Studio^
+version is not supported.
+!error $(MSG)
+!endif
+
+VALID_CFGSET = FALSE
+!if "$(CFG)" == "Release" || "$(CFG)" == "release" || "$(CFG)" == "Debug" || "$(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
+
+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/win32/generate-msvc.mak b/win32/generate-msvc.mak
new file mode 100644
index 0000000..1641005
--- /dev/null
+++ b/win32/generate-msvc.mak
@@ -0,0 +1,60 @@
+# 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.
+
+# Copy config.h
+config.h: config.h.win32
+       @copy $(@F).win32 $@
+
+# Generate the marshalling sources
+$(CFG)\$(PLAT)\peas\peas-marshal.h: ..\libpeas\peas-marshal.list
+       $(GLIB_GENMARSHAL_CMD) ..\libpeas\$(*B).list    \
+       --header --prefix=peas_cclosure_marshal > $@
+
+$(CFG)\$(PLAT)\peas\peas-marshal.c: ..\libpeas\peas-marshal.list
+       $(GLIB_GENMARSHAL_CMD) ..\libpeas\$(*B).list    \
+       --body --prefix=peas_cclosure_marshal > $@.tmp
+       
+       @echo #include "$(@B).h" > $@
+       @type $@.tmp >> $@
+       @del $@.tmp
+
+$(CFG)\$(PLAT)\loaders-py3\peas-python3-resources.c:   \
+..\loaders\python3\peas-python3.gresource.xml
+       $(PREFIX)\bin\glib-compile-resources.exe        \
+       --target=$@                     \
+       --sourcedir=$(**D)      \
+       --generate-source       \
+       --internal                      \
+       $**
+
+$(CFG)\$(PLAT)\loaders-py\peas-python-resources.c:     \
+..\loaders\python\peas-python.gresource.xml
+       $(PREFIX)\bin\glib-compile-resources.exe        \
+       --target=$@                     \
+       --sourcedir=$(**D)      \
+       --generate-source       \
+       --internal                      \
+       $**
+
+$(CFG)\$(PLAT)\loaders-lua\peas-lua-resources.c:       \
+..\loaders\lua5.1\resources\peas-lua.gresource.xml
+       $(PREFIX)\bin\glib-compile-resources.exe        \
+       --target=$@                     \
+       --sourcedir=$(**D)      \
+       --generate-source       \
+       --internal                      \
+       $**
+
+# Create the build directories
+
+$(CFG)\$(PLAT)\peas    \
+$(CFG)\$(PLAT)\peas-gtk        \
+$(CFG)\$(PLAT)\loaders-py      \
+$(CFG)\$(PLAT)\loaders-py3     \
+$(CFG)\$(PLAT)\loaders-lua     \
+$(CFG)\$(PLAT)\peas-demo       \
+$(CFG)\$(PLAT)\peas-demo-helloworld    \
+$(CFG)\$(PLAT)\peas-demo-secondtime:
+       @-mkdir $@
\ No newline at end of file
diff --git a/win32/info-msvc.mak b/win32/info-msvc.mak
new file mode 100644
index 0000000..79a363b
--- /dev/null
+++ b/win32/info-msvc.mak
@@ -0,0 +1,63 @@
+# NMake Makefile portion for displaying config info
+
+WITH_GTK = no
+
+!if "$(PEAS_NO_GTK)" == ""
+WITH_GTK = yes
+!endif
+
+build-info-libpeas:
+       @echo.
+       @echo =========================
+       @echo Configuration for libpeas
+       @echo =========================
+       @echo peas-gtk built: $(WITH_GTK)
+       @echo Loaders built: $(PEAS_LOADERS_BUILT)
+
+all-build-info: build-info-libpeas
+
+help:
+       @echo.
+       @echo ============================
+       @echo Building libpeas Using NMake
+       @echo ============================
+       @echo nmake /f Makefile.vc CFG=[release^|debug] ^<PREFIX=PATH^> ^<PYTHON=PATH^>
+       @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 PYTHON (see this also for PYTHON2/PYTHON3): Required when using
+       @echo GLib-2.53.4 or later, and when building the Python2/3 loaders, unless
+       @echo python.exe is already in your PATH.  Use PYTHON3=xxx with PYTHON=xxx
+       @echo (or PYTHON2=xxx) if building the Python2 and Python 3 loaders
+       @echo simultaneously.  Set to ^$(FULL_PATH_TO_PYTHON_INTERPRETOR).
+       @echo For the Python loaders, a corresponding installation of PyGObject is
+       @echo required.  For building the introspection files, this is also required,
+       @echo which means PYTHON must be set to the python.exe which corresponds to
+       @echo the Python installation that was used to build gobject-introspection--
+       @echo if python is not in your PATH and PYTHON is not set, PYTHON would be
+       @echo set as PYTHON3 or PYTHON2 (if any or both are set), in this order.
+       @echo.
+       @echo LUA: Required for building the lua loader, unless lua.exe is already
+       @echo in your PATH, which also requires lgi to be installed.  LUA 5.1.x-5.3.x
+       @echo are supported.
+       @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 A 'clean' target is supported to remove all generated files, intermediate
+       @echo object files and binaries for the specified configuration.
+       @echo.
+       @echo An 'install' target is supported to copy the build to appropriate
+       @echo locations under ^$(PREFIX).
+       @echo.
+       @echo An 'pre-run-demo' target is supported to copy the build to appropriate
+       @echo locations in the source/build tree so that one can run peas-demo using
+       @echo "peas-demo --run-from-build-dir".
+       @echo ======
+       @echo.
+       
diff --git a/win32/introspection-msvc.mak b/win32/introspection-msvc.mak
new file mode 100644
index 0000000..8739844
--- /dev/null
+++ b/win32/introspection-msvc.mak
@@ -0,0 +1,94 @@
+# Common NMake Makefile module for checking the build environment is sane
+# for building introspection files under MSVC/NMake.
+# This can be copied from $(gi_srcroot)\build\win32 for GNOME items
+# that support MSVC builds and introspection under MSVC.
+
+# Can override with env vars as needed
+# You will need to have built gobject-introspection for this to work.
+# Change or pass in or set the following to suit your environment
+
+!if "$(PREFIX)" == ""
+PREFIX = ..\..\..\vs$(VSVER)\$(PLAT)
+!endif
+
+!if ![setlocal]                && \
+    ![set PFX=$(PREFIX)]       && \
+    ![for %P in (%PFX%) do @echo PREFIX_FULL=%~dpnfP > pfx.x]
+!endif
+!include pfx.x
+
+!if "$(PKG_CONFIG_PATH)" == ""
+PKG_CONFIG_PATH=$(PREFIX_FULL)\lib\pkgconfig
+!else
+PKG_CONFIG_PATH=$(PREFIX_FULL)\lib\pkgconfig;$(PKG_CONFIG_PATH)
+!endif
+
+!if ![del $(ERRNUL) /q/f pfx.x]
+!endif
+
+# Note: The PYTHON must be the Python release series that was used to build
+# the GObject-introspection scanner Python module!
+# Either having python.exe your PATH will work or passing in
+# PYTHON=<full path to your Python interpretor> will do
+
+# This is required, and gobject-introspection needs to be built
+# before this can be successfully run.
+!if "$(PYTHON)" == ""
+PYTHON=python
+!endif
+
+# Path to the pkg-config tool, if not already in the PATH
+!if "$(PKG_CONFIG)" == ""
+PKG_CONFIG=pkg-config
+!endif
+
+# Don't change anything following this line!
+
+GIR_SUBDIR = share\gir-1.0
+GIR_TYPELIBDIR = lib\girepository-1.0
+G_IR_SCANNER = $(PREFIX)\bin\g-ir-scanner
+G_IR_COMPILER = $(PREFIX)\bin\g-ir-compiler.exe
+G_IR_INCLUDEDIR = $(PREFIX)\$(GIR_SUBDIR)
+G_IR_TYPELIBDIR = $(PREFIX)\$(GIR_TYPELIBDIR)
+
+VALID_PKG_CONFIG_PATH = FALSE
+
+MSG_INVALID_PKGCONFIG = You must set or specifiy a valid PKG_CONFIG_PATH
+MSG_INVALID_CFG = You need to specify or set CFG to be release or debug to use this Makefile to build the 
Introspection Files
+
+ERROR_MSG =
+
+BUILD_INTROSPECTION = TRUE
+
+!if ![set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)]  \
+       && ![$(PKG_CONFIG) --print-errors --errors-to-stdout $(CHECK_PACKAGE) > pkgconfig.x]    \
+       && ![setlocal]  \
+       && ![set file="pkgconfig.x"]    \
+       && ![FOR %A IN (%file%) DO @echo PKG_CHECK_SIZE=%~zA > pkgconfig.chksize]       \
+       && ![del $(ERRNUL) /q/f pkgconfig.x]
+!endif
+
+!include pkgconfig.chksize
+!if "$(PKG_CHECK_SIZE)" == "0"
+VALID_PKG_CONFIG_PATH = TRUE
+!else
+VALID_PKG_CONFIG_PATH = FALSE
+!endif
+
+!if ![del $(ERRNUL) /q/f pkgconfig.chksize]
+!endif
+
+VALID_CFGSET = FALSE
+!if "$(CFG)" == "release" || "$(CFG)" == "debug" || "$(CFG)" == "Release" || "$(CFG)" == "Debug"
+VALID_CFGSET = TRUE
+!endif
+
+!if "$(VALID_PKG_CONFIG_PATH)" != "TRUE"
+BUILD_INTROSPECTION = FALSE
+ERROR_MSG = $(MSG_INVALID_PKGCONFIG)
+!endif
+
+!if "$(VALID_CFGSET)" != "TRUE"
+BUILD_INTROSPECTION = FALSE
+ERROR_MSG = $(MSG_INVALID_CFG)
+!endif
diff --git a/win32/luaconfig.mak b/win32/luaconfig.mak
new file mode 100644
index 0000000..13836c5
--- /dev/null
+++ b/win32/luaconfig.mak
@@ -0,0 +1,19 @@
+# Determine whether we build the lua loader
+
+!if "$(LUA)" == ""
+LUA = lua
+!endif
+
+!if [$(LUA) -e "lgi=require 'lgi';glib=lgi.require('GLib')" 2> testlua.xx]
+!endif
+
+!if [for %l in (testlua.xx) do @(echo LGI_ERR=%~zl > luaconf.mak) & @(del %l)]
+!endif
+
+!if [$(LUA) -e "c=io.open(\"luaconf.mak\", \"a+\");ver, count=string.gsub(string.match(_VERSION, \"%d.%d\"), 
\"%.\", \"\");io.output(c);io.write(\"LUAVER=\" .. ver);io.close(c)"]
+!endif
+
+!include luaconf.mak
+
+!if [del /f /q luaconf.mak]
+!endif
\ No newline at end of file
diff --git a/win32/peas-introspection-msvc.mak b/win32/peas-introspection-msvc.mak
new file mode 100644
index 0000000..d701a1c
--- /dev/null
+++ b/win32/peas-introspection-msvc.mak
@@ -0,0 +1,79 @@
+# NMake Makefile to build Introspection Files for libpeas
+
+!include detectenv-msvc.mak
+
+CHECK_PACKAGE = gtk+-3.0
+
+built_install_girs = Peas-$(APIVERSION).gir
+# PeasGtk-$(APIVERSION).gir
+built_install_typelibs = Peas-$(APIVERSION).typelib
+# PeasGtk-$(APIVERSION).typelib
+
+!include introspection-msvc.mak
+
+!if "$(BUILD_INTROSPECTION)" == "TRUE"
+
+setgirbuildenv:
+       @set PYTHONPATH=$(PREFIX)\lib\gobject-introspection
+       @set PATH=$(PREFIX)\bin;$(PATH)
+       @set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)
+       @set LIB=$(PREFIX)\lib;$(LIB)
+
+Peas-1.0.gir: $(peas_introspection_sources) $(PEAS_DLL)
+       @-echo Generating $@...
+       $(PYTHON) $(G_IR_SCANNER)       \
+       --verbose -no-libtool   \
+       --namespace=Peas        \
+       --nsversion=1.0 \
+               \
+       --library=peas-1.0      \
+               \
+       --add-include-path=$(G_IR_INCLUDEDIR)   \
+       --include=GObject-2.0 --include=GModule-2.0 --include=Gio-2.0 --include=GIRepository-2.0        \
+       --pkg-export=libpeas-1.0        \
+       --cflags-begin  \
+       $(PEAS_CFLAGS)  \
+       --cflags-end    \
+       --c-include=libpeas/peas.h --warn-all   \
+       $(peas_introspection_sources)   \
+       -L $(CFG)\$(PLAT)       \
+       -o $@
+
+Peas-1.0.typelib: Peas-1.0.gir
+       @-echo Compiling $@...
+       $(G_IR_COMPILER)        \
+       --includedir=. --debug --verbose        \
+       Peas-1.0.gir    \
+       -o $@
+
+PeasGtk-1.0.gir: $(peas_introspection_sources) $(PEAS_DLL)
+       @-echo Generating $@...
+       $(PYTHON) $(G_IR_SCANNER)       \
+       --verbose -no-libtool   \
+       --namespace=PeasGtk     \
+       --nsversion=1.0 \
+               \
+       --library=peas-gtk-1.0  --library=peas-1.0      \
+               \
+       --add-include-path=$(G_IR_INCLUDEDIR)   \
+       --include=GObject-2.0 --include=Gtk-3.0 \
+       --pkg-export=libpeas-gtk-1.0    \
+       --cflags-begin  \
+       $(PEAS_GTK_CFLAGS)      \
+       --cflags-end    \
+       --include-uninstalled=./Peas-1.0.gir --warn-all \
+       $(peas_gtk_introspection_sources)       \
+       -L $(CFG)\$(PLAT)       \
+       -o $@
+
+PeasGtk-1.0.typelib: PeasGtk-1.0.gir
+       @-echo Compiling $@...
+       $(G_IR_COMPILER)        \
+       --includedir=. --debug --verbose        \
+       PeasGtk-1.0.gir \
+       -o $@
+
+!else
+all:
+       @-echo $(ERROR_MSG)
+!endif
diff --git a/win32/pythonconfig.mak b/win32/pythonconfig.mak
new file mode 100644
index 0000000..325bd26
--- /dev/null
+++ b/win32/pythonconfig.mak
@@ -0,0 +1,117 @@
+# Only test Python stuff with a valid config
+!if "$(CFG)" == "Release" || "$(CFG)" == "release" || "$(CFG)" == "Debug" || "$(CFG)" == "debug"
+
+# Do not set PYTHON as "python" automatically,
+# unless python.exe is in PATH
+!if "$(PYTHON)" == ""
+
+# Test run Python to see whether it is in PATH
+# by printing out version info, and set PYTHON=python
+# if it is found in PATH
+!if [python configpy.py testrun > pythonrun.xx]
+!endif
+
+!if [for %p in (pythonrun.xx) do @(if %~zp GTR 0 echo PYTHON=python > pyexe.mak) & @(del /f pythonrun.xx)]
+!endif
+
+!if exist (pyexe.mak)
+!include pyexe.mak
+!if [del /f pyexe.mak]
+!endif
+!endif
+!endif
+
+# If PYTHON3 or PYTHON2 is set, set PYTHON
+# in that order, if PYTHON is not set
+!if "$(PYTHON)" == ""
+!if "$(PYTHON3)" != ""
+PYTHON = $(PYTHON3)
+!elseif "$(PYTHON2)" != ""
+PYTHON = $(PYTHON2)
+!else
+# Python is not in PATH and PYTHON2 and PYTHON3 are not set
+PYTHON = xxx
+!endif
+!endif
+
+!if "$(PYTHON)" != "xxx"
+!if [echo PYTHON_CONFIG_FILE= > configpy.mak]
+!endif
+
+!if [$(PYTHON) configpy.py"]
+!endif
+!endif
+
+!if "$(PYTHON3)" != ""
+!if [$(PYTHON3) configpy.py 3]
+!endif
+!endif
+
+!if "$(PYTHON2)" != ""
+!if [$(PYTHON2) configpy.py 2]
+!endif
+!endif
+
+!if exist (configpy.mak)
+!include configpy.mak
+
+!if ![del /f /q configpy.mak]
+!endif
+!endif
+
+# Set up command to call glib-genmarshal, which may
+# be a python script or a .exe binary
+!if exist ($(PREFIX)\bin\glib-genmarshal)
+!if "$(PYTHON)" != "xxx"
+GLIB_GENMARSHAL_CMD = $(PYTHON) $(PREFIX)\bin\glib-genmarshal
+!else
+GLIB_GENMARSHAL_CMD = $(PREFIX)\bin\glib-genmarshal.exe
+!endif
+!else
+GLIB_GENMARSHAL_CMD = $(PREFIX)\bin\glib-genmarshal.exe
+!endif
+
+!if "$(GLIB_GENMARSHAL_CMD)" == "$(PREFIX)\bin\glib-genmarshal.exe"
+!if !exist ($(GLIB_GENMARSHAL_CMD))
+!message Warning: Could not run glib-genmarshal.  If building, the build
+!message will most probably fail after seeing this message.  Please
+!message ensure the following:
+!message -glib-genmarshal or glib-genmarshal.exe can be found at $(PREFIX)\bin,
+!message or set PREFIX so that it can be found at <PREFIX>\bin.
+!message -If using glib-genmarshal as a Python script, ensure that
+!message PYTHON3 or PYTHON2 or PYTHON is set correctly, or python.exe
+!message is in your PATH.
+!endif
+!endif
+
+# Determine installation prefix and existance of
+# PyGObject 3.x in that Python installation
+!if "$(PYTHONMAJ)" == "2"
+!if "$(PYTHON2PREFIX)" == ""
+PYTHON2MAJ = $(PYTHONMAJ)
+PYTHON2PREFIX = $(PYTHONPREFIX)
+PYTHON2PYGOBJECT = $(PYTHONPYGOBJECT)
+!endif
+!endif
+
+!if "$(PYTHONMAJ)" == "3"
+!if "$(PYTHON3PREFIX)" == ""
+PYTHON3MAJ = $(PYTHONMAJ)
+PYTHON3PREFIX = $(PYTHONPREFIX)
+PYTHON3PYGOBJECT = $(PYTHONPYGOBJECT)
+!endif
+!endif
+
+# Now, determine which Python loader(s) will be built
+!if "$(PYTHON2PYGOBJECT)" == "1"
+!if exist($(PYTHON2PREFIX)\include\pygobject-3.0\pygobject.h)
+BUILD_PY2_LOADER=1
+!endif
+!endif
+
+!if "$(PYTHON3PYGOBJECT)" == "1"
+!if exist($(PYTHON3PREFIX)\include\pygobject-3.0\pygobject.h)
+BUILD_PY3_LOADER=1
+!endif
+!endif
+!endif
\ No newline at end of file



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