2023-03-19 22:28:51 +01:00
|
|
|
CXX = g++
|
|
|
|
CXXFLAGS = -std=c++11
|
|
|
|
RM = rm -f
|
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)"))
|
|
|
|
|
2023-03-19 22:28:51 +01:00
|
|
|
NAME = TP2 - Groupe 4
|
2023-03-19 23:18:56 +01:00
|
|
|
TAR = tar -czf
|
|
|
|
RAPPORT = $(RAPPORT_DIR)/rapport.pdf
|
|
|
|
CP = rsync -av $(TAR_EXCLUDE)
|
|
|
|
MV = mv
|
2023-03-19 20:32:32 +01:00
|
|
|
|
2023-03-19 22:28:51 +01:00
|
|
|
SOURCES_RAND = $(filter-out src/my_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)))
|
|
|
|
EXE_ME = my_player
|
2023-03-10 13:47:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
%.cpp.o: src/%.cpp
|
|
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS)
|
|
|
|
|
2023-03-19 22:28:51 +01:00
|
|
|
all:
|
|
|
|
$(MAKE) my_player
|
|
|
|
$(MAKE) rand_player
|
|
|
|
|
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
|
|
|
|
|
|
|
|
my_player: CXXFLAGS += -Wall -O2
|
|
|
|
my_player: compilation_me
|
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-19 22:28:51 +01:00
|
|
|
dev: compilation_me
|
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-19 22:28:51 +01:00
|
|
|
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:
|
2023-03-19 22:28:51 +01:00
|
|
|
$(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:
|
2023-03-19 22:28:51 +01:00
|
|
|
$(RM) $(OBJETS_RAND) $(EXE_RAND) $(OBJETS_ME) $(EXE_ME)
|
|
|
|
$(RM) *.tar.gz
|