Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CC=g++ -w -std=c++14 -g
- CFLAGS=-I./
- AST_HDR=./ast/nodes.h ./ast/visitors/ASTPrinter.h ./ast/visitors/ASTVisitor.h \
- ./ast/visitors/ASTInterpreter.h ./Utilities/variable_return.h \
- ./mi7/program.h
- _VST_OBJ=ASTPrinter.o ASTInterpreter.o
- VST_OBJDIR=./bin/objects/vst
- VST_OBJ=$(patsubst %,$(VST_OBJDIR)/%,$(_VST_OBJ))
- _AST_OBJ=nodes.o
- AST_OBJDIR=./bin/objects/ast
- AST_OBJ=$(patsubst %,$(AST_OBJDIR)/%,$(_AST_OBJ))
- _PAR_OBJ=tokens.o parser.o
- PAR_OBJDIR=./bin/objects/parser
- PAR_OBJ=$(patsubst %,$(PAR_OBJDIR)/%,$(_PAR_OBJ))
- _PGR_OBJ=program.o
- PGR_OBJDIR=./bin/objects/program
- PGR_OBJ=$(patsubst %,$(PGR_OBJDIR)/%,$(_PGR_OBJ))
- $(shell mkdir -p bin)
- $(shell mkdir -p $(VST_OBJDIR))
- $(shell mkdir -p $(AST_OBJDIR))
- $(shell mkdir -p $(PAR_OBJDIR))
- $(shell mkdir -p $(PGR_OBJDIR))
- all: ./mi7/mi-7.cpp $(VST_OBJ) $(AST_OBJ) $(PGR_OBJ) $(PAR_OBJ)
- $(CC) $^ -o bin/mi7.exe $(CFLAGS)
- $(VST_OBJDIR)/%.o: ./ast/visitors/%.cpp
- $(CC) -c -o $@ $^ $(CFLAGS)
- $(AST_OBJDIR)/%.o: ./ast/%.cpp
- $(CC) -c -o $@ $^ $(CFLAGS)
- $(PAR_OBJDIR)/parser.cpp: ./mi7/parser.y
- bison -d -o $@ $^
- $(PAR_OBJDIR)/tokens.cpp: ./mi7/tokens.l $(PAR_OBJDIR)/parser.cpp
- flex -o $@ ./mi7/tokens.l
- $(PAR_OBJDIR)/%.o: $(PAR_OBJDIR)/%.cpp
- $(CC) -c -o $@ $< $(CFLAGS)
- $(PGR_OBJDIR)/%.o: ./mi7/%.cpp
- $(CC) -c -o $@ $< $(CFLAGS)
- clean:
- rm -rf bin/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement