<text>
ROOT = ${HOME}/compiladores/root CDK_INC_DIR = $(ROOT)/usr/include CDK_LIB_DIR = $(ROOT)/usr/lib
L_NAME=CompactScanner Y_NAME=CompactParser
YFLAGS = -dtv
CXXFLAGS = -ggdb -Isemantics -I. -I$(CDK_INC_DIR) LDFLAGS = -L$(CDK_LIB_DIR) -lcdk COMPILER = compact
SRC_CPP = $(wildcard nodes/*.cpp) $(wildcard semantics/*.cpp) \
$(wildcard ./*.cpp)
OFILES = $(SRC_CPP:%.cpp=%.o)
all: $(COMPILER)
%.o:: %.c
$(CXX) $(CXXFLAGS) -c $< -o $@
%.o:: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
%.tab.c:: %.y
byacc -dtv -b $* $<
%.tab.h:: %.y
byacc -dtv -b $* $<
$(L_NAME).cpp: $(L_NAME).l
flex $<
$(Y_NAME).tab.c: $(Y_NAME).y $(Y_NAME).tab.h: $(Y_NAME).y
$(L_NAME).o: $(L_NAME).cpp $(Y_NAME).tab.h
$(COMPILER): $(L_NAME).o $(Y_NAME).tab.o $(OFILES)
$(CXX) -o $@ $^ $(LDFLAGS)
clean:
$(RM) *.tab.[ch] *.o $(OFILES) $(L_NAME).cpp $(Y_NAME).output $(COMPILER)
depend:
$(CXX) $(CXXFLAGS) -MM *.cpp > .makedeps
-include .makedeps </text>