Makefile: drop CHECK_HEADER_DEPENDENCIES code

This code was useful when we kept a static list of header files, and it was easy to forget to update it. Since the last commit, we generate the list dynamically. Technically this could still be used to find a dependency that our dynamic check misses (e.g., a header file without a ".h" extension). But that is reasonably unlikely to be added, and even less likely to be noticed by this tool (because it has to be run manually)., It is not worth carrying around the cruft in the Makefile. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Aug 22, 2014 at 00:33 UTC 14821f88224b7e6641070fb4971674971886f1ed
1 file changed -59
Makefile
-59
@@ -317,9 +317,6 @@ all::
317 # dependency rules. The default is "auto", which means to use computed header
318 # dependencies if your compiler is detected to support it.
319 #
320 -# Define CHECK_HEADER_DEPENDENCIES to check for problems in the hard-coded
321 -# dependency rules.
322 -#
320 # Define NATIVE_CRLF if your platform uses CRLF for line endings.
321 #
322 # Define XDL_FAST_HASH to use an alternative line-hashing method in
@@ -904,11 +901,6 @@ sysconfdir = etc
901 endif
902 endif
903
907 -ifdef CHECK_HEADER_DEPENDENCIES
908 -COMPUTE_HEADER_DEPENDENCIES = no
909 -USE_COMPUTED_HEADER_DEPENDENCIES =
910 -endif
911 -
904 ifndef COMPUTE_HEADER_DEPENDENCIES
905 COMPUTE_HEADER_DEPENDENCIES = auto
906 endif
@@ -1809,29 +1801,13 @@ $(dep_dirs):
1801 missing_dep_dirs := $(filter-out $(wildcard $(dep_dirs)),$(dep_dirs))
1802 dep_file = $(dir $@).depend/$(notdir $@).d
1803 dep_args = -MF $(dep_file) -MQ $@ -MMD -MP
1812 -ifdef CHECK_HEADER_DEPENDENCIES
1813 -$(error cannot compute header dependencies outside a normal build. \
1814 -Please unset CHECK_HEADER_DEPENDENCIES and try again)
1815 -endif
1804 endif
1805
1806 ifneq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
1819 -ifndef CHECK_HEADER_DEPENDENCIES
1807 dep_dirs =
1808 missing_dep_dirs =
1809 dep_args =
1810 endif
1824 -endif
1825 -
1826 -ifdef CHECK_HEADER_DEPENDENCIES
1827 -ifndef PRINT_HEADER_DEPENDENCIES
1828 -missing_deps = $(filter-out $(notdir $^), \
1829 - $(notdir $(shell $(MAKE) -s $@ \
1830 - CHECK_HEADER_DEPENDENCIES=YesPlease \
1831 - USE_COMPUTED_HEADER_DEPENDENCIES=YesPlease \
1832 - PRINT_HEADER_DEPENDENCIES=YesPlease)))
1833 -endif
1834 -endif
1811
1812 ASM_SRC := $(wildcard $(OBJECTS:o=S))
1813 ASM_OBJ := $(ASM_SRC:S=o)
@@ -1839,45 +1815,10 @@ C_OBJ := $(filter-out $(ASM_OBJ),$(OBJECTS))
1815
1816 .SUFFIXES:
1817
1842 -ifdef PRINT_HEADER_DEPENDENCIES
1843 -$(C_OBJ): %.o: %.c FORCE
1844 - echo $^
1845 -$(ASM_OBJ): %.o: %.S FORCE
1846 - echo $^
1847 -
1848 -ifndef CHECK_HEADER_DEPENDENCIES
1849 -$(error cannot print header dependencies during a normal build. \
1850 -Please set CHECK_HEADER_DEPENDENCIES and try again)
1851 -endif
1852 -endif
1853 -
1854 -ifndef PRINT_HEADER_DEPENDENCIES
1855 -ifdef CHECK_HEADER_DEPENDENCIES
1856 -$(C_OBJ): %.o: %.c $(dep_files) FORCE
1857 - @set -e; echo CHECK $@; \
1858 - missing_deps="$(missing_deps)"; \
1859 - if test "$$missing_deps"; \
1860 - then \
1861 - echo missing dependencies: $$missing_deps; \
1862 - false; \
1863 - fi
1864 -$(ASM_OBJ): %.o: %.S $(dep_files) FORCE
1865 - @set -e; echo CHECK $@; \
1866 - missing_deps="$(missing_deps)"; \
1867 - if test "$$missing_deps"; \
1868 - then \
1869 - echo missing dependencies: $$missing_deps; \
1870 - false; \
1871 - fi
1872 -endif
1873 -endif
1874 -
1875 -ifndef CHECK_HEADER_DEPENDENCIES
1818 $(C_OBJ): %.o: %.c GIT-CFLAGS $(missing_dep_dirs)
1819 $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
1820 $(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs)
1821 $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
1880 -endif
1822
1823 %.s: %.c GIT-CFLAGS FORCE
1824 $(QUIET_CC)$(CC) -o $@ -S $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<