Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. include ../../../build.mak
  2. include ../../../build/common.mak
  3. include ../os-$(OS_NAME).mak
  4. export LIBDIR := ../../lib
  5. RULES_MAK := $(PJDIR)/build/rules.mak
  6. export SRTP_LIB := libsrtp-$(TARGET_NAME)$(LIBEXT)
  7. ifeq ($(PJ_SHARED_LIBRARIES),)
  8. else
  9. export SRTP_SONAME := libsrtp.$(SHLIB_SUFFIX)
  10. export SRTP_SHLIB := $(SRTP_SONAME).$(PJ_VERSION_MAJOR)
  11. endif
  12. ###############################################################################
  13. # Gather all flags.
  14. #
  15. export _CFLAGS := $(CC_INC). $(CC_INC)../../srtp/crypto/include \
  16. $(CC_INC)../../srtp/include \
  17. $(CC_INC)../../../pjlib/include \
  18. $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \
  19. $(CFLAGS)
  20. export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \
  21. $(HOST_CXXFLAGS) $(CXXFLAGS)
  22. export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
  23. $(APP_LDFLAGS) $(LDFLAGS)
  24. # libcrypt.a (the crypto engine)
  25. ciphers = crypto/cipher/cipher.o crypto/cipher/null_cipher.o crypto/cipher/cipher_test_cases.o \
  26. $(CIPHERS_SRC)
  27. hashes = crypto/hash/null_auth.o crypto/hash/auth.o crypto/hash/auth_test_cases.o $(HASHES_SRC)
  28. replay = crypto/replay/rdb.o crypto/replay/rdbx.o
  29. math = crypto/math/datatypes.o
  30. ust = crypto/ust/ust.o
  31. rng = $(RNG_SRC)
  32. err = pjlib/srtp_err.o
  33. kernel = crypto/kernel/crypto_kernel.o crypto/kernel/alloc.o \
  34. crypto/kernel/key.o $(rng) $(err) # $(ust)
  35. srtpobj = srtp/srtp.o
  36. cryptobj = $(ciphers) $(hashes) $(math) $(stat) $(kernel) $(replay)
  37. export SRTP_SRCDIR = ../../srtp
  38. export SRTP_OBJS = $(cryptobj) $(srtpobj)
  39. export SRTP_CFLAGS = -DHAVE_CONFIG_H $(_CFLAGS) $(SRTP_OTHER_CFLAGS)
  40. export SRTP_LDFLAGS = $(PJLIB_LDLIB) $(_LDFLAGS)
  41. export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT
  42. ###############################################################################
  43. # Main entry
  44. #
  45. # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory.
  46. #
  47. TARGETS := $(SRTP_LIB) $(SRTP_SONAME)
  48. all: $(TARGETS)
  49. doc:
  50. cd .. && doxygen docs/doxygen.cfg
  51. dep: depend
  52. distclean: realclean
  53. .PHONY: all dep depend clean realclean distclean
  54. .PHONY: $(TARGETS)
  55. .PHONY: $(SRTP_LIB) $(SRTP_SONAME)
  56. libsrtp: $(SRTP_LIB)
  57. $(SRTP_SONAME): $(SRTP_LIB)
  58. $(SRTP_LIB) $(SRTP_SONAME):
  59. $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)
  60. clean print_lib:
  61. $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@
  62. realclean:
  63. $(subst @@,$(subst /,$(HOST_PSEP),.ilbc-$(TARGET_NAME).depend),$(HOST_RMR))
  64. $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@
  65. depend:
  66. $(MAKE) -f $(RULES_MAK) APP=SRTP app=libsrtp $@