Skip to content

Commit f0beebd

Browse files
committed
Merge branch 'ab/make-sparse-for-real'
Prevent "make sparse" from running for the source files that haven't been modified. * ab/make-sparse-for-real: Makefile: make the "sparse" target non-.PHONY
2 parents d7bc852 + c234e8a commit f0beebd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@
225225
*.lib
226226
*.res
227227
*.sln
228+
*.sp
228229
*.suo
229230
*.ncb
230231
*.vcproj

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2903,11 +2903,13 @@ check-sha1:: t/helper/test-tool$X
29032903

29042904
SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))
29052905

2906-
$(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
2906+
$(SP_OBJ): %.sp: %.c %.o GIT-CFLAGS
29072907
$(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \
2908-
$(SPARSE_FLAGS) $(SP_EXTRA_FLAGS) $<
2908+
-Wsparse-error \
2909+
$(SPARSE_FLAGS) $(SP_EXTRA_FLAGS) $< && \
2910+
>$@
29092911

2910-
.PHONY: sparse $(SP_OBJ)
2912+
.PHONY: sparse
29112913
sparse: $(SP_OBJ)
29122914

29132915
EXCEPT_HDRS := $(GENERATED_H) unicode-width.h compat/% xdiff/%
@@ -3235,6 +3237,7 @@ clean: profile-clean coverage-clean cocciclean
32353237
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
32363238
$(RM) $(TEST_PROGRAMS)
32373239
$(RM) $(FUZZ_PROGRAMS)
3240+
$(RM) $(SP_OBJ)
32383241
$(RM) $(HCC)
32393242
$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json
32403243
$(RM) -r po/build/

0 commit comments

Comments
 (0)