Makefile.in 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #
  2. # android makefile generics
  3. #
  4. ANDROID_LIBPATH ?= ${PREFIX}/out/debug/target/product/${ANDROID_PRODUCT}/obj/lib
  5. ANDROID_PRODUCT ?= generic
  6. CC = ${CROSS_COMPILE}gcc
  7. CXX = ${CROSS_COMPILE}g++
  8. AR = ${CROSS_COMPILE}ar
  9. OBJCOPY = ${CROSS_COMPILE}objcopy
  10. STRIP = ${CROSS_COMPILE}strip --strip-unneeded
  11. LIBGCC_A := $(shell $(CC) -print-libgcc-file-name)
  12. ifeq (${ARCH},)
  13. ARCH=arm
  14. endif
  15. ifeq (${ARCH},arm)
  16. TOOLCHAIN ?= ${PREFIX}/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1
  17. CROSS_COMPILE ?= ${TOOLCHAIN}/bin/arm-eabi-
  18. ARCH_CFLAGS = -march=armv5te \
  19. -I${PREFIX}/bionic/libc/arch-arm/include \
  20. -I${PREFIX}/bionic/libc/kernel/arch-arm
  21. ARCH_EXE_LDFLAGS = -Bdynamic -Wl,-T,${PREFIX}/build/core/armelf.x
  22. DSOLDFLAGS = -shared -Wl,-T,${PREFIX}/build/core/armelf.xsc
  23. else ifeq (${ARCH},x86)
  24. TOOLCHAIN ?= ${PREFIX}/prebuilt/linux-x86/toolchain/i686-unknown-linux-gnu-4.2.1
  25. CROSS_COMPILE ?= ${TOOLCHAIN}/bin/i686-unknown-linux-gnu-
  26. ARCH_CFLAGS = -march=i686 -fPIC \
  27. -I${PREFIX}/bionic/libc/arch-x86/include \
  28. -I${PREFIX}/bionic/libc/kernel/arch-x86
  29. DSOLDFLAGS = -shared
  30. else
  31. $(error Specify a valid supported architecture)
  32. endif
  33. ARCH_CFLAGS += \
  34. -DANDROID -fno-short-enums \
  35. -I${PREFIX}/bionic/libc/include \
  36. -I${PREFIX}/bionic/libc/kernel/common \
  37. -I${PREFIX}/bionic/libm/include \
  38. -I${PREFIX}/frameworks/base/include \
  39. -I${PREFIX}/frameworks/base/opengl/include \
  40. -I${PREFIX}/system/core/include \
  41. -I${PREFIX}/hardware/libhardware/include \
  42. -I${PREFIX}/external/skia/include \
  43. -Iarch/android
  44. ARCH_CXXFLAGS = \
  45. ${ARCH_CFLAGS} -I${PREFIX}/bionic/libstdc++/include
  46. ARCH_LDFLAGS = \
  47. -Bdynamic -nostdlib \
  48. -Wl,-dynamic-linker,/system/bin/linker \
  49. -Wl,-rpath-link=${ANDROID_LIBPATH} \
  50. -L${ANDROID_LIBPATH} -lc -lcutils -lsurfaceflinger $(LIBGCC_A)
  51. ARCH_EXE_LDFLAGS += \
  52. ${ANDROID_LIBPATH}/crtbegin_dynamic.o \
  53. ${ANDROID_LIBPATH}/crtend_android.o
  54. DSOPRE = lib
  55. DSOPOST = .so
  56. DSORPATH = -Wl,-rpath,${LIBDIR}
  57. DSOSONAME = -Wl,-soname,
  58. #
  59. # Bionic implements pthread, no separate library
  60. #
  61. PTHREAD_LDFLAGS =
  62. #
  63. # Headers are in a strange place
  64. #
  65. VORBIS_CFLAGS = -I${PREFIX}/external/tremor
  66. ZLIB_CFLAGS = -I${PREFIX}/external/zlib
  67. LIBPNG_CFLAGS = -I${PREFIX}/external/libpng ${ZLIB_CFLAGS}
  68. #
  69. # Skia provides libpng symbols on Android
  70. #
  71. LIBPNG_LDFLAGS = -lskiagl
  72. #
  73. # Some of SurfaceFlinger is only available to C++; this wraps
  74. # those bits and makes them available to render_egl (C).
  75. #
  76. arch/android/sfwrapper.o: arch/android/sfwrapper.cpp
  77. $(if ${V},,@echo " CXX " $<)
  78. ${CXX} -MD ${core_cxxflags} -Isrc -c $< -o $@
  79. .PHONY: clean
  80. clean:
  81. $(if ${V},,@echo " RM " arch/android/sfwrapper.{o,d})
  82. ${RM} arch/android/sfwrapper.o arch/android/sfwrapper.d
  83. #
  84. # Need to nest Android binaries in a subdir
  85. # FIXME: Convert this to .apk and wrap it with a Java class
  86. #
  87. build := build/${SUBPLATFORM}/data/megazeux
  88. build: ${build}
  89. include arch/zip.inc