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