47 lines
1.2 KiB
Makefile
47 lines
1.2 KiB
Makefile
CXX = g++
|
|
CXXFLAGS = -std=c++11
|
|
RM = rm -f
|
|
|
|
NAME = TP2 - Groupe 4
|
|
TAR = tar --exclude="README.*" --exclude="Rapport" -czf
|
|
RAPPORT = Rapport/rapport.tex
|
|
|
|
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
|
|
|
|
|
|
%.cpp.o: src/%.cpp
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS)
|
|
|
|
all:
|
|
$(MAKE) my_player
|
|
$(MAKE) rand_player
|
|
|
|
rand_player: CXXFLAGS += -Wall -O2
|
|
rand_player: compilation_rand
|
|
|
|
my_player: CXXFLAGS += -Wall -O2
|
|
my_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)
|
|
|
|
tgz:
|
|
$(MAKE) clean
|
|
$(TAR) "$(NAME).tar.gz" $(RAPPORT) *
|
|
|
|
clean:
|
|
$(RM) $(OBJETS_RAND) $(EXE_RAND) $(OBJETS_ME) $(EXE_ME)
|
|
$(RM) *.tar.gz
|