From e7a19539996855f3e34597b53420fbf8bcc5facf Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 18 Sep 2023 12:01:35 +0800 Subject: [PATCH] NMake Makefiles: Split out object listing portion We want to eventually support building pkg-config using the built-in copy of GLib with the NMake Makefiles, and we want to keep Makefile.vc as clean as possible. --- nmake/Makefile.am | 1 + nmake/Makefile.vc | 18 +----------------- nmake/create-lists-msvc.mak | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 nmake/create-lists-msvc.mak diff --git a/nmake/Makefile.am b/nmake/Makefile.am index bdcd4dd..51d32e9 100644 --- a/nmake/Makefile.am +++ b/nmake/Makefile.am @@ -1,4 +1,5 @@ EXTRA_DIST = \ + create-lists-msvc.mak \ detectenv-msvc.mak \ Makefile.vc \ config.h.win32 diff --git a/nmake/Makefile.vc b/nmake/Makefile.vc index e62d3ae..eaf4ab1 100644 --- a/nmake/Makefile.vc +++ b/nmake/Makefile.vc @@ -50,23 +50,7 @@ LDFLAGS = $(LDFLAGS_BASE) /opt:ref /LTCG !endif !include ..\Makefile.sources - -# Convert the source (*.c) listing to object (.obj) listing in -# another NMake Makefile module, include it, and clean it up. - -!if [echo pkg_config_OBJS = \> objs_vs$(VSVER)_$(PLAT)_$(CFG).mak] -!endif - -!if [for %c in ($(pkg_config_SOURCES)) do @if "%~xc" == ".c" echo. vs^$(VSVER)\^$(CFG)\^$(PLAT)\pkg-config\%~nc.obj \>> objs_vs$(VSVER)_$(PLAT)_$(CFG).mak] -!endif - -!if [echo. ^$(NULL)>> objs_vs$(VSVER)_$(PLAT)_$(CFG).mak] -!endif - -!include objs_vs$(VSVER)_$(PLAT)_$(CFG).mak - -!if [del /f /q objs_vs$(VSVER)_$(PLAT)_$(CFG).mak] -!endif +!include create-lists-msvc.mak pkg_config_LIBS = glib-2.0.lib diff --git a/nmake/create-lists-msvc.mak b/nmake/create-lists-msvc.mak new file mode 100644 index 0000000..8658465 --- /dev/null +++ b/nmake/create-lists-msvc.mak @@ -0,0 +1,16 @@ +# Convert the source (*.c) listing to object (.obj) listing in +# another NMake Makefile module, include it, and clean it up. + +!if [echo pkg_config_OBJS = \> objs_vs$(VSVER)_$(PLAT)_$(CFG).mak] +!endif + +!if [for %c in ($(pkg_config_SOURCES)) do @if "%~xc" == ".c" echo. vs^$(VSVER)\^$(CFG)\^$(PLAT)\pkg-config\%~nc.obj \>> objs_vs$(VSVER)_$(PLAT)_$(CFG).mak] +!endif + +!if [echo. ^$(NULL)>> objs_vs$(VSVER)_$(PLAT)_$(CFG).mak] +!endif + +!include objs_vs$(VSVER)_$(PLAT)_$(CFG).mak + +!if [del /f /q objs_vs$(VSVER)_$(PLAT)_$(CFG).mak] +!endif \ No newline at end of file