aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-10-28 00:41:43 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-10-28 00:41:43 +0000
commit80f0ef72913a5ed0bc9388a5aa9635a5a27b31e7 (patch)
tree889f32ed55952ec803c9e376aa9079dd40e080a7
parentf113e7bf4383fe09112e6b1b10c69f9b05e35dd1 (diff)
Bug Fixes:
* Ensure that BUILT_SOURCES depends on OBJ_DIR/Makefile so that they do not get built before the Makefile is updated. * Fix build script for yacc & lex files by stopping it from thwarting the dependencies on the file. If the .y file changes, it needs to be rebuilt. This also cleans up the problem with llvmAsmParser ALWAYS rebuilding its Yacc files just to throw them away because there's no change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17288 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Makefile.rules16
1 files changed, 7 insertions, 9 deletions
diff --git a/Makefile.rules b/Makefile.rules
index a6cb6bb30e..4a2549a592 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -61,7 +61,7 @@ $(USER_TARGETS)::
# PRECONDITIONS: that which must be built/checked first
################################################################################
-SRCMKFILES := $(filter-out Makefile.rules %.in,\
+SRCMKFILES := $(BUILD_SRC_DIR)/Makefile $(filter-out Makefile.rules %.in,\
$(wildcard $(BUILD_SRC_DIR)/Makefile.*))
OBJMKFILES := $(subst $(BUILD_SRC_DIR),$(BUILD_OBJ_DIR),$(SRCMKFILES))
CONFIGURE := $(LLVM_SRC_ROOT)/configure
@@ -82,6 +82,8 @@ ifneq ($(strip $(BUILT_SOURCES)),)
$(VERB) $(RM) -f $(BUILT_SOURCES)
endif
+$(BUILT_SOURCES) : $(BUILD_OBJ_ROOT)/Makefile
+
#------------------------------------------------------------------------
# Make sure we're not using a stale configuration
#------------------------------------------------------------------------
@@ -806,21 +808,17 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output)
$(SED) 's/void yyunput/inline void yyunput/' | \
$(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
$(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
- > $@.tmp
- $(VERB) cmp -s $@ $@.tmp > /dev/null || $(MV) -f $@.tmp $@
- @# remove the output of flex if it didn't get moved over...
- @rm -f $@.tmp
+ > $@
# Rule for building the bison parsers...
%.c: %.y # Cancel built-in rules for yacc
+%.cpp: %.y # Cancel built-in rules for yacc
%.h: %.y # Cancel built-in rules for yacc
%.cpp %.h : %.y
@$(ECHO) "Bisoning $*.y"
$(VERB) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
- $(VERB) cmp -s $*.tab.c $*.cpp > /dev/null || $(MV) -f $*.tab.c $*.cpp
- $(VERB) cmp -s $*.tab.h $*.h > /dev/null || $(MV) -f $*.tab.h $*.h
- @# If the files were not updated, don't leave them lying around...
- @rm -f $*.tab.c $*.tab.h
+ $(VERB) $(MV) -f $*.tab.c $*.cpp
+ $(VERB) $(MV) -f $*.tab.h $*.h
# To create the directories...
%/.dir: