better makefiles
This commit is contained in:
parent
b99e3b1715
commit
8de3486251
2 changed files with 19 additions and 4 deletions
|
@ -2,7 +2,10 @@ NAME = TP1 - Groupe 4
|
||||||
CPP_NAME = C++
|
CPP_NAME = C++
|
||||||
PROLOG_NAME = Prolog
|
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
|
CP = cp -r
|
||||||
RM = rm -r
|
RM = rm -r
|
||||||
|
|
||||||
|
|
18
TP2/Makefile
18
TP2/Makefile
|
@ -2,9 +2,15 @@ CXX = g++
|
||||||
CXXFLAGS = -std=c++11
|
CXXFLAGS = -std=c++11
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
|
|
||||||
|
RAPPORT_DIR = Rapport
|
||||||
|
EXCLUSIONS = README.* $(RAPPORT_DIR)
|
||||||
|
$(foreach i, $(EXCLUSIONS), $(eval TAR_EXCLUDE = $(TAR_EXCLUDE) --exclude="$(i)"))
|
||||||
|
|
||||||
NAME = TP2 - Groupe 4
|
NAME = TP2 - Groupe 4
|
||||||
TAR = tar --exclude="README.*" --exclude="Rapport" -czf
|
TAR = tar -czf
|
||||||
RAPPORT = Rapport/rapport.tex
|
RAPPORT = $(RAPPORT_DIR)/rapport.pdf
|
||||||
|
CP = rsync -av $(TAR_EXCLUDE)
|
||||||
|
MV = mv
|
||||||
|
|
||||||
SOURCES_RAND = $(filter-out src/my_player.cpp, $(wildcard src/*.cpp))
|
SOURCES_RAND = $(filter-out src/my_player.cpp, $(wildcard src/*.cpp))
|
||||||
OBJETS_RAND = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES_RAND)))
|
OBJETS_RAND = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES_RAND)))
|
||||||
|
@ -40,7 +46,13 @@ compilation_me: $(OBJETS_ME)
|
||||||
|
|
||||||
tgz:
|
tgz:
|
||||||
$(MAKE) clean
|
$(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:
|
clean:
|
||||||
$(RM) $(OBJETS_RAND) $(EXE_RAND) $(OBJETS_ME) $(EXE_ME)
|
$(RM) $(OBJETS_RAND) $(EXE_RAND) $(OBJETS_ME) $(EXE_ME)
|
||||||
|
|
Reference in a new issue