54 lines
1 KiB
Makefile
54 lines
1 KiB
Makefile
|
CXX = g++
|
||
|
CXXFLAGS = --std=c++11
|
||
|
RM = rm -r
|
||
|
TAR = tar -cf
|
||
|
CP = cp -r
|
||
|
|
||
|
SRC_DIR = src
|
||
|
INC_DIR = includes
|
||
|
SOURCES = $(wildcard $(SRC_DIR)/*.cpp)
|
||
|
OBJETS = $(patsubst %.cpp,%.cpp.o,$(notdir $(SOURCES)))
|
||
|
|
||
|
EXE = projet
|
||
|
EXE_EXT = out
|
||
|
|
||
|
PDF_LOCATION = report
|
||
|
PDF_FILE = explications.pdf
|
||
|
|
||
|
ARCHIVE = binome38.tar
|
||
|
ARCHIVE_DIR = Botti-Kennel
|
||
|
|
||
|
%.cpp.o: $(SRC_DIR)/%.cpp
|
||
|
$(CXX) -c -o $@ $< $(CXXFLAGS) $(DEVFLAGS)
|
||
|
|
||
|
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) $(OBJETS)
|
||
|
|
||
|
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
|
||
|
@mkdir $(ARCHIVE_DIR)
|
||
|
$(CP) "$(SRC_DIR)/" "$(INC_DIR)/" Makefile README.md "$(PDF_LOCATION)/$(PDF_FILE)" \
|
||
|
$(ARCHIVE_DIR)
|
||
|
$(TAR) "$(ARCHIVE)" $(ARCHIVE_DIR)
|
||
|
$(RM) "$(ARCHIVE_DIR)"
|