Skip to content

Commit 11c1b5c

Browse files
pks-tgitster
authored andcommitted
Makefile: fix sparse dependency on GENERATED_H
The "check" Makefile target is essentially an alias around the "sparse" target. The one difference though is that it will tell users to instead run the "test" target in case they do not have sparse(1) installed, as chances are high that they wanted to execute the test suite rather than doing semantic checks. But even though the "check" target ultimately just ends up executing `make sparse`, it still depends on our generated headers. This does not make any sense though: they are irrelevant for the "test" target advice, and if these headers are required for the "sparse" target they must be declared as a dependency on the aliased target, not the alias. But even moving the dependency to the "sparse" target is wrong, as concurrent builds may then end up generating the headers and running sparse concurrently. Instead, we make them a dependency of the specific objects. While that is overly broad, it does ensure correct ordering. The alternative, specifying which file depends on what generated header explicitly, feels rather unmaintainable. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fe7066a commit 11c1b5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3254,7 +3254,7 @@ check-sha1:: t/helper/test-tool$X
32543254

32553255
SP_OBJ = $(patsubst %.o,%.sp,$(OBJECTS))
32563256

3257-
$(SP_OBJ): %.sp: %.c %.o
3257+
$(SP_OBJ): %.sp: %.c %.o $(GENERATED_H)
32583258
$(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \
32593259
-Wsparse-error \
32603260
$(SPARSE_FLAGS) $(SP_EXTRA_FLAGS) $< && \
@@ -3295,7 +3295,7 @@ style:
32953295
git clang-format --style file --diff --extensions c,h
32963296

32973297
.PHONY: check
3298-
check: $(GENERATED_H)
3298+
check:
32993299
@if sparse; \
33003300
then \
33013301
echo >&2 "Use 'make sparse' instead"; \

0 commit comments

Comments
 (0)