Makefile 456 B

123456789101112131415161718192021
  1. OBJS=src/*.hi src/*.o src/*.info
  2. AUTO_INTERM=src/scanner.hs src/parser.hs
  3. INTERM=$(AUTO_INTERM) src/intermediate_rep.hs src/compiler.hs src/mips.hs src/main.hs
  4. PROGRAM=compiler
  5. all: $(PROGRAM)
  6. src/scanner.hs: src/scanner.x
  7. alex --info -o src/scanner.hs src/scanner.x
  8. src/parser.hs : src/parser.y
  9. happy --info -o src/parser.hs src/parser.y
  10. $(PROGRAM): $(INTERM)
  11. ghc -dynamic -o $(PROGRAM) $(INTERM)
  12. clean:
  13. rm -f $(PROGRAM) $(AUTO_INTERM) $(OBJS)