Blame build/win32/introspection-msvc.mak

Packit Service fb6fa5
# Common NMake Makefile module for checking the build environment is sane
Packit Service fb6fa5
# for building introspection files under MSVC/NMake.
Packit Service fb6fa5
# This can be copied from $(gi_srcroot)\build\win32 for GNOME items
Packit Service fb6fa5
# that support MSVC builds and introspection under MSVC.
Packit Service fb6fa5
Packit Service fb6fa5
# Can override with env vars as needed
Packit Service fb6fa5
# You will need to have built gobject-introspection for this to work.
Packit Service fb6fa5
# Change or pass in or set the following to suit your environment
Packit Service fb6fa5
Packit Service fb6fa5
!if "$(PREFIX)" == ""
Packit Service fb6fa5
PREFIX = ..\..\..\vs$(VSVER)\$(PLAT)
Packit Service fb6fa5
!endif
Packit Service fb6fa5
Packit Service fb6fa5
!if ![setlocal]		&& \
Packit Service fb6fa5
    ![set PFX=$(PREFIX)]	&& \
Packit Service fb6fa5
    ![for %P in (%PFX%) do @echo PREFIX_FULL=%~dpnfP > pfx.x]
Packit Service fb6fa5
!endif
Packit Service fb6fa5
!include pfx.x
Packit Service fb6fa5
Packit Service fb6fa5
!if "$(PKG_CONFIG_PATH)" == ""
Packit Service fb6fa5
PKG_CONFIG_PATH=$(PREFIX_FULL)\lib\pkgconfig
Packit Service fb6fa5
!else
Packit Service fb6fa5
PKG_CONFIG_PATH=$(PREFIX_FULL)\lib\pkgconfig;$(PKG_CONFIG_PATH)
Packit Service fb6fa5
!endif
Packit Service fb6fa5
Packit Service fb6fa5
!if ![del $(ERRNUL) /q/f pfx.x]
Packit Service fb6fa5
!endif
Packit Service fb6fa5
Packit Service fb6fa5
# Note: The PYTHON must be the Python release series that was used to build
Packit Service fb6fa5
# the GObject-introspection scanner Python module!
Packit Service fb6fa5
# Either having python.exe your PATH will work or passing in
Packit Service fb6fa5
# PYTHON=<full path to your Python interpretor> will do
Packit Service fb6fa5
Packit Service fb6fa5
# This is required, and gobject-introspection needs to be built
Packit Service fb6fa5
# before this can be successfully run.
Packit Service fb6fa5
!if "$(PYTHON)" == ""
Packit Service fb6fa5
PYTHON=python
Packit Service fb6fa5
!endif
Packit Service fb6fa5
Packit Service fb6fa5
# Path to the pkg-config tool, if not already in the PATH
Packit Service fb6fa5
!if "$(PKG_CONFIG)" == ""
Packit Service fb6fa5
PKG_CONFIG=pkg-config
Packit Service fb6fa5
!endif
Packit Service fb6fa5
Packit Service fb6fa5
# Don't change anything following this line!
Packit Service fb6fa5
Packit Service fb6fa5
GIR_SUBDIR = share\gir-1.0
Packit Service fb6fa5
GIR_TYPELIBDIR = lib\girepository-1.0
Packit Service fb6fa5
G_IR_SCANNER = $(PREFIX)\bin\g-ir-scanner
Packit Service fb6fa5
G_IR_COMPILER = $(PREFIX)\bin\g-ir-compiler.exe
Packit Service fb6fa5
G_IR_INCLUDEDIR = $(PREFIX)\$(GIR_SUBDIR)
Packit Service fb6fa5
G_IR_TYPELIBDIR = $(PREFIX)\$(GIR_TYPELIBDIR)
Packit Service fb6fa5
Packit Service fb6fa5
VALID_PKG_CONFIG_PATH = FALSE
Packit Service fb6fa5
Packit Service fb6fa5
MSG_INVALID_PKGCONFIG = You must set or specifiy a valid PKG_CONFIG_PATH
Packit Service fb6fa5
MSG_INVALID_CFG = You need to specify or set CFG to be release or debug to use this Makefile to build the Introspection Files
Packit Service fb6fa5
Packit Service fb6fa5
ERROR_MSG =
Packit Service fb6fa5
Packit Service fb6fa5
BUILD_INTROSPECTION = TRUE
Packit Service fb6fa5
Packit Service fb6fa5
!if ![set PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)]	\
Packit Service fb6fa5
	&& ![$(PKG_CONFIG) --print-errors --errors-to-stdout $(CHECK_PACKAGE) > pkgconfig.x]	\
Packit Service fb6fa5
	&& ![setlocal]	\
Packit Service fb6fa5
	&& ![set file="pkgconfig.x"]	\
Packit Service fb6fa5
	&& ![FOR %A IN (%file%) DO @echo PKG_CHECK_SIZE=%~zA > pkgconfig.chksize]	\
Packit Service fb6fa5
	&& ![del $(ERRNUL) /q/f pkgconfig.x]
Packit Service fb6fa5
!endif
Packit Service fb6fa5
Packit Service fb6fa5
!include pkgconfig.chksize
Packit Service fb6fa5
!if "$(PKG_CHECK_SIZE)" == "0"
Packit Service fb6fa5
VALID_PKG_CONFIG_PATH = TRUE
Packit Service fb6fa5
!else
Packit Service fb6fa5
VALID_PKG_CONFIG_PATH = FALSE
Packit Service fb6fa5
!endif
Packit Service fb6fa5
Packit Service fb6fa5
!if ![del $(ERRNUL) /q/f pkgconfig.chksize]
Packit Service fb6fa5
!endif
Packit Service fb6fa5
Packit Service fb6fa5
VALID_CFGSET = FALSE
Packit Service fb6fa5
!if "$(CFG)" == "release" || "$(CFG)" == "debug" || "$(CFG)" == "Release" || "$(CFG)" == "Debug"
Packit Service fb6fa5
VALID_CFGSET = TRUE
Packit Service fb6fa5
!endif
Packit Service fb6fa5
Packit Service fb6fa5
!if "$(VALID_PKG_CONFIG_PATH)" != "TRUE"
Packit Service fb6fa5
BUILD_INTROSPECTION = FALSE
Packit Service fb6fa5
ERROR_MSG = $(MSG_INVALID_PKGCONFIG)
Packit Service fb6fa5
!endif
Packit Service fb6fa5
Packit Service fb6fa5
!if "$(VALID_CFGSET)" != "TRUE"
Packit Service fb6fa5
BUILD_INTROSPECTION = FALSE
Packit Service fb6fa5
ERROR_MSG = $(MSG_INVALID_CFG)
Packit Service fb6fa5
!endif