cocci: split off "--all-includes" from SPATCH_FLAGS

Per the rationale in 7b63ea57500 (Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS, 2022-07-05) we have certain flags that are truly mandatory, such as "--sp-file" and "--patch .". The "--all-includes" flag is also critical, but per [1] we might want to ad-hoc tweak it occasionally for testing or one-offs. But being unable to set e.g. SPATCH_FLAGS="--verbose-parsing" without breaking how our "spatch" works isn't ideal, i.e. before this we'd need to know about the default include flags, and specify: SPATCH_FLAGS="--all-includes --verbose-parsing". If we were then to change the default include flag (e.g. to "--recursive-includes") in the future any such one-off commands would need to be correspondingly updated. Let's instead leave the SPATCH_FLAGS for the user, while creating a new SPATCH_INCLUDE_FLAGS to allow for ad-hoc testing of the include strategy itself. 1. https://lore.kernel.org/git/20220823095733.58685-1-szeder.dev@gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>

Ævar Arnfjörð Bjarmason committed Nov 1, 2022 at 23:35 UTC 60cfad9cbe93457dd4afde1798a98bfde73855a1
1 file changed +4 -1
Makefile
+4 -1
@@ -1295,7 +1295,8 @@ SANITIZE_LEAK =
1295 SANITIZE_ADDRESS =
1296
1297 # For the 'coccicheck' target
1298 -SPATCH_FLAGS = --all-includes
1298 +SPATCH_INCLUDE_FLAGS = --all-includes
1299 +SPATCH_FLAGS =
1300 SPATCH_TEST_FLAGS =
1301 # Setting SPATCH_BATCH_SIZE higher will
1302 # usually result in less CPU usage at the cost of higher peak memory.
@@ -1305,6 +1306,7 @@ SPATCH_BATCH_SIZE = 1
1306 # Rebuild 'coccicheck' if $(SPATCH), its flags etc. change
1307 TRACK_SPATCH_DEFINES =
1308 TRACK_SPATCH_DEFINES += $(SPATCH)
1309 +TRACK_SPATCH_DEFINES += $(SPATCH_INCLUDE_FLAGS)
1310 TRACK_SPATCH_DEFINES += $(SPATCH_FLAGS)
1311 TRACK_SPATCH_DEFINES += $(SPATCH_TEST_FLAGS)
1312 TRACK_SPATCH_DEFINES += $(SPATCH_BATCH_SIZE)
@@ -3177,6 +3179,7 @@ $(COCCI_PATCHES): %.patch: %
3179 fi; \
3180 if ! echo $(COCCI_SOURCES) | xargs $$limit \
3181 $(SPATCH) $(SPATCH_FLAGS) \
3182 + $(SPATCH_INCLUDE_FLAGS) \
3183 --sp-file $< --patch . \
3184 >$@+ 2>$@.log; \
3185 then \