Makefile (1241B)
1 CXX=g++ 2 # -ansi -pedantic -Wconversion 3 # -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wsync-nand -Wunused -Wstrict-overflow=5 -Wfloat-equal -Wundef -Wno-endif-labels -Wshadow -Wunsafe-loop-optimizations -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wlogical-op -Wmissing-declarations -Wnormalized=nfc -Wpacked -Wredundant-decls -Winline -Winvalid-pch -Wdisabled-optimization -Woverlength-strings 4 CCWARN=-Wall -Wextra -Werror 5 # TODO : -O3 -m32 ou -m64 6 # -g -rdynamic uniquement pour le debug. 7 CFLAGS=-O0 -g -rdynamic -I. $(CCWARN) 8 9 SOURCES = $(shell echo *.cpp geometry/*.cpp rules/*.cpp) 10 HEADERS = $(shell echo *.hh geometry/*.hh rules/*.hh) 11 LIBS = -lm -lGL -lGLU -lSDL -lSDL_image -lGLEW -lglut 12 EXECUTABLE = city 13 14 .PHONY: all 15 all: $(EXECUTABLE) 16 ./$(EXECUTABLE) 17 18 .PHONY: clean 19 clean: 20 rm -f $(EXECUTABLE) all_includes.hh.gch all.cpp 21 22 $(EXECUTABLE): $(SOURCES) all_includes.hh.gch Makefile 23 @echo "#ifndef _ALL_CPP_"> all.cpp 24 @echo "#define _ALL_CPP_">> all.cpp 25 @$(foreach FILE,$(SOURCES),echo '#include "'"$(FILE)"'"' >> all.cpp;) 26 @echo "#endif">> all.cpp 27 $(CXX) all.cpp $(LIBS) $(CFLAGS) -o $@ 28 @rm all.cpp 29 30 all_includes.hh.gch: $(HEADERS) Makefile 31 $(CXX) $(CFLAGS) all_includes.hh -o all_includes.hh.gch