1 # Common Utility NMake Makefile Template
2 # Used to Generate Introspection files for various Projects
4 # Can Override with env vars as needed
5 # You will need to have built gobject-introspection for this to work.
6 # Change or pass in or set the following to suit your environment
8 BASEDIR = ..\..\vs$(VSVER)\$(PLAT)
9 GIR_SUBDIR = share\gir-1.0
10 GIR_TYPELIBDIR = lib\girepository-1.0
11 G_IR_SCANNER = $(BASEDIR)\bin\g-ir-scanner
12 G_IR_COMPILER = $(BASEDIR)\bin\g-ir-compiler.exe
13 G_IR_INCLUDEDIR = $(BASEDIR)\$(GIR_SUBDIR)
14 G_IR_TYPELIBDIR = $(BASEDIR)\$(GIR_TYPELIBDIR)
16 # Note: The PYTHON2 must be a Python 2.6.x or 2.7.x Interpretor!
17 # Either having python.exe from Python 2.6.x/2.7.x in your PATH will work
18 # or passing in PYTHON2=<full path to your Python 2.6.x/2.7.x interpretor> will do
20 # This is required, and gobject-introspection needs to be built
21 # before this can be successfully run.
24 # Don't change anything following this line!
25 VALID_PKG_CONFIG_PATH = FALSE
26 VALID_GCC_INSTPATH = FALSE
28 MSG_INVALID_PKGCONFIG = You must set or specifiy a valid PKG_CONFIG_PATH
29 MSG_INVALID_MINGWDIR = You must set or specifiy a valid MINGWDIR, where gcc.exe can be found in %MINGWDIR%\bin
30 MSG_INVALID_CFG = You need to specify or set CFG to be release or debug to use this Makefile to build the Introspection Files
34 BUILD_INTROSPECTION = TRUE
36 !if ![pkg-config --print-errors --errors-to-stdout $(CHECK_PACKAGE) > pkgconfig.x] \
38 && ![set file="pkgconfig.x"] \
39 && ![FOR %A IN (%file%) DO @echo PKG_CHECK_SIZE=%~zA > pkgconfig.chksize] \
40 && ![del $(ERRNUL) /q/f pkgconfig.x]
43 !include pkgconfig.chksize
44 !if "$(PKG_CHECK_SIZE)" == "0"
45 VALID_PKG_CONFIG_PATH = TRUE
47 VALID_PKG_CONFIG_PATH = FALSE
50 !if ![IF EXIST %MINGWDIR%\bin\gcc.exe @echo VALID_GCC_INSTPATH=TRUE > gcccheck.x]
53 !if ![IF NOT EXIST %MINGWDIR%\bin\gcc.exe @echo VALID_GCC_INSTPATH=FALSE > gcccheck.x]
58 !if ![del $(ERRNUL) /q/f pkgconfig.chksize gcccheck.x]
62 !if "$(CFG)" == "release" || "$(CFG)" == "debug"
66 !if "$(VALID_GCC_INSTPATH)" != "TRUE"
67 BUILD_INTROSPECTION = FALSE
68 ERROR_MSG = $(MSG_INVALID_MINGWDIR)
71 !if "$(VALID_PKG_CONFIG_PATH)" != "TRUE"
72 BUILD_INTROSPECTION = FALSE
73 ERROR_MSG = $(MSG_INVALID_PKGCONFIG)
76 !if "$(VALID_CFGSET)" != "TRUE"
77 BUILD_INTROSPECTION = FALSE
78 ERROR_MSG = $(MSG_INVALID_CFG)