Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. include ../../../build.mak
  2. include ../../../build/common.mak
  3. export LIBDIR := ../../lib
  4. RULES_MAK := $(PJDIR)/build/rules.mak
  5. ###############################################################################
  6. # Gather all flags.
  7. #
  8. export _CFLAGS := $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \
  9. $(CFLAGS) $(CC_INC). $(CC_INC)../../resample/include \
  10. $(CC_INC)../../../pjlib/include
  11. export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \
  12. $(HOST_CXXFLAGS) $(CXXFLAGS)
  13. export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
  14. $(LDFLAGS)
  15. export RESAMPLE_SRCDIR = ../../resample/src
  16. export RESAMPLE_OBJS = resamplesubs.o
  17. export RESAMPLE_CFLAGS = $(_CFLAGS)
  18. export RESAMPLE_LDFLAGS = $(_LDFLAGS)
  19. export RESAMPLE_LIB := libresample-$(TARGET_NAME)$(LIBEXT)
  20. ifneq ($(PJ_SHARED_LIBRARIES),)
  21. export RESAMPLE_SONAME := libresample.$(SHLIB_SUFFIX)
  22. export RESAMPLE_SHLIB := $(RESAMPLE_SONAME).$(PJ_VERSION_MAJOR)
  23. endif
  24. ifneq ($(PJ_RESAMPLE_DLL),)
  25. export RESAMPLE_SONAME := libresample.$(SHLIB_SUFFIX)
  26. export RESAMPLE_SHLIB := $(RESAMPLE_SONAME).$(PJ_VERSION_MAJOR)
  27. endif
  28. export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT
  29. ###############################################################################
  30. # Main entry
  31. #
  32. # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory.
  33. #
  34. TARGETS := $(RESAMPLE_LIB) $(RESAMPLE_SONAME)
  35. ifneq ($(PJ_SHARED_LIBRARIES),)
  36. else
  37. ifneq ($(PJ_RESAMPLE_DLL),)
  38. export RESAMPLE_CFLAGS := -fPIC $(RESAMPLE_CFLAGS)
  39. endif
  40. endif
  41. all: $(TARGETS)
  42. doc:
  43. cd .. && doxygen docs/doxygen.cfg
  44. dep: depend
  45. distclean: realclean
  46. .PHONY: all dep depend clean realclean distclean
  47. .PHONY: $(TARGETS)
  48. .PHONY: $(RESAMPLE_LIB) $(RESAMPLE_SONAME)
  49. dep: depend
  50. libresample: $(RESAMPLE_LIB)
  51. $(RESAMPLE_SONAME): $(RESAMPLE_LIB)
  52. $(RESAMPLE_LIB) $(RESAMPLE_SONAME):
  53. $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $(subst /,$(HOST_PSEP),$(LIBDIR)/$@)
  54. clean print_lib:
  55. $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $@
  56. realclean:
  57. $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $@
  58. depend:
  59. $(MAKE) -f $(RULES_MAK) APP=RESAMPLE app=libresample $@