Commit 661e3f6b authored by Chun-wei Fan's avatar Chun-wei Fan

build: Add NMake Makefiles

This adds a set of NMake Makefiles which can be used to build glibmm
with Visual Studio 2017 and later.  This will supersede the Visual
Studio 2017 project files, as this approach will reduce the likelihood
of the Visual Studio build files becoming out-of-date as this also
reads from the various filelist.am's under glib/ and gio/.

The existing gendef, and generated [glib|gio]mmconfig.h and generated
[glib|gio]mm.rc will continue to be used.

The NMake Makefiles will now be distributed instead of the Visual Studio
project files from this point on.

The Visual Studio project files will be removed in the next commit
parent ce263591
# NMake Makefile for building libsigc++ on Windows using Visual Studio
# 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 ..\gio\src\filelist.am
!include ..\gio\giomm\filelist.am
!include ..\glib\src\filelist.am
!include ..\glib\glibmm\filelist.am
# Include the Makefile portion that enables features based on user input
!include config-msvc.mak
!if "$(VALID_CFGSET)" == "TRUE"
# We need Visual Studio 2017 or later
!if $(VSVER) < 15
VALID_MSC = FALSE
!else
VALID_MSC = TRUE
!endif
!if $(VCVERSION) < 1915
!message Some tests may fail to build for Visual Studio 2017 15.7 or earlier!
!endif
!if "$(VALID_MSC)" == "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: $(GIOMM_LIB) $(glibmm_ex) $(giomm_ex) all-build-info
tests: $(glibmm_tests) $(giomm_tests) all-build-info
# Include the build rules for sources, DLLs and executables
!include generate-msvc.mak
!include build-rules-msvc.mak
!include install.mak
!else # "$(VALID_MSC)" == "TRUE"
all:
@echo You need Visual Studio 2017 or later.
!endif # "$(VALID_MSC)" == "TRUE"
!else # "$(VALID_CFGSET)" == "TRUE"
all: help
@echo You need to specify a valid configuration, via
@echo CFG=release or CFG=debug
!endif # "$(VALID_CFGSET)" == "TRUE"
!include info-msvc.mak
# 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 @<<
# $<
# <<
{..\glib\glibmm\}.cc{$(CFG)\$(PLAT)\glibmm\}.obj::
$(CXX) $(LIBGLIBMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(CFG)\$(PLAT)\glibmm\ /c @<<
$<
<<
{..\gio\giomm\}.cc{$(CFG)\$(PLAT)\giomm\}.obj::
$(CXX) $(LIBGIOMM_CFLAGS) $(CFLAGS_NOGL) /Fo$(CFG)\$(PLAT)\giomm\ /c @<<
$<
<<
{.\glibmm\}.rc{$(CFG)\$(PLAT)\glibmm\}.res:
rc /fo$@ $<
{.\giomm\}.rc{$(CFG)\$(PLAT)\giomm\}.res:
rc /fo$@ $<
# Rules for building .lib files
$(GLIBMM_LIB): $(GLIBMM_DLL)
$(GIOMM_LIB): $(GIOMM_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
$(GLIBMM_DLL): $(CFG)\$(PLAT)\glibmm\glibmm.def $(glibmm_OBJS)
link /DLL $(LDFLAGS_NOLTCG) $(GOBJECT_LIBS) $(LIBSIGC_LIB) /implib:$(GLIBMM_LIB) /def:$(CFG)\$(PLAT)\glibmm\glibmm.def -out:$@ @<<
$(glibmm_OBJS)
<<
@-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
$(GIOMM_DLL): $(GLIBMM_LIB) $(CFG)\$(PLAT)\giomm\giomm.def $(giomm_OBJS)
link /DLL $(LDFLAGS_NOLTCG) $(GLIBMM_LIB) $(GIO_LIBS) $(LIBSIGC_LIB) /implib:$(GIOMM_LIB) /def:$(CFG)\$(PLAT)\giomm\giomm.def -out:$@ @<<
$(giomm_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
# For the gendef tool
{.\gendef\}.cc{$(CFG)\$(PLAT)\}.exe:
@if not exist $(CFG)\$(PLAT)\gendef\ $(MAKE) -f Makefile.vc CFG=$(CFG) $(CFG)\$(PLAT)\gendef
$(CXX) $(GLIBMM_BASE_CFLAGS) $(CFLAGS) /Fo$(CFG)\$(PLAT)\gendef\ $< /link $(LDFLAGS) /out:$@
# For the buildable glibmm examples
$(CFG)\$(PLAT)\glibmm-ex-compose.exe: ..\examples\compose\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\glibmm-ex-dispatcher2.exe: ..\examples\thread\dispatcher2.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\glibmm-ex-keyfile.exe: ..\examples\keyfile\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\glibmm-ex-markup.exe: ..\examples\markup\parser.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\glibmm-ex-options.exe: ..\examples\options\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\glibmm-ex-properties.exe: ..\examples\properties\properties_example.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\glibmm-ex-regex.exe: ..\examples\regex\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\glibmm-ex-compose.exe \
$(CFG)\$(PLAT)\glibmm-ex-dispatcher2.exe \
$(CFG)\$(PLAT)\glibmm-ex-keyfile.exe \
$(CFG)\$(PLAT)\glibmm-ex-markup.exe \
$(CFG)\$(PLAT)\glibmm-ex-options.exe \
$(CFG)\$(PLAT)\glibmm-ex-properties.exe \
$(CFG)\$(PLAT)\glibmm-ex-regex.exe:
@if not exist $(CFG)\$(PLAT)\glibmm-ex $(MAKE) -f Makefile.vc CFG=$(CFG) $(CFG)\$(PLAT)\glibmm-ex
$(CXX) $(GLIBMM_EX_CFLAGS) $(CFLAGS) /Fo$(CFG)\$(PLAT)\glibmm-ex\ $** /link $(LDFLAGS) $(GLIBMM_EX_LIBS) /out:$@
# For the buildable giomm examples
$(CFG)\$(PLAT)\giomm-ex-dbus-client_bus_listnames.exe: ..\examples\dbus\client_bus_listnames.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\giomm-ex-dbus-session_bus_service.exe: ..\examples\dbus\session_bus_service.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\giomm-ex-dbus-server_without_bus.exe: ..\examples\dbus\server_without_bus.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\giomm-ex-network-resolver.exe: ..\examples\network\resolver.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\giomm-ex-network-socket-client.exe: ..\examples\network\socket-client.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\giomm-ex-network-socket-server.exe: ..\examples\network\socket-server.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\giomm-ex-settings.exe: ..\examples\settings\settings.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\giomm-ex-dbus-client_bus_listnames.exe \
$(CFG)\$(PLAT)\giomm-ex-dbus-session_bus_service.exe \
$(CFG)\$(PLAT)\giomm-ex-dbus-server_without_bus.exe \
$(CFG)\$(PLAT)\giomm-ex-network-resolver.exe \
$(CFG)\$(PLAT)\giomm-ex-network-socket-client.exe \
$(CFG)\$(PLAT)\giomm-ex-network-socket-server.exe \
$(CFG)\$(PLAT)\giomm-ex-settings.exe:
@if not exist $(CFG)\$(PLAT)\giomm-ex $(MAKE) -f Makefile.vc CFG=$(CFG) $(CFG)\$(PLAT)\giomm-ex
@if "$@" == "$(CFG)\$(PLAT)\giomm-ex-settings.exe" $(MAKE) -f Makefile.vc CFG=$(CFG) $(CFG)\$(PLAT)\gschema.compiled
$(CXX) $(GIOMM_EX_CFLAGS) $(CFLAGS) /Fo$(CFG)\$(PLAT)\giomm-ex\ $** /link $(LDFLAGS) $(GIOMM_EX_LIBS) /out:$@
# For building the glibmm tests
$(CFG)\$(PLAT)\test-glibmm_base64.exe: ..\tests\glibmm_base64\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_bool_vector.exe: ..\tests\glibmm_bool_vector\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_btree.exe: ..\tests\glibmm_btree\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_buildfilename.exe: ..\tests\glibmm_buildfilename\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_bytearray.exe: ..\tests\glibmm_bytearray\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_date.exe: ..\tests\glibmm_date\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_mainloop.exe: ..\tests\glibmm_mainloop\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_nodetree.exe: ..\tests\glibmm_nodetree\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_object.exe: ..\tests\glibmm_object\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_objectbase.exe: ..\tests\glibmm_objectbase\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_objectbase_move.exe: ..\tests\glibmm_objectbase_move\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_object_move.exe: ..\tests\glibmm_object_move\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_refptr.exe: ..\tests\glibmm_refptr\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_refptr_sigc_bind.exe: ..\tests\glibmm_refptr_sigc_bind\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_ustring_compose.exe: ..\tests\glibmm_ustring_compose\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_ustring_format.exe: ..\tests\glibmm_ustring_format\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_ustring_make_valid.exe: ..\tests\glibmm_ustring_make_valid\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_value.exe: ..\tests\glibmm_value\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_variant.exe: ..\tests\glibmm_variant\main.cc $(GLIBMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_base64.exe \
$(CFG)\$(PLAT)\test-glibmm_bool_vector.exe \
$(CFG)\$(PLAT)\test-glibmm_btree.exe \
$(CFG)\$(PLAT)\test-glibmm_buildfilename.exe \
$(CFG)\$(PLAT)\test-glibmm_bytearray.exe \
$(CFG)\$(PLAT)\test-glibmm_date.exe \
$(CFG)\$(PLAT)\test-glibmm_interface_move.exe \
$(CFG)\$(PLAT)\test-glibmm_mainloop.exe \
$(CFG)\$(PLAT)\test-glibmm_nodetree.exe \
$(CFG)\$(PLAT)\test-glibmm_object.exe \
$(CFG)\$(PLAT)\test-glibmm_objectbase.exe \
$(CFG)\$(PLAT)\test-glibmm_objectbase_move.exe \
$(CFG)\$(PLAT)\test-glibmm_object_move.exe \
$(CFG)\$(PLAT)\test-glibmm_refptr.exe \
$(CFG)\$(PLAT)\test-glibmm_refptr_sigc_bind.exe \
$(CFG)\$(PLAT)\test-glibmm_ustring_compose.exe \
$(CFG)\$(PLAT)\test-glibmm_ustring_format.exe \
$(CFG)\$(PLAT)\test-glibmm_ustring_make_valid.exe \
$(CFG)\$(PLAT)\test-glibmm_value.exe \
$(CFG)\$(PLAT)\test-glibmm_variant.exe:
@if not exist $(CFG)\$(PLAT)\glibmm-tests $(MAKE) -f Makefile.vc CFG=$(CFG) $(CFG)\$(PLAT)\glibmm-tests
$(CXX) $(GLIBMM_EX_CFLAGS) $(CFLAGS) /Fo$(CFG)\$(PLAT)\glibmm-tests\ $** /link $(LDFLAGS) $(GLIBMM_EX_LIBS) /out:$@
# For giomm tests
$(CFG)\$(PLAT)\test-giomm_asyncresult_sourceobject.exe: ..\tests\giomm_asyncresult_sourceobject\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-giomm_ioerror.exe: ..\tests\giomm_ioerror\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-giomm_ioerror_and_iodbuserror.exe: ..\tests\giomm_ioerror_and_iodbuserror\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-giomm_listmodel.exe: ..\tests\giomm_listmodel\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-giomm_memoryinputstream.exe: ..\tests\giomm_memoryinputstream\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-giomm_simple.exe: ..\tests\giomm_simple\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-giomm_stream_vfuncs.exe: ..\tests\giomm_stream_vfuncs\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-giomm_tls_client.exe: ..\tests\giomm_tls_client\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_interface_implementation.exe: ..\tests\glibmm_interface_implementation\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_null_vectorutils.exe: ..\tests\glibmm_null_vectorutils\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-glibmm_vector.exe: ..\tests\glibmm_vector\main.cc $(GIOMM_LIB)
$(CFG)\$(PLAT)\test-giomm_asyncresult_sourceobject.exe \
$(CFG)\$(PLAT)\test-giomm_ioerror.exe \
$(CFG)\$(PLAT)\test-giomm_ioerror_and_iodbuserror.exe \
$(CFG)\$(PLAT)\test-giomm_listmodel.exe \
$(CFG)\$(PLAT)\test-giomm_memoryinputstream.exe \
$(CFG)\$(PLAT)\test-giomm_simple.exe \
$(CFG)\$(PLAT)\test-giomm_stream_vfuncs.exe \
$(CFG)\$(PLAT)\test-giomm_tls_client.exe \
$(CFG)\$(PLAT)\test-glibmm_interface_implementation.exe \
$(CFG)\$(PLAT)\test-glibmm_null_vectorutils.exe \
$(CFG)\$(PLAT)\test-glibmm_vector.exe:
@if not exist $(CFG)\$(PLAT)\giomm-tests $(MAKE) -f Makefile.vc CFG=$(CFG) $(CFG)\$(PLAT)\giomm-tests
$(CXX) $(GIOMM_EX_CFLAGS) $(CFLAGS) /Fo$(CFG)\$(PLAT)\giomm-tests\ $** /link $(LDFLAGS) $(GIOMM_EX_LIBS) /out:$@
clean:
@-del /f /q $(CFG)\$(PLAT)\*.exe
@-del /f /q $(CFG)\$(PLAT)\*.dll
@-del /f /q $(CFG)\$(PLAT)\*.pdb
@-del /f /q $(CFG)\$(PLAT)\*.ilk
@-del /f /q $(CFG)\$(PLAT)\*.exp
@-del /f /q $(CFG)\$(PLAT)\*.lib
@-del /f /q $(CFG)\$(PLAT)\gschemas.compiled
@-if exist $(CFG)\$(PLAT)\giomm-tests del /f /q $(CFG)\$(PLAT)\giomm-tests\*.obj
@-del /f /q $(CFG)\$(PLAT)\giomm-ex\*.obj
@-del /f /q $(CFG)\$(PLAT)\giomm\*.def
@-del /f /q $(CFG)\$(PLAT)\giomm\*.res
@-del /f /q $(CFG)\$(PLAT)\giomm\*.obj
@-if exist $(CFG)\$(PLAT)\glibmm-tests del /f /q $(CFG)\$(PLAT)\glibmm-tests\*.obj
@-del /f /q $(CFG)\$(PLAT)\glibmm-ex\*.obj
@-del /f /q $(CFG)\$(PLAT)\glibmm\*.def
@-del /f /q $(CFG)\$(PLAT)\glibmm\*.res
@-del /f /q $(CFG)\$(PLAT)\glibmm\*.obj
@-del /f /q $(CFG)\$(PLAT)\gendef\*.obj
@-if exist $(CFG)\$(PLAT)\giomm-tests rd $(CFG)\$(PLAT)\giomm-tests
@-rd $(CFG)\$(PLAT)\giomm-ex
@-rd $(CFG)\$(PLAT)\giomm
@-if exist $(CFG)\$(PLAT)\glibmm-tests rd $(CFG)\$(PLAT)\glibmm-tests
@-rd $(CFG)\$(PLAT)\glibmm-ex
@-rd $(CFG)\$(PLAT)\glibmm
@-rd $(CFG)\$(PLAT)\gendef
@-del /f /q vc$(PDBVER)0.pdb
# NMake Makefile portion for enabling features for Windows builds
# These are the base minimum libraries required for building glibmm.
BASE_INCLUDES = /I$(PREFIX)\include
# Please do not change anything beneath this line unless maintaining the NMake Makefiles
GLIB_API_VERSION = 2.0
GLIBMM_MAJOR_VERSION = 2
GLIBMM_MINOR_VERSION = 58
LIBSIGC_MAJOR_VERSION = 3
LIBSIGC_MINOR_VERSION = 0
!if "$(CFG)" == "debug" || "$(CFG)" == "Debug"
DEBUG_SUFFIX = -d
!else
DEBUG_SUFFIX =
!endif
GLIBMM_BASE_CFLAGS = \
/I..\glib /I.\glibmm \
/wd4530 /std:c++17 \
/FImsvc_recommended_pragmas.h
GIOMM_BASE_CFLAGS = /I..\gio /I.\giomm $(GLIBMM_BASE_CFLAGS)
GLIBMM_EXTRA_INCLUDES = \
/I$(PREFIX)\include\gio-win32-$(GLIB_API_VERSION) \
/I$(PREFIX)\include\glib-$(GLIB_API_VERSION) \
/I$(PREFIX)\lib\glib-$(GLIB_API_VERSION)\include \
/I$(PREFIX)\include\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION) \
/I$(PREFIX)\lib\sigc++-$(LIBSIGC_MAJOR_VERSION).$(LIBSIGC_MINOR_VERSION)\include
LIBGLIBMM_CFLAGS = /DGLIBMM_BUILD /DSIZEOF_WCHAR_T=2 $(GLIBMM_BASE_CFLAGS) $(GLIBMM_EXTRA_INCLUDES)
LIBGIOMM_CFLAGS = /DGIOMM_BUILD /DSIZEOF_WCHAR_T=2 $(GIOMM_BASE_CFLAGS) $(GLIBMM_EXTRA_INCLUDES)
GLIBMM_EX_CFLAGS = $(GLIBMM_BASE_CFLAGS) $(GLIBMM_EXTRA_INCLUDES)
GIOMM_EX_CFLAGS = $(GIOMM_BASE_CFLAGS) $(GLIBMM_EXTRA_INCLUDES)
# We build glibmm-vc$(VSVER)0-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION).dll or
# glibmm-vc$(VSVER)0-d-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION).dll at least
# giomm-vc$(VSVER)0-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION).dll or
# giomm-vc$(VSVER)0-d-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION).dll at least
LIBSIGC_LIBNAME = sigc-vc$(VSVER)0$(DEBUG_SUFFIX)-$(LIBSIGC_MAJOR_VERSION)_$(LIBSIGC_MINOR_VERSION)
LIBSIGC_DLL = $(LIBSIGC_LIBNAME).dll
LIBSIGC_LIB = $(LIBSIGC_LIBNAME).lib
GLIBMM_LIBNAME = glibmm-vc$(VSVER)0$(DEBUG_SUFFIX)-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION)
GLIBMM_DLL = $(CFG)\$(PLAT)\$(GLIBMM_LIBNAME).dll
GLIBMM_LIB = $(CFG)\$(PLAT)\$(GLIBMM_LIBNAME).lib
GIOMM_LIBNAME = giomm-vc$(VSVER)0$(DEBUG_SUFFIX)-$(GLIBMM_MAJOR_VERSION)_$(GLIBMM_MINOR_VERSION)
GIOMM_DLL = $(CFG)\$(PLAT)\$(GIOMM_LIBNAME).dll
GIOMM_LIB = $(CFG)\$(PLAT)\$(GIOMM_LIBNAME).lib
GENDEF = $(CFG)\$(PLAT)\gendef.exe
GOBJECT_LIBS = gobject-2.0.lib gmodule-2.0.lib glib-2.0.lib
GIO_LIBS = gio-2.0.lib $(GOBJECT_LIBS)
GLIBMM_EX_LIBS = $(GLIBMM_LIB) $(LIBSIGC_LIB) $(GOBJECT_LIBS)
GIOMM_EX_LIBS = $(GIOMM_LIB) $(GLIBMM_LIB) $(LIBSIGC_LIB) $(GIO_LIBS)
# Set a default location for glib-compile-schemas, if not specified
!ifndef GLIB_COMPILE_SCHEMAS
GLIB_COMPILE_SCHEMAS = $(PREFIX)\bin\glib-compile-schemas
!endif
# 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=
# Ensure we build the right generated sources for giomm
giomm_generated_sources = $(giomm_files_any_hg:.hg=.cc)
giomm_generated_sources = $(giomm_generated_sources) wrap_init.cc
giomm_generated_headers = $(giomm_files_any_hg:.hg=.h)
giomm_generated_private_headers = $(giomm_files_any_hg:.hg=_p.h)
glibmm_generated_private_headers = $(glibmm_files_used_hg:.hg=_p.h)
glibmm_files_extra_ph_int = $(glibmm_files_extra_ph:/=\)
# For glibmm
!if [call create-lists.bat header glibmm.mak glibmm_OBJS]
!endif
!if [for %c in ($(glibmm_files_built_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\glibmm\%~nc.obj]
!endif
!if [for %c in ($(glibmm_files_extra_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\glibmm\%~nc.obj]
!endif
!if [@call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\glibmm\glibmm.res]
!endif
!if [call create-lists.bat footer glibmm.mak]
!endif
# For giomm
!if [call create-lists.bat header glibmm.mak giomm_OBJS]
!endif
!if [for %c in ($(giomm_generated_sources)) do @if "%~xc" == ".cc" @call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\giomm\%~nc.obj]
!endif
!if [for %c in ($(giomm_files_extra_cc)) do @if "%~xc" == ".cc" @call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\giomm\%~nc.obj]
!endif
!if [@call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\giomm\giomm.res]
!endif
!if [call create-lists.bat footer glibmm.mak]
!endif
!if [call create-lists.bat header glibmm.mak glibmm_ex]
!endif
# We skip building the following examples:
# child_watch, iochannel_stream: Builds on *NIX only
# thread\dispatcher.cc: Not C++-17 compliant
!if [for %e in (compose dispatcher2 keyfile markup options properties regex) do @call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\glibmm-ex-%e.exe]
!endif
!if [call create-lists.bat footer glibmm.mak]
!endif
!if [call create-lists.bat header glibmm.mak giomm_ex]
!endif
!if [for %e in (resolver socket-client socket-server) do @call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\giomm-ex-network-%e.exe]
!endif
!if [for %e in (settings) do @call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\giomm-ex-%e.exe]
!endif
!if [for %e in (client_bus_listnames session_bus_service server_without_bus) do @call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\giomm-ex-dbus-%e.exe]
!endif
!if [call create-lists.bat footer glibmm.mak]
!endif
!if [call create-lists.bat header glibmm.mak glibmm_tests]
!endif
# Skip the following:
# glibmm_interface_implementation, glibmm_null_vectorutils, glibmm_vector: Are actually using giomm
# glibmm_interface_move: Relies on g_autoptr_*()
!if [for /f %d in ('dir /ad /b ..\tests\glibmm_*') do @if not "%d" == "glibmm_interface_implementation" if not "%d" == "glibmm_interface_move" if not "%d" == "glibmm_null_vectorutils" if not "%d" == "glibmm_vector" @call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\test-%d.exe]
!endif
!if [call create-lists.bat footer glibmm.mak]
!endif
!if [call create-lists.bat header glibmm.mak giomm_tests]
!endif
!if [for /f %d in ('dir /ad /b ..\tests\giomm_*') do @call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\test-%d.exe]
!endif
!if [for %d in (interface_implementation null_vectorutils vector) do @call create-lists.bat file glibmm.mak ^$(CFG)\^$(PLAT)\test-glibmm_%d.exe]
!endif
!if [call create-lists.bat footer glibmm.mak]
!endif
!include glibmm.mak
!if [del /f /q glibmm.mak]
!endif
@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
# 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 interpreter, for running glib-mkenums. glib-mkenums
# needs to be found in $(PREFIX)\bin. Using either a 32-bit or x64 PERL
# interpreter are supported for either a 32-bit or x64 build.
!if "$(PERL)" == ""
PERL = perl
!endif
# Location of the Python interpreter, 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 interpreter 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)
!else
!if $(VSVER) < 15
PDBVER = $(VSVER)
!else
PDBVER = 14
!endif
!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" || "$(CFG)" == "Release"
CFLAGS_ADD_NO_GL = /MD /O2 /MP
CFLAGS_ADD = $(CFLAGS_ADD_NO_GL) /GL
!if "$(VSVER)" != "9"
CFLAGS_ADD = $(CFLAGS_ADD) /d2Zi+
CFLAGS_ADD_NO_GL = $(CFLAGS_ADD_NO_GL) /d2Zi+
!endif
!else
CFLAGS_ADD = /MDd /Od
CFLAGS_ADD_NO_GL = $(CFLAGS_ADD)
!endif
!if "$(PLAT)" == "x64"
LDFLAGS_ARCH = /machine:x64
!else
LDFLAGS_ARCH = /machine:x86
!endif
!if "$(VALID_CFGSET)" == "TRUE"
CFLAGS_NOGL = $(CFLAGS_ADD_NO_GL) /W3 /Zi
CFLAGS = $(CFLAGS_ADD) /W3 /Zi
LDFLAGS_BASE = $(LDFLAGS_ARCH) /libpath:$(PREFIX)\lib /DEBUG
!if "$(CFG)" == "debug" || "$(CFG)" == "Debug"
ARFLAGS_NOLTCG = $(LDFLAGS_ARCH)
ARFLAGS = $(LDFLAGS_ARCH)
LDFLAGS_NOLTCG = $(LDFLAGS_BASE)
LDFLAGS = $(LDFLAGS_BASE)
!else
ARFLAGS_NOLTCG = $(LDFLAGS_ARCH) /LTCG
ARFLAGS = $(ARFLAGS_NOLTCG) /LTCG
LDFLAGS_NOLTCG = $(LDFLAGS_BASE) /opt:ref
LDFLAGS = $(LDFLAGS_NOLTCG) /LTCG
!endif
!endif
## This file is part of glibmm.
msvc_net2017_data = \
glibmm.sln \
glibmm-build-defines.props \
glibmm-install.props \
glibmm-version-paths.props \
gendef/gendef.cc \
gendef.vcxproj \
gendef.vcxproj.filters \
glibmm.vcxproj \
glibmm.vcxproj.filters \
glibmm/glibmmconfig.h \
glibmm/glibmm.rc \
giomm.vcxproj \
giomm.vcxproj.filters \
giomm/giommconfig.h \
giomm/giomm.rc \
giomm_simple.vcxproj \
giomm_simple.vcxproj.filters \
glibmm_value.vcxproj \
glibmm_value.vcxproj.filters \
compose.vcxproj \
compose.vcxproj.filters \
dispatcher.vcxproj \
dispatcher.vcxproj.filters \
dispatcher2.vcxproj \
dispatcher2.vcxproj.filters \
markup.vcxproj \
markup.vcxproj.filters \
options.vcxproj \
options.vcxproj.filters \
thread.vcxproj \
thread.vcxproj.filters \
threadpool.vcxproj \
threadpool.vcxproj.filters \
keyfile.vcxproj \
keyfile.vcxproj.filters \
properties.vcxproj \
properties.vcxproj.filters \
regex.vcxproj \
regex.vcxproj.filters \
resolver.vcxproj \
resolver.vcxproj.filters \
socket-client.vcxproj \
socket-client.vcxproj.filters \
socket-server.vcxproj \
socket-server.vcxproj.filters \
install.vcxproj
msvc_nmake_data = \
build-rules-msvc.mak \
config-msvc.mak \
create-lists.bat \
create-lists-msvc.mak \
detectenv-msvc.mak \
gendef/gendef.cc \
generate-msvc.mak \
glibmm/glibmmconfig.h \
glibmm/glibmm.rc \
giomm/giommconfig.h \
giomm/giomm.rc \
info-msvc.mak \
install.mak \
Makefile.vc
# 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)\gendef \
$(CFG)\$(PLAT)\glibmm \
$(CFG)\$(PLAT)\giomm \
$(CFG)\$(PLAT)\glibmm-ex \
$(CFG)\$(PLAT)\giomm-ex \
$(CFG)\$(PLAT)\glibmm-tests \
$(CFG)\$(PLAT)\giomm-tests:
@-mkdir $@
# Generate .def files
$(CFG)\$(PLAT)\glibmm\glibmm.def: $(GENDEF) $(CFG)\$(PLAT)\glibmm $(glibmm_OBJS)
$(CFG)\$(PLAT)\gendef.exe $@ $(GLIBMM_LIBNAME) $(CFG)\$(PLAT)\glibmm\*.obj
$(CFG)\$(PLAT)\giomm\giomm.def: $(GENDEF) $(CFG)\$(PLAT)\giomm $(giomm_OBJS)
$(CFG)\$(PLAT)\gendef.exe $@ $(GIOMM_LIBNAME) $(CFG)\$(PLAT)\giomm\*.obj
# Compile schema for giomm settings example
$(CFG)\$(PLAT)\gschema.compiled: ..\examples\settings\org.gtkmm.demo.gschema.xml
$(GLIB_COMPILE_SCHEMAS) --targetdir=$(CFG)\$(PLAT) ..\examples\settings
\ No newline at end of file
# NMake Makefile portion for displaying config info
all-build-info:
@echo.
@echo ----------
@echo Build info
@echo ---------
@echo Build Type: $(CFG)
help: