better makefiles

This commit is contained in:
Mylloon 2023-03-19 23:18:56 +01:00
parent b99e3b1715
commit 8de3486251
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 19 additions and 4 deletions

View file

@ -2,7 +2,10 @@ NAME = TP1 - Groupe 4
CPP_NAME = C++
PROLOG_NAME = Prolog
TAR = tar --exclude="*AidesCPP" --exclude="*TODO.md" -czf
EXCLUSIONS = *AidesCPP *.md
$(foreach i, $(EXCLUSIONS), $(eval TAR_EXCLUDE = $(TAR_EXCLUDE) --exclude="$(i)"))
TAR = tar $(TAR_EXCLUDE) -czf
CP = cp -r
RM = rm -r

View file

@ -2,9 +2,15 @@ CXX = g++
CXXFLAGS = -std=c++11
RM = rm -f
RAPPORT_DIR = Rapport
EXCLUSIONS = README.* $(RAPPORT_DIR)
$(foreach i, $(EXCLUSIONS), $(eval TAR_EXCLUDE = $(TAR_EXCLUDE) --exclude="$(i)"))
NAME = TP2 - Groupe 4
TAR = tar --exclude="README.*" --exclude="Rapport" -czf
RAPPORT = Rapport/rapport.tex
TAR = tar -czf
RAPPORT = $(RAPPORT_DIR)/rapport.pdf
CP = rsync -av $(TAR_EXCLUDE)
MV = mv
SOURCES_RAND = $(filter-out src/my_player.cpp, $(wildcard src/*.cpp))
OBJETS_RAND = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES_RAND)))
@ -40,7 +46,13 @@ compilation_me: $(OBJETS_ME)
tgz:
$(MAKE) clean
$(TAR) "$(NAME).tar.gz" $(RAPPORT) *
$(CP) * temp
mkdir temp/$(RAPPORT_DIR)
$(CP) $(RAPPORT) temp/$(RAPPORT_DIR)
cd temp && \
$(TAR) "$(NAME).tar.gz" * && \
$(MV) "$(NAME).tar.gz" ..
$(RM) -r temp/
clean:
$(RM) $(OBJETS_RAND) $(EXE_RAND) $(OBJETS_ME) $(EXE_ME)