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

58 lines
1.1 KiB
Makefile
Raw Normal View History

CXX = g++
RM = rm -r
TAR = tar -cf
CP = cp -r
2023-11-12 16:17:04 +01:00
MKDIR = mkdir -p
SRC_DIR = src
INC_DIR = includes
SOURCES = $(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-11-12 16:17:04 +01:00
PDF_DIR = report
%.cpp.o: $(SRC_DIR)/%.cpp
2023-11-12 16:21:31 +01:00
$(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)
2023-11-24 19:19:19 +01:00
$(CXX) -o $(EXE).$(EXE_EXT) $(OBJETS) $(LIBS)
all:
main
2023-11-12 16:19:15 +01:00
run: main
./$(EXE).$(EXE_EXT)
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)" \
"$(ARCHIVE_DIR)"
$(TAR) "$(ARCHIVE)" "$(ARCHIVE_DIR)"
$(RM) "$(ARCHIVE_DIR)"