2023-03-19 22:28:51 +01:00
|
|
|
CXX = g++
|
|
|
|
CXXFLAGS = -std=c++11
|
2023-03-29 14:41:18 +02:00
|
|
|
RM = rm -rf
|
2023-02-16 20:35:32 +01:00
|
|
|
|
2023-03-19 23:18:56 +01:00
|
|
|
RAPPORT_DIR = Rapport
|
2023-04-07 16:40:06 +02:00
|
|
|
SLIDES_DIR = Rapport/presentation
|
2023-03-19 23:18:56 +01:00
|
|
|
EXCLUSIONS = README.* $(RAPPORT_DIR)
|
|
|
|
$(foreach i, $(EXCLUSIONS), $(eval TAR_EXCLUDE = $(TAR_EXCLUDE) --exclude="$(i)"))
|
|
|
|
|
2023-03-19 22:28:51 +01:00
|
|
|
NAME = TP2 - Groupe 4
|
2023-03-19 23:18:56 +01:00
|
|
|
TAR = tar -czf
|
2023-04-07 16:40:06 +02:00
|
|
|
RAPPORT = $(RAPPORT_DIR)/*.pdf
|
|
|
|
SLIDES = $(SLIDES_DIR)/*.pdf
|
2023-03-19 23:21:58 +01:00
|
|
|
CP = rsync -r $(TAR_EXCLUDE)
|
2023-03-19 23:18:56 +01:00
|
|
|
MV = mv
|
2023-04-07 16:40:06 +02:00
|
|
|
MKDIR = mkdir -p
|
|
|
|
TMP_DIR = temp
|
2023-03-19 20:32:32 +01:00
|
|
|
|
2023-03-31 12:23:34 +02:00
|
|
|
SOURCES_RAND = $(filter-out src/mcts_player.cpp, $(wildcard src/*.cpp))
|
2023-03-19 22:28:51 +01:00
|
|
|
OBJETS_RAND = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES_RAND)))
|
|
|
|
EXE_RAND = rand_player
|
|
|
|
|
2023-03-31 12:23:34 +02:00
|
|
|
SOURCES_MCTS = $(filter-out src/rand_player.cpp, $(wildcard src/*.cpp))
|
|
|
|
OBJETS_MCTS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES_MCTS)))
|
2023-03-29 16:14:26 +02:00
|
|
|
EXE_MCTS = mcts_player
|
2023-03-10 13:47:28 +01:00
|
|
|
|
2023-03-29 14:41:18 +02:00
|
|
|
STATS_DIR = new_stats
|
2023-03-10 13:47:28 +01:00
|
|
|
|
|
|
|
%.cpp.o: src/%.cpp
|
|
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS)
|
|
|
|
|
2023-04-11 16:30:26 +02:00
|
|
|
all: default
|
|
|
|
|
|
|
|
default: mcts_player rand_player
|
|
|
|
|
|
|
|
nj: mcts_player
|
2023-03-19 22:28:51 +01:00
|
|
|
|
2023-03-10 13:47:28 +01:00
|
|
|
rand_player: CXXFLAGS += -Wall -O2
|
2023-03-19 22:28:51 +01:00
|
|
|
rand_player: compilation_rand
|
|
|
|
|
2023-03-29 13:53:17 +02:00
|
|
|
mcts_player: CXXFLAGS += -Wall -O2
|
2023-03-29 16:14:26 +02:00
|
|
|
mcts_player: compilation_mcts
|
2023-03-10 13:47:28 +01:00
|
|
|
|
|
|
|
dev: CXXFLAGS += -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -Og -g
|
|
|
|
dev: CXXFLAGS += -Wold-style-cast -Wsign-conversion
|
2023-03-29 16:14:26 +02:00
|
|
|
dev: compilation_mcts
|
2023-03-10 13:47:28 +01:00
|
|
|
|
2023-03-19 22:28:51 +01:00
|
|
|
compilation_rand: $(OBJETS_RAND)
|
|
|
|
$(CXX) -o $(EXE_RAND) $(OBJETS_RAND)
|
2023-03-10 13:47:28 +01:00
|
|
|
|
2023-03-29 16:14:26 +02:00
|
|
|
compilation_mcts: $(OBJETS_MCTS)
|
|
|
|
$(CXX) -o $(EXE_MCTS) $(OBJETS_MCTS)
|
2023-03-10 13:40:06 +01:00
|
|
|
|
2023-03-19 20:32:32 +01:00
|
|
|
tgz:
|
2023-03-19 22:28:51 +01:00
|
|
|
$(MAKE) clean
|
2023-04-07 16:40:06 +02:00
|
|
|
$(CP) * $(TMP_DIR)
|
|
|
|
$(MKDIR) $(TMP_DIR)/$(SLIDES_DIR)
|
2023-03-19 23:18:56 +01:00
|
|
|
$(CP) $(RAPPORT) temp/$(RAPPORT_DIR)
|
2023-04-07 16:40:06 +02:00
|
|
|
$(CP) $(SLIDES) $(TMP_DIR)/$(SLIDES_DIR)
|
|
|
|
cd $(TMP_DIR) && \
|
2023-03-19 23:18:56 +01:00
|
|
|
$(TAR) "$(NAME).tar.gz" * && \
|
|
|
|
$(MV) "$(NAME).tar.gz" ..
|
2023-04-07 16:43:24 +02:00
|
|
|
$(RM) $(TMP_DIR)/
|
2023-03-19 20:32:32 +01:00
|
|
|
|
2023-03-10 13:40:06 +01:00
|
|
|
clean:
|
2023-03-29 16:14:26 +02:00
|
|
|
$(RM) $(OBJETS_RAND) $(EXE_RAND) $(OBJETS_MCTS) $(EXE_MCTS)
|
2023-03-19 22:28:51 +01:00
|
|
|
$(RM) *.tar.gz
|
2023-04-07 16:40:06 +02:00
|
|
|
$(RM) $(TMP_DIR)
|
2023-03-29 14:41:18 +02:00
|
|
|
|
|
|
|
stats:
|
|
|
|
./mk_stats.sh
|
|
|
|
|
|
|
|
clean-stats:
|
|
|
|
$(RM) $(STATS_DIR)
|