fart/parser/Makefile
Josh Holtrop ecc06433fc flex output compiling with g++
git-svn-id: svn://anubis/fart/trunk@115 7f9b0f55-74a9-4bce-be96-3c2cd072584d
2009-02-17 01:37:39 +00:00

35 lines
646 B
Makefile

FLEX := flex
BISON := bison
PARSER := parser
OBJS := lex.yy.o $(PARSER).tab.o $(patsubst %.cc,%.o,$(wildcard *.cc))
all: $(OBJS)
%.o: %.cc
$(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) $<
$(PARSER).tab.cc $(PARSER).tab.hh: $(PARSER).yy
$(BISON) -d $<
lex.yy.o: lex.yy.cc
lex.yy.cc: $(PARSER).tab.hh
lex.yy.cc: $(PARSER).lex
$(FLEX) -o $@ $<
# Make dependency files
%.dep: %.cc
@set -e; rm -f $@; \
$(CXX) -MM $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
clean:
-rm -f lex.yy.cc $(PARSER).tab.cc $(PARSER).tab.hh *~ *.o *.dep
# Include dependency files
include $(OBJS:.o=.dep)