Alexandre Lision | 8af73cb | 2013-12-10 14:11:20 -0500 | [diff] [blame] | 1 | include ../../../build.mak |
| 2 | include ../../../build/common.mak |
| 3 | |
| 4 | export LIBDIR := ../../lib |
| 5 | |
| 6 | RULES_MAK := $(PJDIR)/build/rules.mak |
| 7 | |
| 8 | export SRTP_LIB := libsrtp-$(TARGET_NAME)$(LIBEXT) |
| 9 | |
| 10 | ifeq ($(PJ_SHARED_LIBRARIES),) |
| 11 | else |
| 12 | export SRTP_SONAME := libsrtp.$(SHLIB_SUFFIX) |
| 13 | export SRTP_SHLIB := $(SRTP_SONAME).$(PJ_VERSION_MAJOR) |
| 14 | endif |
| 15 | |
| 16 | ############################################################################### |
| 17 | # Gather all flags. |
| 18 | # |
| 19 | export _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) |
| 24 | export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \ |
| 25 | $(HOST_CXXFLAGS) $(CXXFLAGS) |
| 26 | export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \ |
| 27 | $(LDFLAGS) |
| 28 | |
| 29 | # libcrypt.a (the crypto engine) |
| 30 | ciphers = 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 | |
| 34 | hashes = crypto/hash/null_auth.o crypto/hash/sha1.o \ |
| 35 | crypto/hash/hmac.o crypto/hash/auth.o # crypto/hash/tmmhv2.o |
| 36 | |
| 37 | replay = crypto/replay/rdb.o crypto/replay/rdbx.o \ |
| 38 | crypto/replay/ut_sim.o |
| 39 | |
| 40 | math = crypto/math/datatypes.o crypto/math/stat.o |
| 41 | |
| 42 | ust = crypto/ust/ust.o |
| 43 | |
| 44 | rng = crypto/rng/rand_source.o crypto/rng/prng.o crypto/rng/ctr_prng.o |
| 45 | |
| 46 | err = pjlib/srtp_err.o |
| 47 | |
| 48 | kernel = crypto/kernel/crypto_kernel.o crypto/kernel/alloc.o \ |
| 49 | crypto/kernel/key.o $(rng) $(err) # $(ust) |
| 50 | |
| 51 | srtpobj = srtp/srtp.o |
| 52 | |
| 53 | cryptobj = $(ciphers) $(hashes) $(math) $(stat) $(kernel) $(replay) |
| 54 | |
| 55 | export SRTP_SRCDIR = ../../srtp |
| 56 | export SRTP_OBJS = $(cryptobj) $(srtpobj) |
| 57 | export SRTP_CFLAGS = -DHAVE_CONFIG_H $(_CFLAGS) |
| 58 | |
| 59 | |
| 60 | export 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 | # |
| 66 | TARGETS := $(SRTP_LIB) $(SRTP_SONAME) |
| 67 | |
| 68 | all: $(TARGETS) |
| 69 | |
| 70 | doc: |
| 71 | cd .. && doxygen docs/doxygen.cfg |
| 72 | |
| 73 | dep: depend |
| 74 | distclean: realclean |
| 75 | |
| 76 | .PHONY: all dep depend clean realclean distclean |
| 77 | .PHONY: $(TARGETS) |
| 78 | .PHONY: $(SRTP_LIB) $(SRTP_SONAME) |
| 79 | |
| 80 | libsrtp: $(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 | |
| 85 | clean print_lib: |
| 86 | $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@ |
| 87 | |
| 88 | realclean: |
| 89 | $(subst @@,$(subst /,$(HOST_PSEP),.ilbc-$(TARGET_NAME).depend),$(HOST_RMR)) |
| 90 | |
| 91 | $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@ |
| 92 | |
| 93 | depend: |
| 94 | $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@ |
| 95 | |
| 96 | |
| 97 | |