Skip to content

Commit

Permalink
Merge branch 'fk/make-auto-header-dependencies'
Browse files Browse the repository at this point in the history
* fk/make-auto-header-dependencies:
  Makefile: Use computed header dependencies if the compiler supports it
  • Loading branch information
Junio C Hamano committed Oct 5, 2011
2 parents 75abfa6 + 111ee18 commit 7af4d34
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,6 @@ all::
# DEFAULT_EDITOR='$GIT_FALLBACK_EDITOR',
# DEFAULT_EDITOR='"C:\Program Files\Vim\gvim.exe" --nofork'
#
# Define COMPUTE_HEADER_DEPENDENCIES if your compiler supports the -MMD option
# and you want to avoid rebuilding objects when an unrelated header file
# changes.
#
# Define CHECK_HEADER_DEPENDENCIES to check for problems in the hard-coded
# dependency rules.
#
Expand Down Expand Up @@ -1242,6 +1238,15 @@ endif
ifdef CHECK_HEADER_DEPENDENCIES
COMPUTE_HEADER_DEPENDENCIES =
USE_COMPUTED_HEADER_DEPENDENCIES =
else
ifndef COMPUTE_HEADER_DEPENDENCIES
dep_check = $(shell sh -c \
'$(CC) -c -MF /dev/null -MMD -MP -x c /dev/null -o /dev/null 2>&1; \
echo $$?')
ifeq ($(dep_check),0)
COMPUTE_HEADER_DEPENDENCIES=YesPlease
endif
endif
endif

ifdef COMPUTE_HEADER_DEPENDENCIES
Expand Down

0 comments on commit 7af4d34

Please sign in to comment.