Merge branch 'master' of git.ucc.asn.au:/ipdf/code
[ipdf/code.git] / src / Makefile
1 #Makefile
2 CXX = g++ -std=gnu++0x -Wall -Werror -Wshadow -pedantic -g
3 MAIN = main.o
4 OBJ = log.o document.o view.o screen.o
5 LIB = `sdl2-config --libs` -lGL
6 OBJPATHS = $(OBJ:%=../obj/%)
7 DEPS := $(OBJPATHS:%.o=%.d)
8 CFLAGS += `sdl2-config --cflags` -I`pwd`
9
10 LINKOBJ = $(OBJPATHS)
11
12 RM = rm -f
13 BIN = ../bin/ipdf
14
15
16 all : $(BIN)
17
18 tests/% : tests/%.cpp ../obj/tests/%.o $(LINKOBJ)
19         $(CXX) -o [email protected] $(LINKOBJ) ../obj/[email protected] $(LIB)
20
21 runtests : tests/runtests.sh
22         cd tests; ./runtests.sh
23
24
25 $(BIN) : $(LINKOBJ) ../obj/$(MAIN)
26         @mkdir -p $(dir $@)
27         $(CXX) -o $(BIN) $(LINKOBJ) ../obj/$(MAIN) $(LIB)
28
29 ../obj/%.o : %.cpp
30         @mkdir -p $(dir $@)
31         $(CXX) $(CFLAGS) -c -MMD -o $@ $<
32
33 -include $(DEPS)
34
35 clean_bin :
36         $(RM) $(BIN)
37
38 clean :
39         $(RM) $(BIN) $(DEPS) $(LINKOBJ) ../obj/$(MAIN)
40         $(RM) tests/*~
41         $(RM) tests/*.test
42         $(RM) tests/*.out
43         $(RM) tests/*.err
44         
45
46 clean_full: clean
47         $(RM) *.*~
48         $(RM) *~
49
50
51
52         

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