blob: 9538f0bbdffa85c3c49f80cc2f722a32cac57986 [file] [log] [blame]
Alexandre Lision8af73cb2013-12-10 14:11:20 -05001include ../../../build.mak
2include ../../../build/common.mak
3
4export LIBDIR := ../../lib
5
6RULES_MAK := $(PJDIR)/build/rules.mak
7
8export SRTP_LIB := libsrtp-$(TARGET_NAME)$(LIBEXT)
9
10ifeq ($(PJ_SHARED_LIBRARIES),)
11else
12export SRTP_SONAME := libsrtp.$(SHLIB_SUFFIX)
13export SRTP_SHLIB := $(SRTP_SONAME).$(PJ_VERSION_MAJOR)
14endif
15
16###############################################################################
17# Gather all flags.
18#
19export _CFLAGS := $(CC_INC). $(CC_INC)../../srtp/crypto/include \
20 $(CC_INC)../../srtp/include \
21 $(CC_INC)../../../pjlib/include \
22 $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \
23 $(CFLAGS)
24export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \
25 $(HOST_CXXFLAGS) $(CXXFLAGS)
26export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
27 $(LDFLAGS)
28
29# libcrypt.a (the crypto engine)
30ciphers = crypto/cipher/cipher.o crypto/cipher/null_cipher.o \
31 crypto/cipher/aes.o crypto/cipher/aes_icm.o \
32 crypto/cipher/aes_cbc.o
33
34hashes = crypto/hash/null_auth.o crypto/hash/sha1.o \
35 crypto/hash/hmac.o crypto/hash/auth.o # crypto/hash/tmmhv2.o
36
37replay = crypto/replay/rdb.o crypto/replay/rdbx.o \
38 crypto/replay/ut_sim.o
39
40math = crypto/math/datatypes.o crypto/math/stat.o
41
42ust = crypto/ust/ust.o
43
44rng = crypto/rng/rand_source.o crypto/rng/prng.o crypto/rng/ctr_prng.o
45
46err = pjlib/srtp_err.o
47
48kernel = crypto/kernel/crypto_kernel.o crypto/kernel/alloc.o \
49 crypto/kernel/key.o $(rng) $(err) # $(ust)
50
51srtpobj = srtp/srtp.o
52
53cryptobj = $(ciphers) $(hashes) $(math) $(stat) $(kernel) $(replay)
54
55export SRTP_SRCDIR = ../../srtp
56export SRTP_OBJS = $(cryptobj) $(srtpobj)
57export SRTP_CFLAGS = -DHAVE_CONFIG_H $(_CFLAGS)
58
59
60export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT
61###############################################################################
62# Main entry
63#
64# $(TARGET) is defined in os-$(OS_NAME).mak file in current directory.
65#
66TARGETS := $(SRTP_LIB) $(SRTP_SONAME)
67
68all: $(TARGETS)
69
70doc:
71 cd .. && doxygen docs/doxygen.cfg
72
73dep: depend
74distclean: realclean
75
76.PHONY: all dep depend clean realclean distclean
77.PHONY: $(TARGETS)
78.PHONY: $(SRTP_LIB) $(SRTP_SONAME)
79
80libsrtp: $(SRTP_LIB)
81$(SRTP_SONAME): $(SRTP_LIB)
82$(SRTP_LIB) $(SRTP_SONAME):
83 $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)
84
85clean print_lib:
86 $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@
87
88realclean:
89 $(subst @@,$(subst /,$(HOST_PSEP),.ilbc-$(TARGET_NAME).depend),$(HOST_RMR))
90
91 $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@
92
93depend:
94 $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@
95
96
97