1 # Common NMake Makefile module for checking the build environment is sane
2 # for building introspection files under MSVC/NMake.
3 # This can be copied from $(gi_srcroot)\build\win32 for GNOME items
4 # that support MSVC builds and introspection under MSVC.
6 # Can override with env vars as needed
7 # You will need to have built gobject-introspection for this to work.
8 # Change or pass in or set the following to suit your environment
11 PREFIX = ..\..\..\vs$(VSVER)\$(PLAT)
14 # Note: The PYTHON must be the Python release series that was used to build
15 # the GObject-introspection scanner Python module!
16 # Either having python.exe your PATH will work or passing in
17 # PYTHON=<full path to your Python interpretor> will do
19 # This is required, and gobject-introspection needs to be built
20 # before this can be successfully run.
25 # Don't change anything following this line!
27 GIR_SUBDIR = share\gir-1.0
28 GIR_TYPELIBDIR = lib\girepository-1.0
29 G_IR_SCANNER = $(PREFIX)\bin\g-ir-scanner
30 G_IR_COMPILER = $(PREFIX)\bin\g-ir-compiler.exe
31 G_IR_INCLUDEDIR = $(PREFIX)\$(GIR_SUBDIR)
32 G_IR_TYPELIBDIR = $(PREFIX)\$(GIR_TYPELIBDIR)
34 VALID_PKG_CONFIG_PATH = FALSE
36 MSG_INVALID_PKGCONFIG = You must set or specifiy a valid PKG_CONFIG_PATH
37 MSG_INVALID_CFG = You need to specify or set CFG to be release or debug to use this Makefile to build the Introspection Files
41 BUILD_INTROSPECTION = TRUE
43 !if ![pkg-config --print-errors --errors-to-stdout $(CHECK_PACKAGE) > pkgconfig.x] \
45 && ![set file="pkgconfig.x"] \
46 && ![FOR %A IN (%file%) DO @echo PKG_CHECK_SIZE=%~zA > pkgconfig.chksize] \
47 && ![del $(ERRNUL) /q/f pkgconfig.x]
50 !include pkgconfig.chksize
51 !if "$(PKG_CHECK_SIZE)" == "0"
52 VALID_PKG_CONFIG_PATH = TRUE
54 VALID_PKG_CONFIG_PATH = FALSE
57 !if ![del $(ERRNUL) /q/f pkgconfig.chksize]
61 !if "$(CFG)" == "release" || "$(CFG)" == "debug"
65 !if "$(VALID_PKG_CONFIG_PATH)" != "TRUE"
66 BUILD_INTROSPECTION = FALSE
67 ERROR_MSG = $(MSG_INVALID_PKGCONFIG)
70 !if "$(VALID_CFGSET)" != "TRUE"
71 BUILD_INTROSPECTION = FALSE
72 ERROR_MSG = $(MSG_INVALID_CFG)