blob: 0807e8d2a14a24315c2e37b20c3bcb37146b8e1c [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001
2DESTDIR=/usr/local
Paul Bakker41d6e3a2009-01-04 16:05:10 +00003PREFIX=polarssl_
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:
Paul Bakker41d6e3a2009-01-04 16:05:10 +000020 mkdir -p $(DESTDIR)/include/polarssl
21 cp -r include/polarssl $(DESTDIR)/include
Paul Bakker5121ce52009-01-03 21:22:43 +000022
23 mkdir -p $(DESTDIR)/lib
Paul Bakker41d6e3a2009-01-04 16:05:10 +000024 cp library/libpolarssl.* $(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 ; \
32 fi \
33 done
34
Paul Bakker9a736322012-11-14 12:39:52 +000035uninstall:
36 rm -rf $(DESTDIR)/include/polarssl
37 rm -f $(DESTDIR)/lib/libpolarssl.*
38
39 for p in programs/*/* ; do \
40 if [ -x $$p ] && [ ! -d $$p ] ; \
41 then \
42 f=$(PREFIX)`basename $$p` ; \
43 rm -f $(DESTDIR)/bin/$$f ; \
44 fi \
45 done
46
Paul Bakker5121ce52009-01-03 21:22:43 +000047clean:
Paul Bakker690b93d2010-06-18 16:42:26 +000048 cd library && $(MAKE) clean && cd ..
49 cd programs && $(MAKE) clean && cd ..
Paul Bakker44b819a2011-06-21 08:59:00 +000050 cd tests && $(MAKE) clean && cd ..
Manuel Pégourié-Gonnard546d86c2014-01-31 16:19:43 +010051 find . \( -name \*.gcno -o -name \*.gcda -o -name *.info \) -exec rm {} +
Paul Bakker5121ce52009-01-03 21:22:43 +000052
Manuel Pégourié-Gonnardd75d7cf2014-01-31 13:35:18 +010053check: lib
54 ( cd tests && $(MAKE) && $(MAKE) check )
Paul Bakker37ca75d2011-01-06 12:28:03 +000055
Manuel Pégourié-Gonnard6529ff02014-01-31 13:41:07 +010056test-ref-configs:
57 tests/scripts/test-ref-configs.pl
58
Manuel Pégourié-Gonnard720375e2014-02-24 12:39:18 +010059# note: for coverage testing, build with:
60# CFLAGS='--coverage' make OFLAGS='-g3 -O0'
Manuel Pégourié-Gonnard79d090b2014-02-26 19:39:01 +010061covtest:
Manuel Pégourié-Gonnard61137df2014-02-24 11:57:36 +010062 make check
63 programs/test/selftest
64 ( cd tests && ./compat.sh )
65 ( cd tests && ./ssl-opt.sh )
66
Manuel Pégourié-Gonnard546d86c2014-01-31 16:19:43 +010067lcov:
68 rm -rf Coverage
Manuel Pégourié-Gonnard53c6e962014-06-13 12:22:07 +020069 lcov --capture --initial --directory library -o files.info
70 lcov --capture --directory library -o tests.info
Manuel Pégourié-Gonnarde41072e2014-06-16 16:24:24 +020071 lcov --add-tracefile files.info --add-tracefile tests.info -o all.info
72 lcov --remove all.info -o final.info '*.h'
Manuel Pégourié-Gonnard720375e2014-02-24 12:39:18 +010073 gendesc tests/Descriptions.txt -o descriptions
Manuel Pégourié-Gonnarde41072e2014-06-16 16:24:24 +020074 genhtml --title PolarSSL --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage final.info
75 rm -f files.info tests.info all.info final.info descriptions
Manuel Pégourié-Gonnard546d86c2014-01-31 16:19:43 +010076
Paul Bakker37ca75d2011-01-06 12:28:03 +000077apidoc:
78 mkdir -p apidoc
79 doxygen doxygen/polarssl.doxyfile
80
81apidoc_clean:
82 if [ -d apidoc ] ; \
83 then \
84 rm -rf apidoc ; \
85 fi