2 ARCH := $(shell uname -i)
3 CXX = g++ -std=gnu++0x -Wall -Werror -Wshadow -pedantic -g
5 OBJ = log.o document.o view.o screen.o
6 LIB_x86_64 = ../contrib/lib/libSDL2-2.0.so.0 -lGL
7 LIB_i386 = ../contrib/lib32/libSDL2-2.0.so.0 -lGL
8 MAINRPATH_x86_64 = -Wl,-rpath,'$$ORIGIN/../contrib/lib'
9 MAINRPATH_i386 = -Wl,-rpath,'$$ORIGIN/../contrib/lib32'
10 TESTRPATH_x86_64 = -Wl,-rpath,'$$ORIGIN/../../contrib/lib'
11 TESTRPATH_i386 = -Wl,-rpath,'$$ORIGIN/../../contrib/lib32'
12 OBJPATHS = $(OBJ:%=../obj/%)
13 DEPS := $(OBJPATHS:%.o=%.d)
14 CFLAGS_x86_64 := -I../contrib/include/SDL2 -I`pwd`
15 CFLAGS_i386 := -I../contrib/include32/SDL2 -I`pwd`
17 MAINRPATH := $(MAINRPATH_$(ARCH))
18 TESTRPATH := $(TESTRPATH_$(ARCH))
19 CFLAGS := $(CFLAGS_$(ARCH))
30 tests/% : tests/%.cpp ../obj/tests/%.o $(LINKOBJ)
33 runtests : tests/runtests.sh
34 cd tests; ./runtests.sh
37 $(BIN) : $(LINKOBJ) ../obj/$(MAIN)
39 $(CXX) -o $(BIN) $(LINKOBJ) ../obj/$(MAIN) $(LIB) $(MAINRPATH)
43 $(CXX) $(CFLAGS) -c -MMD -o $@ $<
51 $(RM) $(BIN) $(DEPS) $(LINKOBJ) ../obj/$(MAIN)