This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
DamesEtCo/Makefile

59 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

2023-12-14 15:42:58 +01:00
CXX = g++
RM = rm -r
TAR = tar -cf
CP = cp -r
MKDIR = mkdir -p
SRC_DIR = src
INC_DIR = includes
2023-12-29 02:20:46 +01:00
RES_DIR = assets
SOURCES = $(wildcard $(SRC_DIR)/*.cpp) $(wildcard $(SRC_DIR)/**/*.cpp)
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
EXE = projet
EXE_EXT = out
ARCHIVE = binome38.tar
ARCHIVE_DIR = Botti-Kennel
2023-12-14 15:42:58 +01:00
PDF_DIR = report
%.cpp.o: $(SRC_DIR)/%.cpp
2023-11-12 16:21:31 +01:00
$(CXX) -c -o $@ $< $(CXXFLAGS)
%.cpp.o: $(SRC_DIR)/**/%.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS)
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)
$(CXX) -o $(EXE).$(EXE_EXT) $^ $(LIBS)
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)" \
2024-01-12 02:58:29 +01:00
"$(RES_DIR)" "$(PDF_DIR)/imgs/DiagrammeUML.png" "$(ARCHIVE_DIR)"
2023-11-12 16:25:44 +01:00
$(TAR) "$(ARCHIVE)" "$(ARCHIVE_DIR)"
$(RM) "$(ARCHIVE_DIR)"