You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

90 lines
1.9 KiB

  1. CXX?=clang++
  2. CC?=clang
  3. TARGETS = othello \
  4. example-player \
  5. random-player \
  6. my-player
  7. SRC_mcp = othello.cc mcp.cc
  8. SRC_common = board.cc
  9. ASM_common = asm.S
  10. OBJECTS = $(SRC_mcp:.cc=.o) $(SRC_common:.cc=.o) \
  11. $(ASM_common:.S=.o) \
  12. players/example-player.o \
  13. players/random-player.o \
  14. players/my-player.o \
  15. players/playerlib.o
  16. CXXFLAGS += -std=c++11 -I. -g
  17. ifeq ($(CXX),clang++)
  18. CXXFLAGS += -Wno-disabled-macro-expansion
  19. endif
  20. ifeq ($(CXX),g++)
  21. CXXFLAGS += -MMD -Wall
  22. else
  23. CXXFLAGS += -Weverything -Wno-padded -Wno-weak-vtables
  24. endif
  25. CFLAGS += -I. -g
  26. all : $(TARGETS)
  27. othello : $(SRC_common:.cc=.o) $(ASM_common:.S=.o)
  28. othello : $(SRC_mcp:.cc=.o)
  29. $(CXX) $^ -o $@ $(LDFLAGS)
  30. example-player: players/example-player.o
  31. $(CXX) $^ -o $@ $(LDFLAGS)
  32. my-player : players/my-player.o players/playerlib.o
  33. $(CXX) $^ -o $@ $(LDFLAGS)
  34. random-player : players/random-player.o players/playerlib.o
  35. $(CXX) $^ -o $@ $(LDFLAGS)
  36. PLAYER1 ?= my-player
  37. PLAYER2 ?= random-player
  38. .PHONY : clean cleanall help
  39. demo : $(TARGETS)
  40. MCP_OPTS="-d" PLAYER1=example-player PLAYER2=example-player make execute
  41. debug : $(TARGETS)
  42. MCP_OPTS="-d" make execute
  43. fight : $(TARGETS)
  44. MCP_OPTS="-t 60 -T 61 -m 1024 -M 1024" make execute
  45. execute : $(TARGETS)
  46. ./othello $(MCP_OPTS) $(PLAYER1) $(PLAYER2)
  47. help :
  48. @echo "Benutzung: [PLAYER1=<player1>] [PLAYER2=<player2>] make <Ziel>"
  49. @echo ""
  50. @echo "PLAYER1, PLAYER2 -> Dateien mit zu verwendenden Spielern."
  51. @echo " Standardwerte: PLAYER1 = my-player"
  52. @echo " PLAYER2 = random-player"
  53. @echo ""
  54. @echo "Mögliche Ziele:"
  55. @echo ""
  56. @echo "demo - startet ein Spiel mit dem example-player"
  57. @echo "debug - startet ein Spiel im Debug-Modus (keine Zeitbeschränkung)"
  58. @echo "fight - startet ein Turnier-Spiel"
  59. clean :
  60. $(RM) $(OBJECTS)
  61. cleanall : clean
  62. $(RM) $(TARGETS)
  63. $(RM) $(OBJECTS:.o=.d)
  64. -include $(OBJECTS:.o=.d)
  65. -include Makefile.priv