diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2010-06-08 20:10:13 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2010-06-08 20:10:13 +0000 |
| commit | 011da84913b76e351d027853466c14d86ed7ca27 (patch) | |
| tree | 5e6e07aa065a223c2182fdde9ad835bfe7eb3923 | |
| parent | 351a6ed29ff31726e7cfc8b14827aa46b0c60683 (diff) | |
| download | external_llvm-011da84913b76e351d027853466c14d86ed7ca27.zip external_llvm-011da84913b76e351d027853466c14d86ed7ca27.tar.gz external_llvm-011da84913b76e351d027853466c14d86ed7ca27.tar.bz2 | |
Makefiles: Teach LLVM's recursive makefile descent to update objdir Makefiles if
they are out of date, instead of only testing if they exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105636 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | Makefile.rules | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Makefile.rules b/Makefile.rules index fb1f83d..a058838 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -807,7 +807,8 @@ SubDirs += $(DIRS) ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) $(RecursiveTargets):: $(Verb) for dir in $(DIRS); do \ - if [ ! -f $$dir/Makefile ]; then \ + if ([ ! -f $$dir/Makefile ] || \ + [ $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ]); then \ $(MKDIR) $$dir; \ $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ fi; \ @@ -829,7 +830,8 @@ endif ifdef EXPERIMENTAL_DIRS $(RecursiveTargets):: $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \ - if [ ! -f $$dir/Makefile ]; then \ + if ([ ! -f $$dir/Makefile ] || \ + [ $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ]); then \ $(MKDIR) $$dir; \ $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ fi; \ @@ -863,7 +865,9 @@ unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS)) ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T)) $(ParallelTargets) : - $(Verb) if [ ! -f $(@D)/Makefile ]; then \ + $(Verb) if ([ ! -f $(@D)/Makefile ] || \ + [ $(@D)/Makefile -ot \ + $(PROJ_SRC_DIR)/$(@D)/Makefile ]); then \ $(MKDIR) $(@D); \ $(CP) $(PROJ_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \ fi; \ @@ -882,7 +886,8 @@ ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) $(RecursiveTargets):: $(Verb) for dir in $(OPTIONAL_DIRS); do \ if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\ - if [ ! -f $$dir/Makefile ]; then \ + if ([ ! -f $$dir/Makefile ] || \ + [ $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ]); then \ $(MKDIR) $$dir; \ $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ fi; \ |
