>From 5222bfc6a20558166028a7a51bba5233eb4ded41 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 10 Apr 2020 19:22:07 +0200 Subject: [PATCH] win32: allow passing *FLAGS on command line nmake is a primitive tool, so this is a primitive implementation: append CFLAGS_ADD etc. variables. Command line variables should be appended to allow overriding flags set in the makefile. It doesn't work to pass in CFLAGS like in make because that always overrides the assignments in the makefile. It doesn't work to pass in CFLAGS, then CFLAGS_ADD=$(CFLAGS) !UNDEF CFLAGS ... CFLAGS=$(CFLAGS) $(CFLAGS_ADD) because that's a cyclical definition in nmake. --- win32/Makefile.msvc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc index f6a0182d..76b7e1c5 100644 --- a/win32/Makefile.msvc +++ b/win32/Makefile.msvc @@ -106,6 +106,11 @@ CFLAGS = $(CFLAGS) /D "NDEBUG" /O2 LDFLAGS = $(LDFLAGS) !endif +# append CFLAGS etc. passed on command line +CPPFLAGS = $(CPPFLAGS) $(CPPFLAGS_ADD) +CFLAGS = $(CFLAGS) $(CFLAGS_ADD) +LDFLAGS = $(LDFLAGS) $(LDFLAGS_ADD) + # Libxml object files. XML_OBJS = $(XML_INTDIR)\buf.obj\ $(XML_INTDIR)\c14n.obj\ -- 2.25.2