Guest User

Untitled

a guest
Sep 1st, 2016
58
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #################################################################
  2. # ShiVa Extension Plugin Makefile for Android
  3. #################################################################
  4.  
  5. ANDROID_NDK_ROOT = C:/Games/sdks/android-ndk-r12b
  6. TEMP_DIR = ../../Temp/Android
  7. TEMP_DIR_ARM5 = $(TEMP_DIR)/arm5
  8. TEMP_DIR_ARM7 = $(TEMP_DIR)/arm7
  9. TEMP_DIR_X86 = $(TEMP_DIR)/x86
  10. SRCROOT = ../../Sources
  11. S3DXROOT = ../../Sources/S3DX
  12. BUILT_PRODUCTS_DIR = ../../Contents/Android
  13. PHOTON_DIR = ../../Libs/Photon-AndroidNDK-Sdk_v4-1-3-3
  14. PRODUCT_NAME_ARM5 = PhotonCloudAPI_Android.a
  15. PRODUCT_NAME_ARM7 = PhotonCloudAPI_Android_arm_v7a.a
  16. PRODUCT_NAME_X86 = PhotonCloudAPI_Android_x86_32.a
  17.  
  18. #################################################################
  19. # User data
  20. #
  21. USER_INCLUDE_PATH = -L"$(PHOTON_DIR)/Common-cpp/lib/common-cpp-prebuilt" -L"$(PHOTON_DIR)/Photon-cpp/lib/photon-cpp-prebuilt" -L"$(PHOTON_DIR)/LoadBalancing-cpp/lib/loadbalancing-cpp-prebuilt"
  22. USER_LIBRARIES_ARM5 = -lphoton-cpp-static_debug_android_armeabi -lcommon-cpp-static_debug_android_armeabi -lloadbalancing-cpp-static_debug_android_armeabi
  23. USER_LIBRARIES_ARM7 = -lphoton-cpp-static_debug_android_armeabi-v7a -lcommon-cpp-static_debug_android_armeabi-v7a -lloadbalancing-cpp-static_debug_android_armeabi-v7a
  24. USER_LIBRARIES_ARX86= -lphoton-cpp-static_debug_android_x86 -lcommon-cpp-static_debug_android_x86 -lloadbalancing-cpp-static_debug_android_armeabi_x86
  25. USER_FLAGS =
  26.  
  27. #################################################################
  28. SOURCES = Plugin.cpp PhotonCloudAPI.cpp NetworkLogic.cpp Console.cpp
  29.  
  30. #################################################################
  31. # Compiler executables
  32. #
  33. CC_ARM5 = "$(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc"
  34. CPP_ARM5 = "$(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++"
  35. AR_ARM5 = "$(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-ar"
  36.  
  37. CC_ARM7 = $(CC_ARM5)
  38. CPP_ARM7 = $(CPP_ARM5)
  39. AR_ARM7 = $(AR_ARM5)
  40.  
  41. CC_X86 = "$(ANDROID_NDK_ROOT)/toolchains/x86-4.9/prebuilt/windows-x86_64/bin/i686-linux-android-gcc"
  42. CPP_X86 = "$(ANDROID_NDK_ROOT)/toolchains/x86-4.9/prebuilt/windows-x86_64/bin/i686-linux-android-g++"
  43. AR_X86 = "$(ANDROID_NDK_ROOT)/toolchains/x86-4.9/prebuilt/windows-x86_64/bin/i686-linux-android-ar"
  44.  
  45. ####################################################################"
  46. # Includes
  47. #
  48. SYSROOT_ARM5 = $(ANDROID_NDK_ROOT)/platforms/android-9/arch-arm
  49. SYSROOT_ARM7 = $(ANDROID_NDK_ROOT)/platforms/android-16/arch-arm
  50. SYSROOT_X86 = $(ANDROID_NDK_ROOT)/platforms/android-19/arch-x86
  51. SYSTEM_INCLUDES = -I"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include"
  52. PHOTON_INCLUDES = -I"../../Libs/Photon-AndroidNDK-Sdk_v4-1-3-3/"
  53.  
  54. ####################################################################"
  55. # Compiler flags
  56. #
  57. CFLAGS_Arch_ARM5 = -march=armv5te -msoft-float -I"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include"
  58. CFLAGS_Arch_ARM7 = -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -I"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include"
  59. CFLAGS_Arch_X86 = -I"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include"
  60. CFLAGS_Common = -Os -Wno-unknown-pragmas -fPIC -fsigned-char -fno-strict-aliasing -fno-short-enums -fno-exceptions -D__ANDROID__ -DANDROID_NDK -DANDROID -DRELEASE -D_GNU_SOURCE -DHAVE_STDINT_H
  61. CFLAGS_ARM5 = --sysroot="$(SYSROOT_ARM5)" $(CFLAGS_Arch_ARM5) $(CFLAGS_Common) $(SYSTEM_INCLUDES) -I"$(SRCROOT)" -I$(SRCROOT)/Android -I$(S3DXROOT) -I"$(SYSROOT_ARM5)/usr/bin" $(PHOTON_INCLUDES) $(USER_INCLUDE_PATH) $(USER_LIBRARIES_ARM5)
  62. CFLAGS_ARM7 = --sysroot="$(SYSROOT_ARM7)" $(CFLAGS_Arch_ARM7) $(CFLAGS_Common) $(SYSTEM_INCLUDES) -I"$(SRCROOT)" -I$(SRCROOT)/Android -I$(S3DXROOT) -I"$(SYSROOT_ARM7)/usr/bin" $(PHOTON_INCLUDES) $(USER_INCLUDE_PATH) $(USER_LIBRARIES_ARM7)
  63. CFLAGS_X86 = --sysroot="$(SYSROOT_X86)" $(CFLAGS_Arch_X86) $(CFLAGS_Common) $(SYSTEM_INCLUDES) -I"$(SRCROOT)" -I$(SRCROOT)/Android -I$(S3DXROOT) -I"$(SYSROOT_X86)/usr/bin" $(PHOTON_INCLUDES) $(USER_INCLUDE_PATH) $(USER_LIBRARIES_ARX86)
  64. CPPFLAGS = -fno-rtti -std=c++11 -lstdc++ -lc++_static -lsupc++
  65.  
  66.  
  67. ####################################################################"
  68. # Objects
  69. #
  70. OBJECTS = \
  71. $(patsubst %.c,%.o,$(filter %.c,$(SOURCES))) \
  72. $(patsubst %.cc,%.o,$(filter %.cc,$(SOURCES))) \
  73. $(patsubst %.cpp,%.o,$(filter %.cpp,$(SOURCES)))
  74.  
  75. OBJECTS_ABS_ARM5 = $(addprefix $(TEMP_DIR_ARM5)/,$(OBJECTS))
  76. OBJECTS_ABS_ARM7 = $(addprefix $(TEMP_DIR_ARM7)/,$(OBJECTS))
  77. OBJECTS_ABS_X86 = $(addprefix $(TEMP_DIR_X86)/,$(OBJECTS))
  78. PRODUCT_ABS_ARM5 = $(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME_ARM5)
  79. PRODUCT_ABS_ARM7 = $(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME_ARM7)
  80. PRODUCT_ABS_X86 = $(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME_X86)
  81.  
  82. ####################################################################"
  83. # Rules
  84. #
  85.  
  86. $(TEMP_DIR_ARM5)/%.o: $(SRCROOT)/%.c
  87. @mkdir -p `dirname $@`
  88. @echo Compiling $<
  89. @$(CC_ARM5) $(CFLAGS_ARM5) -c $< -o $@
  90.  
  91. $(TEMP_DIR_ARM5)/%.o: $(SRCROOT)/%.cpp
  92. @mkdir -p `dirname $@`
  93. @echo Compiling $<
  94. @$(CPP_ARM5) $(CFLAGS_ARM5) $(CPPFLAGS) -c $< -o $@
  95.  
  96. $(TEMP_DIR_ARM7)/%.o: $(SRCROOT)/%.c
  97. @mkdir -p `dirname $@`
  98. @echo Compiling $<
  99. @$(CC_ARM7) $(CFLAGS_ARM7) -c $< -o $@
  100.  
  101. $(TEMP_DIR_ARM7)/%.o: $(SRCROOT)/%.cpp
  102. @mkdir -p `dirname $@`
  103. @echo Compiling $<
  104. @$(CPP_ARM7) $(CFLAGS_ARM7) $(CPPFLAGS) -c $< -o $@
  105.  
  106. $(TEMP_DIR_X86)/%.o: $(SRCROOT)/%.c
  107. @mkdir -p `dirname $@`
  108. @echo Compiling $<
  109. @$(CC_X86) $(CFLAGS_X86) -c $< -o $@
  110.  
  111. $(TEMP_DIR_X86)/%.o: $(SRCROOT)/%.cpp
  112. @mkdir -p `dirname $@`
  113. @echo Compiling $<
  114. @$(CPP_X86) $(CFLAGS_X86) $(CPPFLAGS) -c $< -o $@
  115.  
  116. ####################################################################"
  117. # Targets
  118. #
  119. all: $(PRODUCT_ABS_ARM5) $(PRODUCT_ABS_ARM7) $(PRODUCT_ABS_X86)
  120.  
  121. $(PRODUCT_ABS_ARM5): $(OBJECTS_ABS_ARM5)
  122. @echo Creating ARM5 archive
  123. @mkdir -p $(BUILT_PRODUCTS_DIR)
  124. @$(AR_ARM5) rcs $(PRODUCT_ABS_ARM5) $(OBJECTS_ABS_ARM5)
  125. #./obj/*.o
  126.  
  127. $(PRODUCT_ABS_ARM7): $(OBJECTS_ABS_ARM7)
  128. @echo Creating ARM7 archive
  129. @mkdir -p $(BUILT_PRODUCTS_DIR)
  130. @$(AR_ARM7) rcs $(PRODUCT_ABS_ARM7) $(OBJECTS_ABS_ARM7) ./obj/*.o
  131.  
  132. $(PRODUCT_ABS_X86): $(OBJECTS_ABS_X86)
  133. @echo Creating X86 archive
  134. @mkdir -p $(BUILT_PRODUCTS_DIR)
  135. @$(AR_X86) rcs $(PRODUCT_ABS_X86) $(OBJECTS_ABS_X86)
  136. #./obj/*.o
  137.  
  138. clean:
  139. @echo Cleaning
  140. @rm -f $(PRODUCT_ABS_ARM5) $(OBJECTS_ABS_ARM5) $(PRODUCT_ABS_ARM7) $(OBJECTS_ABS_ARM7) $(PRODUCT_ABS_X86) $(OBJECTS_ABS_X86)
  141.  
  142. ####################################################################"
RAW Paste Data