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

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