Makefile 709 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. NAME = zombies
  2. YACC_FILES = save.tab.c save.tab.h
  3. LEX_FILES = lex.yy.c
  4. PARSE_FILES = save.tab.c $(LEX_FILES)
  5. CODE_FILES = main.c Character.c Creature.c Maths.c Game.c Curses.c Map.c Menu.c
  6. DOC_FILES = docs
  7. DEBUG = YES
  8. ifeq ($(DEBUG),YES)
  9. D = -g
  10. else
  11. D =
  12. endif
  13. RESOURCES = ncurses menu
  14. CFLAGS += $(shell pkg-config --cflags $(RESOURCES))
  15. LIBS += $(shell pkg-config --libs $(RESOURCES))
  16. .PHONY: all clean docs
  17. all: $(PARSE_FILES)
  18. gcc -g -o $(NAME) -lm $(CFLAGS) $(LIBS) $(PARSE_FILES) $(CODE_FILES)
  19. $(YACC_FILES): save.y
  20. bison -d -t save.y
  21. $(LEX_FILES): save.tab.h save.l
  22. flex save.l
  23. docs: Doxyfile
  24. doxygen Doxyfile
  25. Doxyfile:
  26. doxygen -g
  27. clean:
  28. rm -rf $(NAME) $(PARSE_FILES) $(DOC_FILES) *.o