This repository has been archived on 2023-04-18. You can view files and clone it, but cannot push or open issues or pull requests.
iaj/TP2/Makefile

67 lines
1.5 KiB
Makefile
Raw Normal View History

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
EXCLUSIONS = README.* $(RAPPORT_DIR)
$(foreach i, $(EXCLUSIONS), $(eval TAR_EXCLUDE = $(TAR_EXCLUDE) --exclude="$(i)"))
NAME = TP2 - Groupe 4
2023-03-19 23:18:56 +01:00
TAR = tar -czf
RAPPORT = $(RAPPORT_DIR)/rapport.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-03-19 20:32:32 +01:00
2023-03-29 13:53:17 +02:00
SOURCES_RAND = $(filter-out src/mcts_player.cpp, $(wildcard src/*.cpp))
OBJETS_RAND = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES_RAND)))
EXE_RAND = rand_player
SOURCES_ME = $(filter-out src/rand_player.cpp, $(wildcard src/*.cpp))
OBJETS_ME = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES_RAND)))
2023-03-29 13:53:17 +02:00
EXE_ME = mcts_player
2023-03-29 14:41:18 +02:00
STATS_DIR = new_stats
%.cpp.o: src/%.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS)
all:
2023-03-29 13:53:17 +02:00
$(MAKE) mcts_player
$(MAKE) rand_player
rand_player: CXXFLAGS += -Wall -O2
rand_player: compilation_rand
2023-03-29 13:53:17 +02:00
mcts_player: CXXFLAGS += -Wall -O2
mcts_player: compilation_me
dev: CXXFLAGS += -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -Og -g
dev: CXXFLAGS += -Wold-style-cast -Wsign-conversion
dev: compilation_me
compilation_rand: $(OBJETS_RAND)
$(CXX) -o $(EXE_RAND) $(OBJETS_RAND)
compilation_me: $(OBJETS_ME)
$(CXX) -o $(EXE_ME) $(OBJETS_ME)
2023-03-10 13:40:06 +01:00
2023-03-19 20:32:32 +01:00
tgz:
$(MAKE) clean
2023-03-19 23:18:56 +01:00
$(CP) * temp
mkdir temp/$(RAPPORT_DIR)
$(CP) $(RAPPORT) temp/$(RAPPORT_DIR)
cd temp && \
$(TAR) "$(NAME).tar.gz" * && \
$(MV) "$(NAME).tar.gz" ..
$(RM) -r temp/
2023-03-19 20:32:32 +01:00
2023-03-10 13:40:06 +01:00
clean:
$(RM) $(OBJETS_RAND) $(EXE_RAND) $(OBJETS_ME) $(EXE_ME)
$(RM) *.tar.gz
2023-03-29 14:41:18 +02:00
stats:
./mk_stats.sh
clean-stats:
$(RM) $(STATS_DIR)