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