Blame win32/introspection-msvc.mak

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