Preliminary uzbl testing framework - props to bct for the help
[uzbl-mobile] / Makefile
1 CFLAGS:=-std=c99 $(shell pkg-config --cflags gtk+-2.0 webkit-1.0 libsoup-2.4) -ggdb -Wall -W -DARCH="\"$(shell uname -m)\"" -DG_ERRORCHECK_MUTEXES -DCOMMIT="\"$(shell git log | head -n1 | sed "s/.* //")\"" $(CPPFLAGS)
2 LDFLAGS:=$(shell pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4) -pthread $(LDFLAGS)
3 all: uzbl uzblctrl
4
5 PREFIX?=$(DESTDIR)/usr
6
7 # When compiling unit tests, compile uzbl as a library first
8 test: uzbl.o
9         $(CC) -DUZBL_LIBRARY -shared -Wl uzbl.o -o ./tests/libuzbl.so
10         cd ./tests/; $(MAKE)
11
12 # test-report: run tests in subdirs and generate report
13 # perf-report: run tests in subdirs with -m perf and generate report
14 # full-report: like test-report: with -m perf and -m slow
15 #test-report perf-report full-report:    ${TEST_PROGS}
16 #       @test -z "${TEST_PROGS}" || { \
17 #          case $@ in \
18 #          test-report) test_options="-k";; \
19 #          perf-report) test_options="-k -m=perf";; \
20 #          full-report) test_options="-k -m=perf -m=slow";; \
21 #          esac ; \
22 #          if test -z "$$GTESTER_LOGDIR" ; then  \
23 #            ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
24 #          elif test -n "${TEST_PROGS}" ; then \
25 #            ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
26 #          fi ; \
27 #        }
28 #       @ ignore_logdir=true ; \
29 #          if test -z "$$GTESTER_LOGDIR" ; then \
30 #            GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
31 #            ignore_logdir=false ; \
32 #          fi ; \
33 #          for subdir in $(SUBDIRS) . ; do \
34 #            test "$$subdir" = "." -o "$$subdir" = "po" || \
35 #            ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
36 #          done ; \
37 #          $$ignore_logdir || { \
38 #            echo '<?xml version="1.0"?>' > $@.xml ; \
39 #            echo '<report-collection>'  >> $@.xml ; \
40 #            for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
41 #              sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $@.xml ; \
42 #            done ; \
43 #            echo >> $@.xml ; \
44 #            echo '</report-collection>' >> $@.xml ; \
45 #            rm -rf "$$GTESTER_LOGDIR"/ ; \
46 #            ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $@.xml >$@.html ; \
47 #          }
48
49 test-dev: uzbl
50         XDG_DATA_HOME=./examples/data               XDG_CONFIG_HOME=./examples/config               ./uzbl --uri http://www.uzbl.org --verbose
51
52 test-share: uzbl
53         XDG_DATA_HOME=/usr/share/uzbl/examples/data XDG_CONFIG_HOME=/usr/share/uzbl/examples/config ./uzbl --uri http://www.uzbl.org --verbose
54
55         
56 clean:
57         rm -f uzbl
58         rm -f uzblctrl
59         rm -f uzbl.o
60         cd ./tests/; $(MAKE) clean
61
62 install:
63         install -d $(PREFIX)/bin
64         install -d $(PREFIX)/share/uzbl/docs
65         install -d $(PREFIX)/share/uzbl/examples
66         install -D -m755 uzbl $(PREFIX)/bin/uzbl
67         install -D -m755 uzblctrl $(PREFIX)/bin/uzblctrl
68         cp -ax docs     $(PREFIX)/share/uzbl/
69         cp -ax config.h $(PREFIX)/share/uzbl/docs/
70         cp -ax examples $(PREFIX)/share/uzbl/
71         install -D -m644 AUTHORS $(PREFIX)/share/uzbl/docs
72         install -D -m644 README  $(PREFIX)/share/uzbl/docs
73
74
75 uninstall:
76         rm -rf $(PREFIX)/bin/uzbl
77         rm -rf $(PREFIX)/bin/uzblctrl
78         rm -rf $(PREFIX)/share/uzbl