blob: ec09f9cca8f9eefb5d0d7d3351558c11b8ccd509 [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
Manuel Pégourié-Gonnard720375e2014-02-24 12:39:18 +010063 # add programs/test/selftest even though the selftest functions are
64 # called from the testsuites since it runs them in verbose mode,
65 # avoiding spurious "uncovered" printf lines
Manuel Pégourié-Gonnard61137df2014-02-24 11:57:36 +010066 programs/test/selftest
67 ( cd tests && ./compat.sh )
68 ( cd tests && ./ssl-opt.sh )
69
Manuel Pégourié-Gonnard546d86c2014-01-31 16:19:43 +010070lcov:
71 rm -rf Coverage
Manuel Pégourié-Gonnard720375e2014-02-24 12:39:18 +010072 lcov --capture --directory library -o polarssl.info
73 gendesc tests/Descriptions.txt -o descriptions
74 genhtml --title PolarSSL --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage polarssl.info
75 rm -f polarssl.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