blob: e5702710e516b487838181a4ecfa0326c0c9bd0e [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001
2DESTDIR=/usr/local
Manuel Pégourié-Gonnard52859702015-01-27 14:05:16 +01003PREFIX=mbedtls_
Paul Bakker5121ce52009-01-03 21:22:43 +00004
5.SILENT:
6
7all:
Paul Bakker690b93d2010-06-18 16:42:26 +00008 cd library && $(MAKE) all && cd ..
9 cd programs && $(MAKE) all && cd ..
Paul Bakker44b819a2011-06-21 08:59:00 +000010 cd tests && $(MAKE) all && cd ..
Paul Bakker5121ce52009-01-03 21:22:43 +000011
Paul Bakkerf9964ab2012-04-05 12:07:50 +000012no_test:
13 cd library && $(MAKE) all && cd ..
14 cd programs && $(MAKE) all && cd ..
15
16lib:
17 cd library && $(MAKE) all && cd ..
18
Paul Bakker5121ce52009-01-03 21:22:43 +000019install:
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000020 mkdir -p $(DESTDIR)/include/mbedtls
21 cp -r include/mbedtls $(DESTDIR)/include
Paul Bakker5121ce52009-01-03 21:22:43 +000022
23 mkdir -p $(DESTDIR)/lib
Manuel Pégourié-Gonnard129db082015-03-09 16:57:18 +000024 cp library/libmbedtls.* $(DESTDIR)/lib
Paul Bakker5121ce52009-01-03 21:22:43 +000025
26 mkdir -p $(DESTDIR)/bin
27 for p in programs/*/* ; do \
28 if [ -x $$p ] && [ ! -d $$p ] ; \
29 then \
30 f=$(PREFIX)`basename $$p` ; \
31 cp $$p $(DESTDIR)/bin/$$f ; \
Manuel Pégourié-Gonnard52859702015-01-27 14:05:16 +010032 ln -sf $$f $(DESTDIR)/bin/$$o ; \
Paul Bakker5121ce52009-01-03 21:22:43 +000033 fi \
34 done
35
Paul Bakker9a736322012-11-14 12:39:52 +000036uninstall:
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000037 rm -rf $(DESTDIR)/include/mbedtls
Manuel Pégourié-Gonnard52859702015-01-27 14:05:16 +010038 rm -f $(DESTDIR)/lib/libmbedtls.*
Paul Bakker9a736322012-11-14 12:39:52 +000039
40 for p in programs/*/* ; do \
41 if [ -x $$p ] && [ ! -d $$p ] ; \
42 then \
43 f=$(PREFIX)`basename $$p` ; \
44 rm -f $(DESTDIR)/bin/$$f ; \
Manuel Pégourié-Gonnard52859702015-01-27 14:05:16 +010045 rm -f $(DESTDIR)/bin/$$o ; \
Paul Bakker9a736322012-11-14 12:39:52 +000046 fi \
47 done
48
Paul Bakker5121ce52009-01-03 21:22:43 +000049clean:
Paul Bakker690b93d2010-06-18 16:42:26 +000050 cd library && $(MAKE) clean && cd ..
51 cd programs && $(MAKE) clean && cd ..
Paul Bakker44b819a2011-06-21 08:59:00 +000052 cd tests && $(MAKE) clean && cd ..
Manuel Pégourié-Gonnard546d86c2014-01-31 16:19:43 +010053 find . \( -name \*.gcno -o -name \*.gcda -o -name *.info \) -exec rm {} +
Paul Bakker5121ce52009-01-03 21:22:43 +000054
Manuel Pégourié-Gonnardd75d7cf2014-01-31 13:35:18 +010055check: lib
56 ( cd tests && $(MAKE) && $(MAKE) check )
Paul Bakker37ca75d2011-01-06 12:28:03 +000057
Manuel Pégourié-Gonnard6529ff02014-01-31 13:41:07 +010058test-ref-configs:
59 tests/scripts/test-ref-configs.pl
60
Manuel Pégourié-Gonnard720375e2014-02-24 12:39:18 +010061# note: for coverage testing, build with:
62# CFLAGS='--coverage' make OFLAGS='-g3 -O0'
Manuel Pégourié-Gonnard79d090b2014-02-26 19:39:01 +010063covtest:
Manuel Pégourié-Gonnard61137df2014-02-24 11:57:36 +010064 make check
65 programs/test/selftest
66 ( cd tests && ./compat.sh )
67 ( cd tests && ./ssl-opt.sh )
68
Manuel Pégourié-Gonnard546d86c2014-01-31 16:19:43 +010069lcov:
70 rm -rf Coverage
Manuel Pégourié-Gonnard53c6e962014-06-13 12:22:07 +020071 lcov --capture --initial --directory library -o files.info
72 lcov --capture --directory library -o tests.info
Manuel Pégourié-Gonnarde41072e2014-06-16 16:24:24 +020073 lcov --add-tracefile files.info --add-tracefile tests.info -o all.info
74 lcov --remove all.info -o final.info '*.h'
Manuel Pégourié-Gonnard720375e2014-02-24 12:39:18 +010075 gendesc tests/Descriptions.txt -o descriptions
Manuel Pégourié-Gonnardafe8f532015-01-23 17:40:33 +000076 genhtml --title "mbed TLS" --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage final.info
Manuel Pégourié-Gonnarde41072e2014-06-16 16:24:24 +020077 rm -f files.info tests.info all.info final.info descriptions
Manuel Pégourié-Gonnard546d86c2014-01-31 16:19:43 +010078
Paul Bakker37ca75d2011-01-06 12:28:03 +000079apidoc:
80 mkdir -p apidoc
Manuel Pégourié-Gonnardf234ff82015-01-22 17:01:27 +000081 doxygen doxygen/mbedtls.doxyfile
Paul Bakker37ca75d2011-01-06 12:28:03 +000082
83apidoc_clean:
84 if [ -d apidoc ] ; \
85 then \
86 rm -rf apidoc ; \
87 fi