Makefile 491 B

12345678910111213141516171819202122232425
  1. OBJS=scanner.o parser.o ast.o interpreter.o
  2. INTERM=scanner.c parser.c parser.h
  3. PROGRAM=./interpreter
  4. CFLAGS=-g
  5. all: $(PROGRAM)
  6. scanner.c: scanner.flex parser.h
  7. flex -o scanner.c scanner.flex
  8. parser.c parser.h: parser.bison
  9. bison --defines=parser.h -o parser.c parser.bison
  10. $(PROGRAM): $(OBJS)
  11. $(CC) -o $(PROGRAM) $(OBJS)
  12. clean:
  13. rm -f $(PROGRAM) $(OBJS) $(INTERM)
  14. test: $(PROGRAM)
  15. $(PROGRAM) example1.txt
  16. $(PROGRAM) example2.txt
  17. $(PROGRAM) example3.txt
  18. $(PROGRAM) example4.txt