PreConditions += $(MakefileConfig)
endif
-preconditions : $(PreConditions)
+preconditions: $(PreConditions)
#------------------------------------------------------------------------
# Make sure the BUILT_SOURCES are built first
# (defined by the user's project) and "LLVM" libs (defined
# by the # LLVM project).
#---------------------------------------------------------
-#some versions of gcc on alpha produce to many symbols, so use a .a file
+# Some versions of gcc on Alpha produce too many symbols, so use a .a file
ifeq ($(ARCH),Alpha)
USEDLIBS := $(subst LLVMCore, LLVMCore.a, $(USEDLIBS))
LLVMLIBS := $(subst LLVMCore, LLVMCore.a, $(LLVMLIBS))
$(Echo) "Building $(<F) code emitter with tblgen"
$(Verb) $(TableGen) -gen-emitter -o $@ $<
+$(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
+$(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir
+ $(Echo) "Building $(<F) instruction selector implementation with tblgen"
+ $(Verb) $(TableGen) -gen-dag-isel -o $@ $<
+
+
clean-local::
-$(Verb) $(RM) -f $(INCFiles)
ifneq ($(LexFiles),)
-LexOutput := $(strip $(patsubst %.l,%.cpp,$(LexFiles)))
-
-.PRECIOUS: $(LexOutput)
+# Cancel built-in rules for lex
+%.c: %.l
+%.cpp: %.l
# Note the extra sed filtering here, used to cut down on the warnings emited
# by GCC. The last line is a gross hack to work around flex aparently not
# uninitialized string buffers in LLVM we can generate very long tokens, so
# this is a hack around it.
# FIXME. (f.e. char Buffer[10000] )
-%.cpp: %.l
+$(PROJ_SRC_DIR)/%.cpp: $(PROJ_SRC_DIR)/%.l
$(Echo) Flexing $*.l
- $(Verb) $(FLEX) -t $< | \
+ $(Verb) $(FLEX) -t $(PROJ_SRC_DIR)/$*.l | \
$(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)/' \
- > $@
+ > $(PROJ_SRC_DIR)/$*.cpp
+ $(Echo) "*** DON'T FORGET TO CHECK IN $*.cpp (generated file)"
+
+LexObjs := $(patsubst %.l,$(ObjDir)/%.o,$(LexFiles))
+$(LexObjs): $(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
clean-local::
-$(Verb) $(RM) -f $(LexOutput)
YaccFiles := $(filter %.y,$(Sources))
ifneq ($(YaccFiles),)
-YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.h .cpp .output)
+YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.output)
.PRECIOUS: $(YaccOutput)
%.h: %.y
# Rule for building the bison parsers...
-%.cpp %.h : %.y
+$(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
$(Echo) "Bisoning $*.y"
- $(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
- $(Verb) $(MV) -f $*.tab.c $*.cpp
- $(Verb) $(MV) -f $*.tab.h $*.h
+ $(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
+ $(Verb) $(MV) -f $*.tab.c $(PROJ_SRC_DIR)/$*.cpp
+ $(Verb) $(MV) -f $*.tab.h $(PROJ_SRC_DIR)/$*.h
+ $(Echo) "*** DON'T FORGET TO CHECK IN $*.cpp and $*.h (generated files)"
clean-local::
- -$(Verb) $(RM) -f $(YaccOutput)
$(Verb) $(RM) -f $(YaccOutput)
endif
$(Echo) "YaccFiles : " '$(YaccFiles)'
$(Echo) "LexFiles : " '$(LexFiles)'
$(Echo) "Module : " '$(Module)'
+ $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'