blob: 808290da130643df4af7e2fbcbf8765b0c6de016 [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_
4OLDPREFIX=polarssl_
Paul Bakker5121ce52009-01-03 21:22:43 +00005
6.SILENT:
7
8all:
Paul Bakker690b93d2010-06-18 16:42:26 +00009 cd library && $(MAKE) all && cd ..
10 cd programs && $(MAKE) all && cd ..
Paul Bakker44b819a2011-06-21 08:59:00 +000011 cd tests && $(MAKE) all && cd ..
Paul Bakker5121ce52009-01-03 21:22:43 +000012
Paul Bakkerf9964ab2012-04-05 12:07:50 +000013no_test:
14 cd library && $(MAKE) all && cd ..
15 cd programs && $(MAKE) all && cd ..
16
17lib:
18 cd library && $(MAKE) all && cd ..
19
Paul Bakker5121ce52009-01-03 21:22:43 +000020install:
Paul Bakker41d6e3a2009-01-04 16:05:10 +000021 mkdir -p $(DESTDIR)/include/polarssl
22 cp -r include/polarssl $(DESTDIR)/include
Paul Bakker5121ce52009-01-03 21:22:43 +000023
24 mkdir -p $(DESTDIR)/lib
Manuel Pégourié-Gonnard52859702015-01-27 14:05:16 +010025 cp library/libpolarssl.* library/libmbedtls.* $(DESTDIR)/lib
Paul Bakker5121ce52009-01-03 21:22:43 +000026
27 mkdir -p $(DESTDIR)/bin
28 for p in programs/*/* ; do \
29 if [ -x $$p ] && [ ! -d $$p ] ; \
30 then \
31 f=$(PREFIX)`basename $$p` ; \
Manuel Pégourié-Gonnard52859702015-01-27 14:05:16 +010032 o=$(OLDPREFIX)`basename $$p` ; \
Paul Bakker5121ce52009-01-03 21:22:43 +000033 cp $$p $(DESTDIR)/bin/$$f ; \
Manuel Pégourié-Gonnard52859702015-01-27 14:05:16 +010034 ln -sf $$f $(DESTDIR)/bin/$$o ; \
Paul Bakker5121ce52009-01-03 21:22:43 +000035 fi \
36 done
37
Paul Bakker9a736322012-11-14 12:39:52 +000038uninstall:
39 rm -rf $(DESTDIR)/include/polarssl
40 rm -f $(DESTDIR)/lib/libpolarssl.*
Manuel Pégourié-Gonnard52859702015-01-27 14:05:16 +010041 rm -f $(DESTDIR)/lib/libmbedtls.*
Paul Bakker9a736322012-11-14 12:39:52 +000042
43 for p in programs/*/* ; do \
44 if [ -x $$p ] && [ ! -d $$p ] ; \
45 then \
46 f=$(PREFIX)`basename $$p` ; \
Manuel Pégourié-Gonnard52859702015-01-27 14:05:16 +010047 o=$(OLDPREFIX)`basename $$p` ; \
Paul Bakker9a736322012-11-14 12:39:52 +000048 rm -f $(DESTDIR)/bin/$$f ; \
Manuel Pégourié-Gonnard52859702015-01-27 14:05:16 +010049 rm -f $(DESTDIR)/bin/$$o ; \
Paul Bakker9a736322012-11-14 12:39:52 +000050 fi \
51 done
52
Paul Bakker5121ce52009-01-03 21:22:43 +000053clean:
Paul Bakker690b93d2010-06-18 16:42:26 +000054 cd library && $(MAKE) clean && cd ..
55 cd programs && $(MAKE) clean && cd ..
Paul Bakker44b819a2011-06-21 08:59:00 +000056 cd tests && $(MAKE) clean && cd ..
Manuel Pégourié-Gonnard546d86c2014-01-31 16:19:43 +010057 find . \( -name \*.gcno -o -name \*.gcda -o -name *.info \) -exec rm {} +
Paul Bakker5121ce52009-01-03 21:22:43 +000058
Manuel Pégourié-Gonnardd75d7cf2014-01-31 13:35:18 +010059check: lib
60 ( cd tests && $(MAKE) && $(MAKE) check )
Paul Bakker37ca75d2011-01-06 12:28:03 +000061
Manuel Pégourié-Gonnard6529ff02014-01-31 13:41:07 +010062test-ref-configs:
63 tests/scripts/test-ref-configs.pl
64
Manuel Pégourié-Gonnard720375e2014-02-24 12:39:18 +010065# note: for coverage testing, build with:
66# CFLAGS='--coverage' make OFLAGS='-g3 -O0'
Manuel Pégourié-Gonnard79d090b2014-02-26 19:39:01 +010067covtest:
Manuel Pégourié-Gonnard61137df2014-02-24 11:57:36 +010068 make check
69 programs/test/selftest
70 ( cd tests && ./compat.sh )
71 ( cd tests && ./ssl-opt.sh )
72
Manuel Pégourié-Gonnard546d86c2014-01-31 16:19:43 +010073lcov:
74 rm -rf Coverage
Manuel Pégourié-Gonnard53c6e962014-06-13 12:22:07 +020075 lcov --capture --initial --directory library -o files.info
76 lcov --capture --directory library -o tests.info
Manuel Pégourié-Gonnarde41072e2014-06-16 16:24:24 +020077 lcov --add-tracefile files.info --add-tracefile tests.info -o all.info
78 lcov --remove all.info -o final.info '*.h'
Manuel Pégourié-Gonnard720375e2014-02-24 12:39:18 +010079 gendesc tests/Descriptions.txt -o descriptions
Manuel Pégourié-Gonnardafe8f532015-01-23 17:40:33 +000080 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 +020081 rm -f files.info tests.info all.info final.info descriptions
Manuel Pégourié-Gonnard546d86c2014-01-31 16:19:43 +010082
Paul Bakker37ca75d2011-01-06 12:28:03 +000083apidoc:
84 mkdir -p apidoc
Manuel Pégourié-Gonnardf234ff82015-01-22 17:01:27 +000085 doxygen doxygen/mbedtls.doxyfile
Paul Bakker37ca75d2011-01-06 12:28:03 +000086
87apidoc_clean:
88 if [ -d apidoc ] ; \
89 then \
90 rm -rf apidoc ; \
91 fi