2023-12-14 15:42:58 +01:00
|
|
|
CXX = g++
|
|
|
|
RM = rm -r
|
|
|
|
TAR = tar -cf
|
|
|
|
CP = cp -r
|
|
|
|
MKDIR = mkdir -p
|
2023-11-12 16:09:02 +01:00
|
|
|
|
|
|
|
SRC_DIR = src
|
|
|
|
INC_DIR = includes
|
2023-12-29 02:20:46 +01:00
|
|
|
RES_DIR = assets
|
2023-12-14 15:41:36 +01:00
|
|
|
SOURCES = $(wildcard $(SRC_DIR)/*.cpp) $(wildcard $(SRC_DIR)/**/*.cpp)
|
2023-11-12 16:09:02 +01:00
|
|
|
OBJETS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES)))
|
|
|
|
|
2023-11-24 19:19:19 +01:00
|
|
|
CXXFLAGS = --std=c++11
|
|
|
|
LIBS = -lsfml-graphics -lsfml-window -lsfml-system
|
|
|
|
|
2023-11-12 16:09:02 +01:00
|
|
|
EXE = projet
|
|
|
|
EXE_EXT = out
|
|
|
|
|
|
|
|
ARCHIVE = binome38.tar
|
|
|
|
ARCHIVE_DIR = Botti-Kennel
|
2023-12-14 15:42:58 +01:00
|
|
|
PDF_DIR = report
|
2023-11-12 16:09:02 +01:00
|
|
|
|
|
|
|
%.cpp.o: $(SRC_DIR)/%.cpp
|
2023-11-12 16:21:31 +01:00
|
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS)
|
2023-11-12 16:09:02 +01:00
|
|
|
|
2023-12-14 15:41:36 +01:00
|
|
|
%.cpp.o: $(SRC_DIR)/**/%.cpp
|
|
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS)
|
|
|
|
|
2023-11-12 16:09:02 +01:00
|
|
|
main: CXXFLAGS += -O3
|
|
|
|
main: compilation
|
|
|
|
|
|
|
|
dev: CXXFLAGS += -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -g
|
|
|
|
dev: CXXFLAGS += -Wold-style-cast -Wsign-conversion
|
|
|
|
dev: compilation
|
|
|
|
|
|
|
|
compilation: $(OBJETS)
|
2023-12-14 15:41:36 +01:00
|
|
|
$(CXX) -o $(EXE).$(EXE_EXT) $^ $(LIBS)
|
2023-11-12 16:09:02 +01:00
|
|
|
|
|
|
|
all:
|
|
|
|
main
|
|
|
|
|
|
|
|
pdf-make:
|
|
|
|
cd report && \
|
|
|
|
$(MAKE)
|
|
|
|
|
|
|
|
pdf-clean:
|
|
|
|
cd report && \
|
|
|
|
$(MAKE) clean
|
|
|
|
|
|
|
|
clean: pdf-clean
|
|
|
|
-$(RM) $(OBJETS) "$(EXE).$(EXE_EXT)" "$(ARCHIVE)"
|
|
|
|
|
|
|
|
archive: pdf-make
|
2023-11-12 16:25:44 +01:00
|
|
|
$(MKDIR) "$(ARCHIVE_DIR)"
|
|
|
|
$(CP) "$(SRC_DIR)" "$(INC_DIR)" Makefile README.md "$(wildcard $(PDF_DIR)/*.pdf)" \
|
2023-12-29 02:20:46 +01:00
|
|
|
"$(RES_DIR)" "$(ARCHIVE_DIR)"
|
2023-11-12 16:25:44 +01:00
|
|
|
$(TAR) "$(ARCHIVE)" "$(ARCHIVE_DIR)"
|
2023-11-12 16:09:02 +01:00
|
|
|
$(RM) "$(ARCHIVE_DIR)"
|