Home | History | Annotate | Download | only in win32
      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.
      5 
      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
      9 
     10 !if "$(PREFIX)" == ""
     11 PREFIX = ..\..\..\vs$(VSVER)\$(PLAT)
     12 !endif
     13 
     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
     18 
     19 # This is required, and gobject-introspection needs to be built
     20 # before this can be successfully run.
     21 !if "$(PYTHON)" == ""
     22 PYTHON=python
     23 !endif
     24 
     25 # Don't change anything following this line!
     26 
     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)
     33 
     34 VALID_PKG_CONFIG_PATH = FALSE
     35 
     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
     38 
     39 ERROR_MSG =
     40 
     41 BUILD_INTROSPECTION = TRUE
     42 
     43 !if ![pkg-config --print-errors --errors-to-stdout $(CHECK_PACKAGE) > pkgconfig.x]	\
     44 	&& ![setlocal]	\
     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]
     48 !endif
     49 
     50 !include pkgconfig.chksize
     51 !if "$(PKG_CHECK_SIZE)" == "0"
     52 VALID_PKG_CONFIG_PATH = TRUE
     53 !else
     54 VALID_PKG_CONFIG_PATH = FALSE
     55 !endif
     56 
     57 !if ![del $(ERRNUL) /q/f pkgconfig.chksize]
     58 !endif
     59 
     60 VALID_CFGSET = FALSE
     61 !if "$(CFG)" == "release" || "$(CFG)" == "debug"
     62 VALID_CFGSET = TRUE
     63 !endif
     64 
     65 !if "$(VALID_PKG_CONFIG_PATH)" != "TRUE"
     66 BUILD_INTROSPECTION = FALSE
     67 ERROR_MSG = $(MSG_INVALID_PKGCONFIG)
     68 !endif
     69 
     70 !if "$(VALID_CFGSET)" != "TRUE"
     71 BUILD_INTROSPECTION = FALSE
     72 ERROR_MSG = $(MSG_INVALID_CFG)
     73 !endif
     74