Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 1 | # Makefile for secure rtp |
| 2 | # |
| 3 | # David A. McGrew |
| 4 | # Cisco Systems, Inc. |
| 5 | |
| 6 | # targets: |
| 7 | # |
| 8 | # runtest runs test applications |
| 9 | # test builds test applications |
| 10 | # libcrypt.a static library implementing crypto engine |
| 11 | # libsrtp.a static library implementing srtp |
jfigus | 5004642 | 2013-10-10 08:35:16 -0400 | [diff] [blame] | 12 | # libsrtp.so shared library implementing srtp |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 13 | # clean removes objects, libs, and executables |
David McGrew | b67061f | 2005-09-28 14:23:06 +0000 | [diff] [blame] | 14 | # distribution cleans and builds a .tgz |
| 15 | # tags builds etags file from all .c and .h files |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 16 | |
jfigus | 8c36da2 | 2013-10-01 16:41:19 -0400 | [diff] [blame] | 17 | USE_OPENSSL = @USE_OPENSSL@ |
Bernardo Torres | b3c5142 | 2014-10-14 12:40:09 -0300 | [diff] [blame] | 18 | HAVE_PCAP = @HAVE_PCAP@ |
Saúl Ibarra Corretgé | b86063c | 2014-10-01 11:23:24 +0200 | [diff] [blame] | 19 | HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ |
jfigus | 8c36da2 | 2013-10-01 16:41:19 -0400 | [diff] [blame] | 20 | |
Nirbheek Chauhan | cae277e | 2014-11-05 18:35:14 +0530 | [diff] [blame] | 21 | .PHONY: all shared_library test build_table_apps |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 22 | |
David McGrew | b67061f | 2005-09-28 14:23:06 +0000 | [diff] [blame] | 23 | all: test |
| 24 | |
David McGrew | 5529f10 | 2005-09-29 11:25:10 +0000 | [diff] [blame] | 25 | runtest: build_table_apps test |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 26 | @echo "running libsrtp test applications..." |
Marcus Sundberg | b0a9311 | 2005-10-02 21:11:33 +0000 | [diff] [blame] | 27 | crypto/test/cipher_driver$(EXE) -v >/dev/null |
| 28 | crypto/test/kernel_driver$(EXE) -v >/dev/null |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 29 | test/rdbx_driver$(EXE) -v >/dev/null |
| 30 | test/srtp_driver$(EXE) -v >/dev/null |
| 31 | test/roc_driver$(EXE) -v >/dev/null |
David McGrew | 11b2e41 | 2006-03-16 19:13:31 +0000 | [diff] [blame] | 32 | test/replay_driver$(EXE) -v >/dev/null |
David McGrew | 0cb86ee | 2006-07-07 15:46:57 +0000 | [diff] [blame] | 33 | test/dtls_srtp_driver$(EXE) >/dev/null |
Rich Rodriguez | 29b152e | 2014-07-01 06:01:33 +0000 | [diff] [blame] | 34 | crypto/test/rand_gen_soak$(EXE) -v >/dev/null |
Jonathan Lennox | f464743 | 2010-05-14 23:17:51 +0000 | [diff] [blame] | 35 | cd test; $(abspath $(srcdir))/test/rtpw_test.sh >/dev/null |
jfigus | 8c36da2 | 2013-10-01 16:41:19 -0400 | [diff] [blame] | 36 | ifeq (1, $(USE_OPENSSL)) |
| 37 | cd test; $(abspath $(srcdir))/test/rtpw_test_gcm.sh >/dev/null |
| 38 | endif |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 39 | @echo "libsrtp test applications passed." |
Marcus Sundberg | 589127e | 2005-09-29 13:34:06 +0000 | [diff] [blame] | 40 | $(MAKE) -C crypto runtest |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 41 | |
| 42 | # makefile variables |
| 43 | |
Marcus Sundberg | 589127e | 2005-09-29 13:34:06 +0000 | [diff] [blame] | 44 | CC = @CC@ |
Marcus Sundberg | 8ebe5ce | 2005-09-29 13:59:56 +0000 | [diff] [blame] | 45 | INCDIR = -Icrypto/include -I$(srcdir)/include -I$(srcdir)/crypto/include |
jfigus | 4494760 | 2014-10-08 13:08:52 -0400 | [diff] [blame] | 46 | DEFS = @DEFS@ |
Nirbheek Chauhan | cae277e | 2014-11-05 18:35:14 +0530 | [diff] [blame] | 47 | CPPFLAGS= -fPIC @CPPFLAGS@ |
Marcus Sundberg | 589127e | 2005-09-29 13:34:06 +0000 | [diff] [blame] | 48 | CFLAGS = @CFLAGS@ |
| 49 | LIBS = @LIBS@ |
Nirbheek Chauhan | cae277e | 2014-11-05 18:35:14 +0530 | [diff] [blame] | 50 | LDFLAGS = -L. @LDFLAGS@ |
Marcus Sundberg | 8ebe5ce | 2005-09-29 13:59:56 +0000 | [diff] [blame] | 51 | COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS) |
Marcus Sundberg | 589127e | 2005-09-29 13:34:06 +0000 | [diff] [blame] | 52 | SRTPLIB = -lsrtp |
David McGrew | b67061f | 2005-09-28 14:23:06 +0000 | [diff] [blame] | 53 | |
Marcus Sundberg | 589127e | 2005-09-29 13:34:06 +0000 | [diff] [blame] | 54 | RANLIB = @RANLIB@ |
| 55 | INSTALL = @INSTALL@ |
David McGrew | b67061f | 2005-09-28 14:23:06 +0000 | [diff] [blame] | 56 | |
Marcus Sundberg | 95e2372 | 2005-10-02 19:44:28 +0000 | [diff] [blame] | 57 | # EXE defines the suffix on executables - it's .exe for Windows, and |
| 58 | # null on linux, bsd, and OS X and other OSes. |
| 59 | EXE = @EXE@ |
Cullen Jennings | ef29a90 | 2013-04-30 12:54:54 -0600 | [diff] [blame] | 60 | |
Marcus Sundberg | 95e2372 | 2005-10-02 19:44:28 +0000 | [diff] [blame] | 61 | # gdoi is the group domain of interpretation for isakmp, a group key |
| 62 | # management system which can provide keys for srtp |
| 63 | gdoi = @GDOI_OBJS@ |
Cullen Jennings | ef29a90 | 2013-04-30 12:54:54 -0600 | [diff] [blame] | 64 | |
Marcus Sundberg | 5c714e4 | 2005-10-03 15:16:06 +0000 | [diff] [blame] | 65 | # Random source. |
| 66 | RNG_OBJS = @RNG_OBJS@ |
jfigus | 0d3a268 | 2013-04-02 15:42:37 -0400 | [diff] [blame] | 67 | HMAC_OBJS = @HMAC_OBJS@ |
jfigus | a14b5a0 | 2013-03-29 12:24:12 -0400 | [diff] [blame] | 68 | RNG_EXTRA_OBJS = @RNG_EXTRA_OBJS@ |
jfigus | 0d3a268 | 2013-04-02 15:42:37 -0400 | [diff] [blame] | 69 | AES_ICM_OBJS = @AES_ICM_OBJS@ |
Marcus Sundberg | 95e2372 | 2005-10-02 19:44:28 +0000 | [diff] [blame] | 70 | |
Marcus Sundberg | 8ebe5ce | 2005-09-29 13:59:56 +0000 | [diff] [blame] | 71 | srcdir = @srcdir@ |
| 72 | top_srcdir = @top_srcdir@ |
| 73 | top_builddir = @top_builddir@ |
| 74 | VPATH = @srcdir@ |
David McGrew | b67061f | 2005-09-28 14:23:06 +0000 | [diff] [blame] | 75 | prefix = @prefix@ |
| 76 | exec_prefix = @exec_prefix@ |
| 77 | includedir = @includedir@ |
| 78 | libdir = @libdir@ |
Nirbheek Chauhan | cae277e | 2014-11-05 18:35:14 +0530 | [diff] [blame] | 79 | bindir = @bindir@ |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 80 | |
Saúl Ibarra Corretgé | b86063c | 2014-10-01 11:23:24 +0200 | [diff] [blame] | 81 | ifeq (1, $(HAVE_PKG_CONFIG)) |
| 82 | pkgconfigdir = $(libdir)/pkgconfig |
| 83 | pkgconfig_DATA = libsrtp.pc |
| 84 | endif |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 85 | |
Nirbheek Chauhan | cae277e | 2014-11-05 18:35:14 +0530 | [diff] [blame] | 86 | SHAREDLIBVERSION = 1 |
| 87 | ifeq (linux,$(findstring linux,@host@)) |
| 88 | SHAREDLIB_DIR = $(libdir) |
| 89 | SHAREDLIB_LDFLAGS = -shared -Wl,-soname,$@ |
| 90 | SHAREDLIBSUFFIXNOVER = so |
| 91 | SHAREDLIBSUFFIX = $(SHAREDLIBSUFFIXNOVER).$(SHAREDLIBVERSION) |
| 92 | else ifeq (mingw,$(findstring mingw,@host@)) |
| 93 | SHAREDLIB_DIR = $(bindir) |
| 94 | SHAREDLIB_LDFLAGS = -shared -Wl,--out-implib,libsrtp.dll.a |
| 95 | SHAREDLIBVERSION = |
| 96 | SHAREDLIBSUFFIXNOVER = dll |
| 97 | SHAREDLIBSUFFIX = $(SHAREDLIBSUFFIXNOVER) |
| 98 | else ifeq (darwin,$(findstring darwin,@host@)) |
| 99 | SHAREDLIB_DIR = $(libdir) |
| 100 | SHAREDLIB_LDFLAGS = -dynamiclib -twolevel_namespace -undefined dynamic_lookup \ |
| 101 | -fno-common -headerpad_max_install_names -install_name $(libdir)/$@ |
| 102 | SHAREDLIBSUFFIXNOVER = dylib |
| 103 | SHAREDLIBSUFFIX = $(SHAREDLIBVERSION).$(SHAREDLIBSUFFIXNOVER) |
| 104 | endif |
| 105 | |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 106 | # implicit rules for object files and test apps |
| 107 | |
| 108 | %.o: %.c |
Marcus Sundberg | 8ebe5ce | 2005-09-29 13:59:56 +0000 | [diff] [blame] | 109 | $(COMPILE) -c $< -o $@ |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 110 | |
Marcus Sundberg | 1f84c40 | 2005-10-06 13:59:21 +0000 | [diff] [blame] | 111 | %$(EXE): %.c |
Marcus Sundberg | 95e2372 | 2005-10-02 19:44:28 +0000 | [diff] [blame] | 112 | $(COMPILE) $(LDFLAGS) $< -o $@ $(SRTPLIB) $(LIBS) |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 113 | |
| 114 | |
| 115 | # libcrypt.a (the crypto engine) |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 116 | ciphers = crypto/cipher/cipher.o crypto/cipher/null_cipher.o \ |
jfigus | 0d3a268 | 2013-04-02 15:42:37 -0400 | [diff] [blame] | 117 | $(AES_ICM_OBJS) |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 118 | |
jfigus | 0d3a268 | 2013-04-02 15:42:37 -0400 | [diff] [blame] | 119 | hashes = crypto/hash/null_auth.o crypto/hash/auth.o \ |
| 120 | $(HMAC_OBJS) |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 121 | |
| 122 | replay = crypto/replay/rdb.o crypto/replay/rdbx.o \ |
| 123 | crypto/replay/ut_sim.o |
| 124 | |
| 125 | math = crypto/math/datatypes.o crypto/math/stat.o |
| 126 | |
| 127 | ust = crypto/ust/ust.o |
| 128 | |
jfigus | a14b5a0 | 2013-03-29 12:24:12 -0400 | [diff] [blame] | 129 | rng = crypto/rng/$(RNG_OBJS) $(RNG_EXTRA_OBJS) |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 130 | |
| 131 | err = crypto/kernel/err.o |
| 132 | |
| 133 | kernel = crypto/kernel/crypto_kernel.o crypto/kernel/alloc.o \ |
| 134 | crypto/kernel/key.o $(rng) $(err) # $(ust) |
| 135 | |
| 136 | cryptobj = $(ciphers) $(hashes) $(math) $(stat) $(kernel) $(replay) |
| 137 | |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 138 | # libsrtp.a (implements srtp processing) |
| 139 | |
David McGrew | 79870d6 | 2007-06-15 18:17:39 +0000 | [diff] [blame] | 140 | srtpobj = srtp/srtp.o srtp/ekt.o |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 141 | |
| 142 | libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi) |
Marcus Sundberg | 8ebe5ce | 2005-09-29 13:59:56 +0000 | [diff] [blame] | 143 | ar cr libsrtp.a $^ |
Marcus Sundberg | 589127e | 2005-09-29 13:34:06 +0000 | [diff] [blame] | 144 | $(RANLIB) libsrtp.a |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 145 | |
Nirbheek Chauhan | cae277e | 2014-11-05 18:35:14 +0530 | [diff] [blame] | 146 | libsrtp.$(SHAREDLIBSUFFIX): $(srtpobj) $(cryptobj) $(gdoi) |
| 147 | $(CC) -shared -o $@ $(SHAREDLIB_LDFLAGS) \ |
| 148 | $^ $(LDFLAGS) $(LIBS) |
| 149 | if [ -n "$(SHAREDLIBVERSION)" ]; then \ |
| 150 | ln -sfn $@ libsrtp.$(SHAREDLIBSUFFIXNOVER); \ |
| 151 | fi |
| 152 | |
| 153 | shared_library: libsrtp.$(SHAREDLIBSUFFIX) |
jfigus | 5004642 | 2013-10-10 08:35:16 -0400 | [diff] [blame] | 154 | |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 155 | # libcryptomath.a contains general-purpose routines that are used to |
| 156 | # generate tables and verify cryptoalgorithm implementations - this |
| 157 | # library is not meant to be included in production code |
| 158 | |
David McGrew | b67061f | 2005-09-28 14:23:06 +0000 | [diff] [blame] | 159 | cryptomath = crypto/math/math.o crypto/math/gf2_8.o |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 160 | |
| 161 | libcryptomath.a: $(cryptomath) |
| 162 | ar cr libcryptomath.a $(cryptomath) |
Marcus Sundberg | 589127e | 2005-09-29 13:34:06 +0000 | [diff] [blame] | 163 | $(RANLIB) libcryptomath.a |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 164 | |
| 165 | |
| 166 | # test applications |
jfigus | 0d3a268 | 2013-04-02 15:42:37 -0400 | [diff] [blame] | 167 | ifneq (1, $(USE_OPENSSL)) |
| 168 | AES_CALC = crypto/test/aes_calc$(EXE) |
| 169 | endif |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 170 | |
jfigus | 0d3a268 | 2013-04-02 15:42:37 -0400 | [diff] [blame] | 171 | crypto_testapp = $(AES_CALC) crypto/test/cipher_driver$(EXE) \ |
Marcus Sundberg | b0a9311 | 2005-10-02 21:11:33 +0000 | [diff] [blame] | 172 | crypto/test/datatypes_driver$(EXE) crypto/test/kernel_driver$(EXE) \ |
| 173 | crypto/test/rand_gen$(EXE) crypto/test/sha1_driver$(EXE) \ |
Rich Rodriguez | 29b152e | 2014-07-01 06:01:33 +0000 | [diff] [blame] | 174 | crypto/test/stat_driver$(EXE) crypto/test/rand_gen_soak$(EXE) |
Marcus Sundberg | b0a9311 | 2005-10-02 21:11:33 +0000 | [diff] [blame] | 175 | |
| 176 | testapp = $(crypto_testapp) test/srtp_driver$(EXE) test/replay_driver$(EXE) \ |
David McGrew | 0cb86ee | 2006-07-07 15:46:57 +0000 | [diff] [blame] | 177 | test/roc_driver$(EXE) test/rdbx_driver$(EXE) test/rtpw$(EXE) \ |
David McGrew | 5506a8b | 2006-07-18 17:42:42 +0000 | [diff] [blame] | 178 | test/dtls_srtp_driver$(EXE) |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 179 | |
jfigus | 98bb4fb | 2014-10-15 09:48:03 -0400 | [diff] [blame] | 180 | ifeq (1, $(HAVE_PCAP)) |
| 181 | testapp += test/rtp_decoder$(EXE) |
| 182 | endif |
| 183 | |
Marcus Sundberg | 1f84c40 | 2005-10-06 13:59:21 +0000 | [diff] [blame] | 184 | $(testapp): libsrtp.a |
| 185 | |
Christian Oien | 9e4c091 | 2014-10-29 09:11:16 +0100 | [diff] [blame] | 186 | test/rtpw$(EXE): test/rtpw.c test/rtp.c test/getopt_s.c \ |
| 187 | crypto/math/datatypes.c |
| 188 | $(COMPILE) -DTESTAPP_SOURCE=1 $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) |
David McGrew | 79bd301 | 2006-07-17 20:41:21 +0000 | [diff] [blame] | 189 | |
Bernardo Torres | b3c5142 | 2014-10-14 12:40:09 -0300 | [diff] [blame] | 190 | ifeq (1, $(HAVE_PCAP)) |
Christian Oien | 9e4c091 | 2014-10-29 09:11:16 +0100 | [diff] [blame] | 191 | test/rtp_decoder$(EXE): test/rtp_decoder.c test/rtp.c test/getopt_s.c \ |
| 192 | crypto/math/datatypes.c |
| 193 | $(COMPILE) -DTESTAPP_SOURCE=1 $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) |
Bernardo Torres | b3c5142 | 2014-10-14 12:40:09 -0300 | [diff] [blame] | 194 | endif |
| 195 | |
David McGrew | 79bd301 | 2006-07-17 20:41:21 +0000 | [diff] [blame] | 196 | test/srtp_driver$(EXE): test/srtp_driver.c test/getopt_s.c |
| 197 | $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) |
| 198 | |
| 199 | test/rdbx_driver$(EXE): test/rdbx_driver.c test/getopt_s.c |
| 200 | $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) |
| 201 | |
| 202 | test/dtls_srtp_driver$(EXE): test/dtls_srtp_driver.c test/getopt_s.c |
Marcus Sundberg | 8ebe5ce | 2005-09-29 13:59:56 +0000 | [diff] [blame] | 203 | $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 204 | |
Joachim Bauch | 4cdf467 | 2015-03-27 16:56:43 +0100 | [diff] [blame^] | 205 | crypto/test/cipher_driver$(EXE): crypto/test/cipher_driver.c test/getopt_s.c |
| 206 | $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) |
| 207 | |
| 208 | crypto/test/kernel_driver$(EXE): crypto/test/kernel_driver.c test/getopt_s.c |
| 209 | $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) |
| 210 | |
| 211 | crypto/test/rand_gen$(EXE): crypto/test/rand_gen.c test/getopt_s.c |
| 212 | $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) |
| 213 | |
| 214 | crypto/test/rand_gen_soak$(EXE): crypto/test/rand_gen_soak.c test/getopt_s.c |
| 215 | $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB) |
| 216 | |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 217 | test: $(testapp) |
David McGrew | b67061f | 2005-09-28 14:23:06 +0000 | [diff] [blame] | 218 | @echo "Build done. Please run '$(MAKE) runtest' to run self tests." |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 219 | |
| 220 | memtest: test/srtp_driver |
| 221 | @test/srtp_driver -v -d "alloc" > tmp |
| 222 | @grep freed tmp | wc -l > freed |
| 223 | @grep allocated tmp | wc -l > allocated |
| 224 | @echo "checking for memory leaks (only works with --enable-stdout)" |
| 225 | cmp -s allocated freed |
| 226 | @echo "passed (same number of alloc() and dealloc() calls found)" |
| 227 | @rm freed allocated tmp |
| 228 | |
| 229 | # tables_apps are used to generate the tables used in the crypto |
| 230 | # implementations; these need only be generated during porting, not |
| 231 | # for building libsrtp or the test applications |
| 232 | |
David McGrew | 5529f10 | 2005-09-29 11:25:10 +0000 | [diff] [blame] | 233 | table_apps = tables/aes_tables |
David McGrew | b67061f | 2005-09-28 14:23:06 +0000 | [diff] [blame] | 234 | |
David McGrew | 5529f10 | 2005-09-29 11:25:10 +0000 | [diff] [blame] | 235 | build_table_apps: $(table_apps) |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 236 | |
| 237 | # in the tables/ subdirectory, we use libcryptomath instead of libsrtp |
| 238 | |
| 239 | tables/%: tables/%.c libcryptomath.a |
Marcus Sundberg | 8ebe5ce | 2005-09-29 13:59:56 +0000 | [diff] [blame] | 240 | $(COMPILE) $(LDFLAGS) $< -o $@ $(LIBS) libcryptomath.a |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 241 | |
| 242 | # the target 'plot' runs the timing test (test/srtp_driver -t) then |
| 243 | # uses gnuplot to produce plots of the results - see the script file |
| 244 | # 'timing' |
| 245 | |
| 246 | plot: test/srtp_driver |
| 247 | test/srtp_driver -t > timing.dat |
| 248 | |
| 249 | |
| 250 | # bookkeeping: tags, clean, and distribution |
| 251 | |
| 252 | tags: |
| 253 | etags */*.[ch] */*/*.[ch] |
| 254 | |
| 255 | |
| 256 | # documentation - the target libsrtpdoc builds a PDF file documenting |
| 257 | # libsrtp |
| 258 | |
| 259 | libsrtpdoc: |
Marcus Sundberg | 589127e | 2005-09-29 13:34:06 +0000 | [diff] [blame] | 260 | $(MAKE) -C doc |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 261 | |
Jonathan Lennox | fc65552 | 2010-05-21 17:45:35 +0000 | [diff] [blame] | 262 | .PHONY: clean superclean distclean install |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 263 | |
| 264 | install: |
David McGrew | b67061f | 2005-09-28 14:23:06 +0000 | [diff] [blame] | 265 | $(INSTALL) -d $(DESTDIR)$(includedir)/srtp |
| 266 | $(INSTALL) -d $(DESTDIR)$(libdir) |
Nirbheek Chauhan | cae277e | 2014-11-05 18:35:14 +0530 | [diff] [blame] | 267 | $(INSTALL) -d $(DESTDIR)$(bindir) |
Jonathan Lennox | f464743 | 2010-05-14 23:17:51 +0000 | [diff] [blame] | 268 | cp $(srcdir)/include/*.h $(DESTDIR)$(includedir)/srtp |
| 269 | cp $(srcdir)/crypto/include/*.h $(DESTDIR)$(includedir)/srtp |
| 270 | if [ "$(srcdir)" != "." ]; then cp crypto/include/*.h $(DESTDIR)$(includedir)/srtp; fi |
David McGrew | 7c7ff31 | 2006-02-23 14:11:11 +0000 | [diff] [blame] | 271 | if [ -f libsrtp.a ]; then cp libsrtp.a $(DESTDIR)$(libdir)/; fi |
Nirbheek Chauhan | cae277e | 2014-11-05 18:35:14 +0530 | [diff] [blame] | 272 | if [ -f libsrtp.dll.a ]; then cp libsrtp.dll.a $(DESTDIR)$(libdir)/; fi |
| 273 | if [ -f libsrtp.$(SHAREDLIBSUFFIX) ]; then \ |
| 274 | cp libsrtp.$(SHAREDLIBSUFFIX) $(DESTDIR)$(SHAREDLIB_DIR)/; \ |
| 275 | cp libsrtp.$(SHAREDLIBSUFFIXNOVER) $(DESTDIR)$(SHAREDLIB_DIR)/; \ |
| 276 | fi |
Saúl Ibarra Corretgé | b86063c | 2014-10-01 11:23:24 +0200 | [diff] [blame] | 277 | if [ "$(pkgconfig_DATA)" != "" ]; then \ |
| 278 | $(INSTALL) -d $(DESTDIR)$(pkgconfigdir); \ |
Tom Hughes | 6fd7fa4 | 2014-12-09 13:32:33 -0800 | [diff] [blame] | 279 | cp $(top_builddir)/$(pkgconfig_DATA) $(DESTDIR)$(pkgconfigdir)/; \ |
Saúl Ibarra Corretgé | b86063c | 2014-10-01 11:23:24 +0200 | [diff] [blame] | 280 | fi |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 281 | |
| 282 | uninstall: |
Jonathan Lennox | a7897f0 | 2010-05-14 23:34:10 +0000 | [diff] [blame] | 283 | rm -f $(DESTDIR)$(includedir)/srtp/*.h |
Nirbheek Chauhan | cae277e | 2014-11-05 18:35:14 +0530 | [diff] [blame] | 284 | rm -f $(DESTDIR)$(libdir)/libsrtp.* |
Jonathan Lennox | a7897f0 | 2010-05-14 23:34:10 +0000 | [diff] [blame] | 285 | -rmdir $(DESTDIR)$(includedir)/srtp |
Saúl Ibarra Corretgé | b86063c | 2014-10-01 11:23:24 +0200 | [diff] [blame] | 286 | if [ "$(pkgconfig_DATA)" != "" ]; then \ |
| 287 | rm -f $(DESTDIR)$(pkgconfigdir)/$(pkgconfig_DATA); \ |
| 288 | fi |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 289 | |
| 290 | clean: |
David McGrew | 5506a8b | 2006-07-18 17:42:42 +0000 | [diff] [blame] | 291 | rm -rf $(cryptobj) $(srtpobj) $(cryptomath) TAGS \ |
jfigus | de35bea | 2014-12-01 11:07:12 -0500 | [diff] [blame] | 292 | libcryptomath.a libsrtp.a libsrtp.so libsrtp.dll.a core *.core test/core |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 293 | for a in * */* */*/*; do \ |
| 294 | if [ -f "$$a~" ] ; then rm -f $$a~; fi; \ |
| 295 | done; |
| 296 | for a in $(testapp) $(table_apps); do rm -rf $$a$(EXE); done |
| 297 | rm -rf *.pict *.jpg *.dat |
| 298 | rm -rf freed allocated tmp |
Marcus Sundberg | 589127e | 2005-09-29 13:34:06 +0000 | [diff] [blame] | 299 | $(MAKE) -C doc clean |
| 300 | $(MAKE) -C crypto clean |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 301 | |
| 302 | |
| 303 | superclean: clean |
David McGrew | e11033e | 2005-09-26 20:41:14 +0000 | [diff] [blame] | 304 | rm -rf crypto/include/config.h config.log config.cache config.status \ |
Jonathan Lennox | fc65552 | 2010-05-21 17:45:35 +0000 | [diff] [blame] | 305 | Makefile crypto/Makefile doc/Makefile \ |
| 306 | .gdb_history test/.gdb_history .DS_Store |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 307 | rm -rf autom4te.cache |
| 308 | |
Jonathan Lennox | fc65552 | 2010-05-21 17:45:35 +0000 | [diff] [blame] | 309 | distclean: superclean |
| 310 | |
Cullen Jennings | ef29a90 | 2013-04-30 12:54:54 -0600 | [diff] [blame] | 311 | distname = libsrtp-$(shell cat VERSION) |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 312 | |
David McGrew | b67061f | 2005-09-28 14:23:06 +0000 | [diff] [blame] | 313 | distribution: runtest superclean |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 314 | if ! [ -f VERSION ]; then exit 1; fi |
| 315 | if [ -f ../$(distname).tgz ]; then \ |
| 316 | mv ../$(distname).tgz ../$(distname).tgz.bak; \ |
| 317 | fi |
Cullen Jennings | ef29a90 | 2013-04-30 12:54:54 -0600 | [diff] [blame] | 318 | cd ..; tar cvzf $(distname).tgz libsrtp |
Cullen Jennings | 235513a | 2005-09-21 22:51:36 +0000 | [diff] [blame] | 319 | |
Marcus Sundberg | 8ebe5ce | 2005-09-29 13:59:56 +0000 | [diff] [blame] | 320 | # EOF |