Makefile 2.09 KB
Newer Older
1 2

DESTDIR=/usr/local
3
PREFIX=mbedtls_
4 5 6

.SILENT:

7
all:	programs tests
8

9 10 11 12
no_test:	programs

programs:	lib
	$(MAKE) -C programs
Paul Bakker's avatar
Paul Bakker committed
13 14

lib:
15 16 17 18
	$(MAKE) -C library

tests:	lib
	$(MAKE) -C tests
Paul Bakker's avatar
Paul Bakker committed
19

20
install:
21 22
	mkdir -p $(DESTDIR)/include/mbedtls
	cp -r include/mbedtls $(DESTDIR)/include
23 24
	
	mkdir -p $(DESTDIR)/lib
25
	cp -RP library/libmbedtls.* $(DESTDIR)/lib
26 27 28 29 30 31 32
	
	mkdir -p $(DESTDIR)/bin
	for p in programs/*/* ; do              \
	    if [ -x $$p ] && [ ! -d $$p ] ;     \
	    then                                \
	        f=$(PREFIX)`basename $$p` ;     \
	        cp $$p $(DESTDIR)/bin/$$f ;     \
33
	        ln -sf $$f $(DESTDIR)/bin/$$o ; \
34 35 36
	    fi                                  \
	done

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

50
clean:
51 52 53
	$(MAKE) -C library clean
	$(MAKE) -C programs clean
	$(MAKE) -C tests clean
54
	find . \( -name \*.gcno -o -name \*.gcda -o -name *.info \) -exec rm {} +
55

56 57
check: tests
	$(MAKE) -C tests check
58

59 60 61
test-ref-configs:
	tests/scripts/test-ref-configs.pl

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

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

80 81
apidoc:
	mkdir -p apidoc
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
82
	doxygen doxygen/mbedtls.doxyfile
83 84 85 86 87 88

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