Support doing coordinate transforms on the CPU
[ipdf/code.git] / src / Makefile
1 #Makefile
2 ARCH := $(shell uname -m)
3 # TODO: stb_truetype doesn't compile with some of these warnings.
4 CXX = g++ -std=gnu++0x -g
5 # -Wall -Werror -Wshadow -pedantic
6 MAIN = main.o
7 OBJ = log.o document.o view.o screen.o vfpu.o stb_truetype.o
8 LIB_x86_64 = ../contrib/lib/libSDL2-2.0.so.0 -lGL
9 LIB_i386 = ../contrib/lib32/libSDL2-2.0.so.0 -lGL
10
11 MAINRPATH_x86_64 = -Wl,-rpath,'$$ORIGIN/../contrib/lib'
12 MAINRPATH_i386 = -Wl,-rpath,'$$ORIGIN/../contrib/lib32'
13 TESTRPATH_x86_64 = -Wl,-rpath,'$$ORIGIN/../../contrib/lib'
14 TESTRPATH_i386 = -Wl,-rpath,'$$ORIGIN/../../contrib/lib32'
15 OBJPATHS = $(OBJ:%=../obj/%)
16 DEPS := $(OBJPATHS:%.o=%.d)
17 CFLAGS_x86_64 := -I../contrib/include/SDL2 -I`pwd`
18 CFLAGS_i386 := -I../contrib/include32/SDL2 -I`pwd`
19
20
21 LIB := $(LIB_$(ARCH))
22 MAINRPATH := $(MAINRPATH_$(ARCH))
23 TESTRPATH := $(TESTRPATH_$(ARCH))
24 CFLAGS := $(CFLAGS_$(ARCH))
25
26
27
28 LINKOBJ = $(OBJPATHS)
29
30 RM = rm -f
31 BIN = ../bin/ipdf
32
33
34 all : $(BIN)
35
36 tests/% : tests/%.cpp ../obj/tests/%.o $(LINKOBJ)
37         $(CXX) -o [email protected] $(LINKOBJ) ../obj/[email protected] $(LIB) $(TESTRPATH)
38
39 runtests : tests/runtests.sh
40         cd tests; ./runtests.sh
41
42
43 $(BIN) : $(LINKOBJ) ../obj/$(MAIN)
44         @mkdir -p $(dir $@)
45         $(CXX) -o $(BIN) $(LINKOBJ) ../obj/$(MAIN) $(LIB) $(MAINRPATH)
46
47 ../obj/%.o : %.cpp
48         @mkdir -p $(dir $@)
49         $(CXX) $(CFLAGS) -c -MMD -o $@ $<
50
51 -include $(DEPS)
52
53 clean_bin :
54         $(RM) $(BIN)
55
56 clean :
57         $(RM) $(BIN) $(DEPS) $(LINKOBJ) ../obj/$(MAIN)
58         $(RM) tests/*~
59         $(RM) tests/*.test
60         $(RM) tests/*.out
61         $(RM) tests/*.err
62         
63
64 clean_full: clean
65         $(RM) *.*~
66         $(RM) *~
67
68
69
70         

UCC git Repository :: git.ucc.asn.au