2015-03-18 16:58:14 +00:00
|
|
|
SOURCES=$(wildcard src/*.cpp)
|
|
|
|
OBJS=$(SOURCES:.cpp=.o)
|
|
|
|
|
|
|
|
# compiler options : add debug information in debug mode
|
|
|
|
# optimize speed and size in release mode
|
|
|
|
ifneq (,$(findstring debug,$(MAKECMDGOALS)))
|
|
|
|
CFLAGS=-g
|
|
|
|
else
|
|
|
|
CFLAGS=-02 -s
|
|
|
|
endif
|
|
|
|
|
|
|
|
# linker options : OS dependant
|
|
|
|
ifeq ($(shell sh -c 'uname -s'),Linux)
|
|
|
|
LIBFLAGS=-L. -ltcod_debug -ltcodxx_debug -Wl,-rpath=.
|
|
|
|
else
|
|
|
|
LIBFLAGS=-Llib -ltcod-mingw-debug -static-libgcc -static-libstdc++
|
|
|
|
endif
|
|
|
|
|
2015-03-19 15:19:17 +00:00
|
|
|
debug : harc
|
|
|
|
release : harc
|
2015-03-18 16:58:14 +00:00
|
|
|
|
2015-03-19 15:19:17 +00:00
|
|
|
harc : $(OBJS)
|
|
|
|
g++ $(OBJS) -o harc -Wall $(LIBFLAGS) -g -w
|
2015-03-18 16:58:14 +00:00
|
|
|
|
|
|
|
src/main.hpp.gch : src/*.hpp
|
|
|
|
g++ src/main.hpp -Iinclude -Wall
|
|
|
|
|
|
|
|
src/%.o : src/%.cpp src/main.hpp.gch
|
|
|
|
g++ $< -c -o $@ -Iinclude -Wall -g
|
|
|
|
|
|
|
|
clean :
|
|
|
|
rm -f src/main.hpp.gch $(OBJS)
|