gtk2/build/win32/gtk-introspection-msvc.mak
Chun-wei Fan 5ffbeeff91 MSVC builds: Improve introspection build process
To avoid confusion, have the NMake Makefiles output the built introspection
files in the same location where the binaries are built for the project
files, according to the Visual Studio version, platform and configuration
where the build is carried out.

Also make generating the introspection NMake snippet portion more robust to
source additions and removals by checking on Makefile changes too.
2019-01-18 16:25:49 +08:00

51 lines
1.3 KiB
Makefile

# NMake Makefile to build Introspection Files for GTK+
!include detectenv-msvc.mak
APIVERSION = 3.0
CHECK_PACKAGE = gdk-pixbuf-2.0 atk pangocairo gio-2.0
built_install_girs = \
vs$(VSVER)\$(CFG)\$(PLAT)\bin\Gdk-$(APIVERSION).gir \
vs$(VSVER)\$(CFG)\$(PLAT)\bin\GdkWin32-$(APIVERSION).gir \
vs$(VSVER)\$(CFG)\$(PLAT)\bin\Gtk-$(APIVERSION).gir
built_install_typelibs = \
vs$(VSVER)\$(CFG)\$(PLAT)\bin\Gdk-$(APIVERSION).typelib \
vs$(VSVER)\$(CFG)\$(PLAT)\bin\GdkWin32-$(APIVERSION).typelib \
vs$(VSVER)\$(CFG)\$(PLAT)\bin\Gtk-$(APIVERSION).typelib
!include introspection-msvc.mak
!if "$(BUILD_INTROSPECTION)" == "TRUE"
!if "$(PLAT)" == "x64"
AT_PLAT=x86_64
!else
AT_PLAT=i686
!endif
all: setgirbuildenv $(built_install_girs) $(built_install_typelibs)
setgirbuildenv:
@set PYTHONPATH=$(PREFIX)\lib\gobject-introspection
@set PATH=vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(PREFIX)\bin;$(PATH)
@set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)
@set LIB=vs$(VSVER)\$(CFG)\$(PLAT)\bin;$(LIB)
!include introspection.body.mak
install-introspection: all
@-copy vs$(VSVER)\$(CFG)\$(PLAT)\bin\*.gir "$(G_IR_INCLUDEDIR)"
@-copy /b vs$(VSVER)\$(CFG)\$(PLAT)\bin\*.typelib "$(G_IR_TYPELIBDIR)"
!else
all:
@-echo $(ERROR_MSG)
!endif
clean:
@-del /f/q vs$(VSVER)\$(CFG)\$(PLAT)\bin\*.typelib
@-del /f/q vs$(VSVER)\$(CFG)\$(PLAT)\bin\*.gir