Blame build/win32/introspection-msvc.mak

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