Make bezier control point coordinates relative
[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 -Wall -Werror -Wshadow -pedantic -rdynamic
5 MAIN = main.o
6 OBJ = log.o real.o bezier.o document.o objectrenderer.o view.o screen.o vfpu.o quadtree.o graphicsbuffer.o framebuffer.o shaderprogram.o stb_truetype.o gl_core44.o add_digits_asm.o sub_digits_asm.o mul_digits_asm.o div_digits_asm.o arbint.o
7 LIB_x86_64 = ../contrib/lib/libSDL2-2.0.so.0 -lGL -lgmp
8 LIB_i386 = ../contrib/lib32/libSDL2-2.0.so.0 -lGL -lgmp
9 LIB_i686 = $(LIB_i386)
10
11 MAINRPATH_x86_64 = -Wl,-rpath,'$$ORIGIN/../contrib/lib'
12 MAINRPATH_i386 = -Wl,-rpath,'$$ORIGIN/../contrib/lib32'
13 MAINRPATH_i686 = $(MAINRPATH_i386)
14 TESTRPATH_x86_64 = -Wl,-rpath,'$$ORIGIN/../../contrib/lib'
15 TESTRPATH_i386 = -Wl,-rpath,'$$ORIGIN/../../contrib/lib32'
16 TESTRPATH_i686 = $(TESTRPATH_i386)
17 OBJPATHS = $(OBJ:%=../obj/%)
18 DEPS := $(OBJPATHS:%.o=%.d)
19 CFLAGS_x86_64 := -I../contrib/include/SDL2 -I`pwd`
20 CFLAGS_i386 := -I../contrib/include32/SDL2 -I`pwd`
21 CFLAGS_i686 := $(CFLAGS_i386)
22
23
24 LIB := $(LIB_$(ARCH))
25 MAINRPATH := $(MAINRPATH_$(ARCH))
26 TESTRPATH := $(TESTRPATH_$(ARCH))
27 CFLAGS := $(CFLAGS_$(ARCH))
28
29 REALTYPE=1
30 LINKOBJ = $(OBJPATHS)
31
32 RM = rm -f
33 BIN = ../bin/ipdf
34
35
36 all : REAL = 1
37 all : $(BIN)
38
39 single : REAL = 0
40 single : $(BIN)
41
42 double : REAL = 1
43 double : $(BIN)
44
45 DEF = -DREAL=$(REALTYPE) -DQUADTREE_DISABLED
46
47 demo : $(BIN) ../tools/stream_plot.py
48         mkdir -p ../data/
49         $(RM) ../data/performance.dat
50         ./ipdf | tee ../data/performance.dat | ../tools/stream_plot.py 2>/dev/null
51
52 movie : $(BIN) ../tools/stream_plot.py
53         mkdir -p ../data/
54         $(RM) ../data/performance.dat
55         $(RM) ../data/movie.ogv
56         ./ipdf | tee ../data/performance.dat | ../tools/stream_plot.py 2>/dev/null & recordmydesktop --fps 10 --on-the-fly-encoding -o ../data/movie.ogv
57
58 # The tests will compile with the default REAL definition
59 # To change that you can run as `make DEFS="REAL=X" tests/<target>` where X is your chosen type
60 # But remember to make clean first.
61 tests/% : tests/%.cpp ../obj/tests/%.o $(LINKOBJ)
62         $(CXX) $(CFLAGS) -o [email protected] $(LINKOBJ) ../obj/[email protected] $(LIB) $(TESTRPATH)
63
64 -include $(DEPS)
65
66 runtests : tests/runtests.sh
67         cd tests; ./runtests.sh
68
69
70 $(BIN) : $(LINKOBJ) ../obj/$(MAIN)
71         echo $(LINKOBJ)
72         @mkdir -p $(dir $@)
73         $(CXX) $(CFLAGS) -o $(BIN) $(LINKOBJ) ../obj/$(MAIN) $(LIB) $(MAINRPATH)
74
75 -include $(DEPS)
76
77 ../obj/%.o : %.cpp main.h
78         @mkdir -p $(dir $@)
79         $(CXX) $(CFLAGS) $(DEF) -c -MMD -o $@ $<
80
81 ../obj/%_asm.o : %_asm.S main.h
82         @mkdir -p $(dir $@)
83         $(CXX) -c -o $@ $<
84
85 -include $(DEPS)
86
87 clean_bin :
88         $(RM) $(BIN)
89
90 clean :
91         $(RM) $(BIN) $(DEPS) $(LINKOBJ) ../obj/$(MAIN)
92         $(RM) tests/*~
93         $(RM) tests/*.test
94         $(RM) tests/*.out
95         $(RM) tests/*.err
96
97 clean_full: clean
98         $(RM) *.*~
99         $(RM) *~
100
101
102
103         

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