{"thread":{"id":"50402","subject":"[PATCH v2 2/2] Makefile: improve SPARSE_FLAGS customisation","startedAt":"2019-02-05T02:27:54Z","lastAt":"2019-02-05T02:27:54Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"368509","messageId":"3933d9e9-eb1a-c3ee-2aee-e24f99ac87d3@ramsayjones.plus.com","threadId":"50402","inReplyTo":null,"subject":"[PATCH v2 2/2] Makefile: improve SPARSE_FLAGS customisation","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2019-02-05T02:27:48Z","receivedAt":"2019-02-05T02:27:54Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nIn order to enable greater user customisation of the SPARSE_FLAGS\nvariable, we introduce a new SP_EXTRA_FLAGS variable to use for\ntarget specific settings. Without using the new variable, setting\nthe SPARSE_FLAGS on the 'make' command-line would also override the\nvalue set by the target-specific rules in the Makefile (effectively\nmaking them useless). Also, this enables the SP_EXTRA_FLAGS to be\nused in the future for any other internal customisations, such as\nfor some platform specific values.\n\nIn addition, we initialise the SPARSE_FLAGS to the default (empty)\nvalue using a conditional assignment (?=). This allows SPARSE_FLAGS\nto be set from the environment as well as from the command-line.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n Makefile | 14 +++++++++-----\n 1 file changed, 9 insertions(+), 5 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 6e8d017e8e..fcb7575e1b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -574,7 +574,11 @@ SPATCH = spatch\n \n export TCL_PATH TCLTK_PATH\n \n-SPARSE_FLAGS =\n+# user customisation variable for 'sparse' target\n+SPARSE_FLAGS ?=\n+# internal/platform customisation variable for 'sparse'\n+SP_EXTRA_FLAGS =\n+\n SPATCH_FLAGS = --all-includes --patch .\n \n \n@@ -2369,10 +2373,10 @@ gettext.sp gettext.s gettext.o: GIT-PREFIX\n gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \\\n \t-DGIT_LOCALE_PATH='\"$(localedir_relative_SQ)\"'\n \n-http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SPARSE_FLAGS += \\\n+http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SP_EXTRA_FLAGS += \\\n \t-DCURL_DISABLE_TYPECHECK\n \n-pack-revindex.sp: SPARSE_FLAGS += -Wno-memcpy-max-count\n+pack-revindex.sp: SP_EXTRA_FLAGS += -Wno-memcpy-max-count\n \n ifdef NO_EXPAT\n http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT\n@@ -2386,7 +2390,7 @@ endif\n ifdef USE_NED_ALLOCATOR\n compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \\\n \t-DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR\n-compat/nedmalloc/nedmalloc.sp: SPARSE_FLAGS += -Wno-non-pointer-null\n+compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null\n endif\n \n git-%$X: %.o GIT-LDFLAGS $(GITLIBS)\n@@ -2710,7 +2714,7 @@ SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))\n \n $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE\n \t$(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \\\n-\t\t$(SPARSE_FLAGS) $<\n+\t\t$(SPARSE_FLAGS) $(SP_EXTRA_FLAGS) $<\n \n .PHONY: sparse $(SP_OBJ)\n sparse: $(SP_OBJ)\n-- \n2.20.0\n"}]}