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
)
15 ![set PFX
=$(PREFIX
)] && \
16 ![for
%P in
(%PFX
%) do @echo PREFIX_FULL
=%~dpnfP
> pfx.x
]
20 !if
"$(PKG_CONFIG_PATH)" == ""
21 PKG_CONFIG_PATH
=$(PREFIX_FULL
)\lib\pkgconfig
23 PKG_CONFIG_PATH
=$(PREFIX_FULL
)\lib\pkgconfig
;$(PKG_CONFIG_PATH
)
26 !if
![del
$(ERRNUL
) /q
/f pfx.x
]
29 # Note: The PYTHON must be the Python release series that was used to build
30 # the GObject-introspection scanner Python module!
31 # Either having python.exe your PATH will work or passing in
32 # PYTHON=<full path to your Python interpretor> will do
34 # This is required, and gobject-introspection needs to be built
35 # before this can be successfully run.
40 # Path to the pkg-config tool, if not already in the PATH
41 !if
"$(PKG_CONFIG)" == ""
45 # Don't change anything following this line!
47 GIR_SUBDIR
= share\gir-1.0
48 GIR_TYPELIBDIR
= lib\girepository-1.0
49 G_IR_SCANNER
= $(PREFIX
)\bin\g-ir-scanner
50 G_IR_COMPILER
= $(PREFIX
)\bin\g-ir-compiler.exe
51 G_IR_INCLUDEDIR
= $(PREFIX
)\
$(GIR_SUBDIR
)
52 G_IR_TYPELIBDIR
= $(PREFIX
)\
$(GIR_TYPELIBDIR
)
54 VALID_PKG_CONFIG_PATH
= FALSE
56 MSG_INVALID_PKGCONFIG
= You must set or specifiy a valid PKG_CONFIG_PATH
57 MSG_INVALID_CFG
= You need to specify or set CFG to be release or debug to use this Makefile to build the Introspection Files
61 BUILD_INTROSPECTION
= TRUE
63 !if
![set PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH
)] \
64 && ![$(PKG_CONFIG
) --print-errors
--errors-to-stdout
$(CHECK_PACKAGE
) > pkgconfig.x
] \
66 && ![set file
="pkgconfig.x"] \
67 && ![FOR
%A IN
(%file
%) DO @echo PKG_CHECK_SIZE
=%~zA
> pkgconfig.chksize
] \
68 && ![del
$(ERRNUL
) /q
/f pkgconfig.x
]
71 !include pkgconfig.chksize
72 !if
"$(PKG_CHECK_SIZE)" == "0"
73 VALID_PKG_CONFIG_PATH
= TRUE
75 VALID_PKG_CONFIG_PATH
= FALSE
78 !if
![del
$(ERRNUL
) /q
/f pkgconfig.chksize
]
82 !if
"$(CFG)" == "release" ||
"$(CFG)" == "debug" ||
"$(CFG)" == "Release" ||
"$(CFG)" == "Debug"
86 !if
"$(VALID_PKG_CONFIG_PATH)" != "TRUE"
87 BUILD_INTROSPECTION
= FALSE
88 ERROR_MSG
= $(MSG_INVALID_PKGCONFIG
)
91 !if
"$(VALID_CFGSET)" != "TRUE"
92 BUILD_INTROSPECTION
= FALSE
93 ERROR_MSG
= $(MSG_INVALID_CFG
)