Advertisement
Guest User

qwiuehwqe

a guest
May 10th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 1.35 KB | None | 0 0
  1. CC=g++ -w -std=c++14 -g
  2.  
  3. CFLAGS=-I./
  4.  
  5. AST_HDR=./ast/nodes.h ./ast/visitors/ASTPrinter.h ./ast/visitors/ASTVisitor.h \
  6.                 ./ast/visitors/ASTInterpreter.h ./Utilities/variable_return.h \
  7.                 ./mi7/program.h
  8.  
  9. _VST_OBJ=ASTPrinter.o ASTInterpreter.o
  10. VST_OBJDIR=./bin/objects/vst
  11. VST_OBJ=$(patsubst %,$(VST_OBJDIR)/%,$(_VST_OBJ))
  12.  
  13. _AST_OBJ=nodes.o
  14. AST_OBJDIR=./bin/objects/ast
  15. AST_OBJ=$(patsubst %,$(AST_OBJDIR)/%,$(_AST_OBJ))
  16.  
  17. _PAR_OBJ=tokens.o parser.o
  18. PAR_OBJDIR=./bin/objects/parser
  19. PAR_OBJ=$(patsubst %,$(PAR_OBJDIR)/%,$(_PAR_OBJ))
  20.  
  21. _PGR_OBJ=program.o
  22. PGR_OBJDIR=./bin/objects/program
  23. PGR_OBJ=$(patsubst %,$(PGR_OBJDIR)/%,$(_PGR_OBJ))
  24.  
  25. $(shell mkdir -p bin)
  26. $(shell mkdir -p $(VST_OBJDIR))
  27. $(shell mkdir -p $(AST_OBJDIR))
  28. $(shell mkdir -p $(PAR_OBJDIR))
  29. $(shell mkdir -p $(PGR_OBJDIR))
  30.  
  31. all: ./mi7/mi-7.cpp $(VST_OBJ) $(AST_OBJ) $(PGR_OBJ) $(PAR_OBJ)
  32.     $(CC) $^ -o bin/mi7.exe $(CFLAGS)
  33.  
  34. $(VST_OBJDIR)/%.o: ./ast/visitors/%.cpp
  35.     $(CC) -c -o $@ $^ $(CFLAGS)
  36.  
  37. $(AST_OBJDIR)/%.o: ./ast/%.cpp
  38.     $(CC) -c -o $@ $^ $(CFLAGS)
  39.  
  40. $(PAR_OBJDIR)/parser.cpp: ./mi7/parser.y
  41.     bison -d -o $@ $^
  42.  
  43. $(PAR_OBJDIR)/tokens.cpp: ./mi7/tokens.l $(PAR_OBJDIR)/parser.cpp
  44.     flex -o $@ ./mi7/tokens.l
  45.  
  46. $(PAR_OBJDIR)/%.o: $(PAR_OBJDIR)/%.cpp
  47.     $(CC) -c -o $@ $< $(CFLAGS)
  48.  
  49. $(PGR_OBJDIR)/%.o: ./mi7/%.cpp
  50.     $(CC) -c -o $@ $< $(CFLAGS)
  51.  
  52. clean:
  53.     rm -rf bin/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement