NMake: Move NMake Makefiles into its own subdir

Makes the $(srcroot) a bit cleaner.  Also don't track the build artfacts
as well as config.h.win32, since it is generated when building a release
tarball.
This commit is contained in:
Chun-wei Fan 2023-05-03 12:37:57 +08:00
parent 091cceff3b
commit 5eb56ec08a
8 changed files with 21 additions and 14 deletions

View file

@ -6,7 +6,7 @@ endif
# Normally we'd want glib to be part of DIST_SUBDIRS unconditionally,
# but distclean gets broken unless we always run glib's configure
SUBDIRS = $(GLIB_SUBDIR) . check
SUBDIRS = $(GLIB_SUBDIR) . check nmake
DIST_SUBDIRS = $(SUBDIRS)
# Escape paths properly on windows
@ -45,11 +45,7 @@ m4dir = $(datadir)/aclocal
m4_DATA = pkg.m4
dist_doc_DATA = pkg-config-guide.html
dist_man_MANS = pkg-config.1
EXTRA_DIST = \
README.win32 \
detectenv-msvc.mak \
Makefile.vc \
config.h.win32
EXTRA_DIST = README.win32
# gcov test coverage
gcov:

View file

@ -33,14 +33,18 @@ unlike the normal autotools builds. The headers and libs either need to
be found in your default %INCLUDE% and %LIB% respectively, or they need
to be found in $(GLIB_PREFIX)\include and $(GLIB_PREFIX)\lib respectively;
please see Makefile.vc for adjusting $(GLIB_PREFIX) to suit your needs.
To build pkg-config with MSVC, run in a Visual Studio command prompt:
To build pkg-config with MSVC, run in a Visual Studio command prompt from
the "nmake" subdirectory:
"nmake /f Makefile.vc CFG=release" (release builds) -or-
"nmake /f Makefile.vc CFG=debug" (debug builds)
The resulting pkg-config.exe will be found in [release|debug]\[win32|x64];
a 'clean' target is supported to clean up the build. MSVC 2008
through 2015 is supported; older versions may work as well but is not
tested. Note that building with the glib bundled with this source
The resulting pkg-config.exe will be found in
nmake\vsXX\[release|debug]\[win32|x64|arm64], where vsXX stands for the
short Visual Studio version, which is 9 for 2008, 10 for 2010, 14 for 2015
and so on; a 'clean' target is supported to clean up the build. MSVC 2008
through 2022 is supported, for the x86, x86_64 (x64) and aarch64 (ARM64)
architectures; older versions may work as well but is not tested. Note
that building with the glib bundled with this source
distribution is not currently supported-the glib DLL and all of its
dependent DLLs are required at runtime.

View file

@ -258,6 +258,7 @@ Makefile
pkg.m4
check/Makefile
check/config.sh
config.h.win32
nmake/Makefile
nmake/config.h.win32
])
AC_OUTPUT

2
nmake/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
config.h.win32
vs*/

4
nmake/Makefile.am Normal file
View file

@ -0,0 +1,4 @@
EXTRA_DIST = \
detectenv-msvc.mak \
Makefile.vc \
config.h.win32

View file

@ -49,7 +49,7 @@ LDFLAGS = $(LDFLAGS_BASE)
LDFLAGS = $(LDFLAGS_BASE) /opt:ref /LTCG
!endif
!include Makefile.sources
!include ..\Makefile.sources
# Convert the source (*.c) listing to object (.obj) listing in
# another NMake Makefile module, include it, and clean it up.
@ -70,7 +70,7 @@ LDFLAGS = $(LDFLAGS_BASE) /opt:ref /LTCG
pkg_config_LIBS = glib-2.0.lib
{}.c{vs$(VSVER)\$(CFG)\$(PLAT)\pkg-config\}.obj::
{..\}.c{vs$(VSVER)\$(CFG)\$(PLAT)\pkg-config\}.obj::
@if not exist vs$(VSVER)\$(CFG)\$(PLAT)\pkg-config\ md vs$(VSVER)\$(CFG)\$(PLAT)\pkg-config
@if not exist vs$(VSVER)\$(CFG)\$(PLAT)\pkg-config\config.h copy config.h.win32 vs$(VSVER)\$(CFG)\$(PLAT)\pkg-config\config.h
$(CC) $(pkg_config_CFLAGS) /Fovs$(VSVER)\$(CFG)\$(PLAT)\pkg-config\ /Fdvs$(VSVER)\$(CFG)\$(PLAT)\pkg-config\ /c @<<