An interface for a FPU compiled from VHDL
[ipdf/code.git] / src / Makefile
1 #Makefile
2 ARCH := $(shell uname -i)
3 CXX = g++ -std=gnu++0x -Wall -Werror -Wshadow -pedantic -g
4 MAIN = main.o
5 OBJ = log.o document.o view.o screen.o vfpu.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 LIB_unknown = $(LIB_x86_64)
9 MAINRPATH_x86_64 = -Wl,-rpath,'$$ORIGIN/../contrib/lib'
10 MAINRPATH_i386 = -Wl,-rpath,'$$ORIGIN/../contrib/lib32'
11 TESTRPATH_x86_64 = -Wl,-rpath,'$$ORIGIN/../../contrib/lib'
12 TESTRPATH_i386 = -Wl,-rpath,'$$ORIGIN/../../contrib/lib32'
13 OBJPATHS = $(OBJ:%=../obj/%)
14 DEPS := $(OBJPATHS:%.o=%.d)
15 CFLAGS_x86_64 := -I../contrib/include/SDL2 -I`pwd`
16 CFLAGS_i386 := -I../contrib/include32/SDL2 -I`pwd`
17 CFLAGS_unknown = $(CFLAGS_x86_64)
18
19 LIB := $(LIB_$(ARCH))
20 MAINRPATH := $(MAINRPATH_$(ARCH))
21 TESTRPATH := $(TESTRPATH_$(ARCH))
22 CFLAGS := $(CFLAGS_$(ARCH))
23
24
25
26 LINKOBJ = $(OBJPATHS)
27
28 RM = rm -f
29 BIN = ../bin/ipdf
30
31
32 all : $(BIN)
33
34 tests/% : tests/%.cpp ../obj/tests/%.o $(LINKOBJ)
35         $(CXX) -o $@.test $(LINKOBJ) ../obj/$@.o $(LIB) $(TESTRPATH)
36
37 runtests : tests/runtests.sh
38         cd tests; ./runtests.sh
39
40
41 $(BIN) : $(LINKOBJ) ../obj/$(MAIN)
42         @mkdir -p $(dir $@)
43         $(CXX) -o $(BIN) $(LINKOBJ) ../obj/$(MAIN) $(LIB) $(MAINRPATH)
44
45 ../obj/%.o : %.cpp
46         @mkdir -p $(dir $@)
47         $(CXX) $(CFLAGS) -c -MMD -o $@ $<
48
49 -include $(DEPS)
50
51 clean_bin :
52         $(RM) $(BIN)
53
54 clean :
55         $(RM) $(BIN) $(DEPS) $(LINKOBJ) ../obj/$(MAIN)
56         $(RM) tests/*~
57         $(RM) tests/*.test
58         $(RM) tests/*.out
59         $(RM) tests/*.err
60         
61
62 clean_full: clean
63         $(RM) *.*~
64         $(RM) *~
65
66
67
68         

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