From c9480640c22acaf143cebd47a48e2d42f5c98010 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 2 Jan 2009 07:16:45 +0000 Subject: [PATCH] Remove lex/bison support from makefile.rules. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61562 91177308-0d34-0410-b5e6-96231b3b80d8 --- Makefile.rules | 116 +++---------------------------------------------- 1 file changed, 5 insertions(+), 111 deletions(-) diff --git a/Makefile.rules b/Makefile.rules index c3963a82b08..49412d652d3 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -41,7 +41,7 @@ VPATH=$(PROJ_SRC_DIR) # Reset the list of suffixes we know how to build. #-------------------------------------------------------------------- .SUFFIXES: -.SUFFIXES: .c .cpp .cc .h .hpp .y .l .lo .o .a .bc .td .ps .dot .ll +.SUFFIXES: .c .cpp .cc .h .hpp .lo .o .a .bc .td .ps .dot .ll .SUFFIXES: $(SHLIBEXT) $(SUFFIXES) #-------------------------------------------------------------------- @@ -535,14 +535,13 @@ endif ifndef SOURCES Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \ - $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c $(PROJ_SRC_DIR)/*.y \ - $(PROJ_SRC_DIR)/*.l)) + $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c)) else Sources := $(SOURCES) endif ifdef BUILT_SOURCES -Sources += $(filter %.cpp %.c %.cc %.y %.l,$(BUILT_SOURCES)) +Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES)) endif BaseNameSources := $(sort $(basename $(Sources))) @@ -1346,111 +1345,6 @@ clean-local:: endif -############################################################################### -# LEX AND YACC: Provide rules for generating sources with lex and yacc -############################################################################### - -#--------------------------------------------------------- -# Provide rules for generating a .cpp source file from -# (f)lex input sources. -#--------------------------------------------------------- - -LexFiles := $(filter %.l,$(Sources)) - -ifneq ($(LexFiles),) - -# Cancel built-in rules for lex -%.c: %.l -%.cpp: %.l - -all:: $(LexFiles:%.l=$(PROJ_SRC_DIR)/%.cpp.cvs) - -# 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 -# being able to resize the buffer on a large token input. Currently, for -# uninitialized string buffers in LLVM we can generate very long tokens, so -# this is a hack around it. -# FIXME. (f.e. char Buffer[10000] ) -$(PROJ_SRC_DIR)/%.cpp: $(PROJ_SRC_DIR)/%.l - $(Echo) Flexing $*.l - $(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 - -# IFF the .l file has changed since it was last checked into SVN, copy the .l -# file to .l.cvs and the generated .cpp file to .cpp.cvs. We use this mechanism -# so that people without flex can build LLVM by copying the .cvs files to the -# source location and building them. -$(LexFiles:%.l=$(PROJ_SRC_DIR)/%.cpp.cvs): \ -$(PROJ_SRC_DIR)/%.cpp.cvs: $(PROJ_SRC_DIR)/%.cpp - $(Verb) $(CMP) -s $(PROJ_SRC_DIR)/$*.l $(PROJ_SRC_DIR)/$*.l.cvs || \ - ($(CP) $< $@; $(CP) $(PROJ_SRC_DIR)/$*.l $(PROJ_SRC_DIR)/$*.l.cvs) - -$(LexFiles:%.l=$(ObjDir)/%.o) : \ -$(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp - -clean-local:: - -$(Verb) $(RM) -f $(LexOutput) - -endif - -#--------------------------------------------------------- -# Provide rules for generating a .cpp and .h source files -# from yacc (bison) input sources. -#--------------------------------------------------------- - -YaccFiles := $(filter %.y,$(Sources)) -ifneq ($(YaccFiles),) - -.PRECIOUS: $(YaccOutput) - -all:: $(YaccFiles:%.y=$(PROJ_SRC_DIR)/%.cpp.cvs) - -# Cancel built-in rules for yacc -%.c: %.y -%.cpp: %.y -%.h: %.y - -# Rule for building the bison based parsers... -ifneq ($(BISON),) -$(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y - $(Echo) "Bisoning $*.y" - $(Verb) $(BISON) -v -d -p $(