Makefile 2.17 KB
Newer Older
1 2

DESTDIR=/usr/local
Paul Bakker's avatar
Paul Bakker committed
3
PREFIX=polarssl_
4 5 6 7

.SILENT:

all:
Paul Bakker's avatar
Paul Bakker committed
8 9
	cd library  && $(MAKE) all && cd ..
	cd programs && $(MAKE) all && cd ..
Paul Bakker's avatar
Paul Bakker committed
10
	cd tests    && $(MAKE) all && cd ..
11

Paul Bakker's avatar
Paul Bakker committed
12 13 14 15 16 17 18
no_test:
	cd library  && $(MAKE) all && cd ..
	cd programs && $(MAKE) all && cd ..

lib:
	cd library  && $(MAKE) all && cd ..

19
install:
Paul Bakker's avatar
Paul Bakker committed
20 21
	mkdir -p $(DESTDIR)/include/polarssl
	cp -r include/polarssl $(DESTDIR)/include
22 23
	
	mkdir -p $(DESTDIR)/lib
Paul Bakker's avatar
Paul Bakker committed
24
	cp library/libpolarssl.* $(DESTDIR)/lib
25 26 27 28 29 30 31 32 33 34
	
	mkdir -p $(DESTDIR)/bin
	for p in programs/*/* ; do              \
	    if [ -x $$p ] && [ ! -d $$p ] ;     \
	    then                                \
	        f=$(PREFIX)`basename $$p` ;     \
	        cp $$p $(DESTDIR)/bin/$$f ;     \
	    fi                                  \
	done

35 36 37 38 39 40 41 42 43 44 45 46
uninstall:
	rm -rf $(DESTDIR)/include/polarssl
	rm -f $(DESTDIR)/lib/libpolarssl.*
	
	for p in programs/*/* ; do              \
	    if [ -x $$p ] && [ ! -d $$p ] ;     \
	    then                                \
	        f=$(PREFIX)`basename $$p` ;     \
	        rm -f $(DESTDIR)/bin/$$f ;      \
	    fi                                  \
	done

47
clean:
Paul Bakker's avatar
Paul Bakker committed
48 49
	cd library  && $(MAKE) clean && cd ..
	cd programs && $(MAKE) clean && cd ..
Paul Bakker's avatar
Paul Bakker committed
50
	cd tests    && $(MAKE) clean && cd ..
51
	find . \( -name \*.gcno -o -name \*.gcda -o -name *.info \) -exec rm {} +
52

53 54
check: lib
	( cd tests && $(MAKE) && $(MAKE) check )
55

56 57 58
test-ref-configs:
	tests/scripts/test-ref-configs.pl

59 60
# note: for coverage testing, build with:
# CFLAGS='--coverage' make OFLAGS='-g3 -O0'
61
covtest:
62 63 64 65 66
	make check
	programs/test/selftest
	( cd tests && ./compat.sh )
	( cd tests && ./ssl-opt.sh )

67 68
lcov:
	rm -rf Coverage
69 70
	lcov --capture --initial --directory library -o files.info
	lcov --capture --directory library -o tests.info
71 72
	lcov --add-tracefile files.info --add-tracefile tests.info -o all.info
	lcov --remove all.info -o final.info '*.h'
73
	gendesc tests/Descriptions.txt -o descriptions
74 75
	genhtml --title PolarSSL --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage final.info
	rm -f files.info tests.info all.info final.info descriptions
76

77 78 79 80 81 82 83 84 85
apidoc:
	mkdir -p apidoc
	doxygen doxygen/polarssl.doxyfile

apidoc_clean:
	if [ -d apidoc ] ;			\
	then				    	\
		rm -rf apidoc ;			\
	fi