pkg-config/nmake/Makefile.vc
Chun-wei Fan efeff732fb NMake Makefiles: Split out build rules
Like the previous commit, we split out the build rules so that we keep
Makefile.vc as clean as possible, as we want to support building pkg-config
with the bundled copy of GLib with the NMake Makefiles as well.
2023-09-18 12:07:41 +08:00

66 lines
1.7 KiB
Text

# Note: This does assume an existing GLib installation!
# Visual Studio builds of GLib does not need an existing pkg-config
# installation, so build GLib first before using this.
# Set these if necessary. If building from GLib's included
# Visual Studio projects, this should be able to locate the GLib build
# out-of-the-box if they were not moved. GLib's headers will be found
# in $(INCLUDEDIR)\glib-2.0 and $(LIBDIR)\glib-2.0\include
# and its import library will be found in $(LIBDIR).
!ifndef GLIB_PREFIX
GLIB_PREFIX = ..\vs$(VSVER)\$(PLAT)
!endif
!ifndef INCLUDEDIR
INCLUDEDIR = $(GLIB_PREFIX)\include
!endif
!ifndef LIBDIR
LIBDIR = $(GLIB_PREFIX)\lib
!endif
# The items below this line should not be changed, unless one is maintaining
# the NMake Makefiles.
!include detectenv-msvc.mak
!if "$(VALID_CFGSET)" == "TRUE"
CFLAGS = $(CFLAGS_ADD) /W3 /Zi /FImsvc_recommended_pragmas.h /I. \
/I.\vs$(VSVER)\$(CFG)\$(PLAT)\pkg-config \
/I$(INCLUDEDIR)\glib-2.0 \
/I$(LIBDIR)\glib-2.0\include
# PKG_CONFIG_SYSTEM_INCLUDE_PATH and PKG_CONFIG_SYSTEM_LIBRARY_PATH only
# work for GCC builds for now, so just set this to nothing for now
pkg_config_CFLAGS = \
$(CFLAGS) \
/DHAVE_CONFIG_H \
/DPKG_CONFIG_SYSTEM_INCLUDE_PATH="\"\"" \
/DPKG_CONFIG_SYSTEM_LIBRARY_PATH="\"\""
LDFLAGS_BASE = $(LDFLAGS_ARCH) /libpath:$(LIBDIR) /DEBUG
NULL=
!if "$(CFG)" == "debug"
LDFLAGS = $(LDFLAGS_BASE)
!else
LDFLAGS = $(LDFLAGS_BASE) /opt:ref /LTCG
!endif
!include ..\Makefile.sources
!include create-lists-msvc.mak
pkg_config_LIBS = glib-2.0.lib
all: vs$(VSVER)\$(CFG)\$(PLAT)\pkg-config.exe
!include build-rules-msvc.mak
!else
all:
@echo You need to specify a valid configuration, via
@echo CFG=release or CFG=debug
!endif