Skip to content

Commit f371984

Browse files
committed
Makefile: drop GEN_HDRS
When ebb7baf ("Makefile: add a hdr-check target", 2018-09-19) implemented hdr-check target, it wanted to leave some header files exempt from the stricter check the target implements, and added GEN_HDRS macro. This however is probably a bad move for two reasons: - If we value the header cleanliness check, we eventually want to teach our header generating scripts to produce clean headers. Keeping the blanket "generated headers can be left as dirty as we want" exception does not nudge us in the right direction. - There is a list of generated header files, GENERATED_H, which is used to keep track of dependencies. Presence of GEN_HDRS that is too similarly named would confuse developers who are adding new generated header files which list to add theirs. - Even though unicode-width.h could be generated using a contrib/ script, as far as our build infrastructure is concerned, it is a source file that is tracked in the source control system. Its presence in GEN_HDRS list is doubly misleading. Get rid of GEN_HDRS, which is used only once to list the headers we do not run hdr-check test on, and instead explicitly list that the ones, either tracked or generated, that we exempt from the test. This allows GENERATED_H to be the sole "here are build artifact header files that are expendable" list, so use it in the clean target to $(RM) them. Signed-off-by: Junio C Hamano <[email protected]>
1 parent ad05a3d commit f371984

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,8 +2779,7 @@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
27792779
.PHONY: sparse $(SP_OBJ)
27802780
sparse: $(SP_OBJ)
27812781

2782-
GEN_HDRS := command-list.h unicode-width.h
2783-
EXCEPT_HDRS := $(GEN_HDRS) compat/% xdiff/%
2782+
EXCEPT_HDRS := command-list.h unicode-width.h compat/% xdiff/%
27842783
ifndef GCRYPT_SHA256
27852784
EXCEPT_HDRS += sha256/gcrypt.h
27862785
endif
@@ -3105,7 +3104,7 @@ clean: profile-clean coverage-clean cocciclean
31053104
$(RM) $(HCC)
31063105
$(RM) -r bin-wrappers $(dep_dirs)
31073106
$(RM) -r po/build/
3108-
$(RM) *.pyc *.pyo */*.pyc */*.pyo command-list.h $(ETAGS_TARGET) tags cscope*
3107+
$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*
31093108
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
31103109
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
31113110
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz

0 commit comments

Comments
 (0)