Tina.mk 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. #
  2. # Copyright (C) 2008 The Android Open Source Project
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. LOCAL_PATH := $(my-dir)
  17. include $(CLEAR_VARS)
  18. ifeq ($(TARGET_CPU_SMP),true)
  19. targetSmpFlag := -DANDROID_SMP=1
  20. else
  21. targetSmpFlag := -DANDROID_SMP=0
  22. endif
  23. hostSmpFlag := -DANDROID_SMP=0
  24. commonSources := \
  25. array.c \
  26. hashmap.c \
  27. atomic.c.arm \
  28. native_handle.c \
  29. buffer.c \
  30. socket_inaddr_any_server.c \
  31. socket_local_client.c \
  32. socket_local_server.c \
  33. socket_loopback_client.c \
  34. socket_loopback_server.c \
  35. socket_network_client.c \
  36. sockets.c \
  37. config_utils.c \
  38. cpu_info.c \
  39. load_file.c \
  40. list.c \
  41. open_memstream.c \
  42. strdup16to8.c \
  43. strdup8to16.c \
  44. record_stream.c \
  45. process_name.c \
  46. properties.c \
  47. qsort_r_compat.c \
  48. threads.c \
  49. sched_policy.c \
  50. iosched_policy.c \
  51. str_parms.c \
  52. commonHostSources := \
  53. ashmem-host.c
  54. # some files must not be compiled when building against Mingw
  55. # they correspond to features not used by our host development tools
  56. # which are also hard or even impossible to port to native Win32
  57. WINDOWS_HOST_ONLY :=
  58. ifeq ($(HOST_OS),windows)
  59. ifeq ($(strip $(USE_CYGWIN)),)
  60. WINDOWS_HOST_ONLY := 1
  61. endif
  62. endif
  63. # USE_MINGW is defined when we build against Mingw on Linux
  64. ifneq ($(strip $(USE_MINGW)),)
  65. WINDOWS_HOST_ONLY := 1
  66. endif
  67. ifeq ($(WINDOWS_HOST_ONLY),1)
  68. commonSources += \
  69. uio.c
  70. else
  71. commonSources += \
  72. abort_socket.c \
  73. fs.c \
  74. selector.c \
  75. tztime.c \
  76. multiuser.c \
  77. zygote.c
  78. commonHostSources += \
  79. tzstrftime.c
  80. endif
  81. # Static library for host
  82. # ========================================================
  83. LOCAL_MODULE := libcutils
  84. LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
  85. LOCAL_LDLIBS := -lpthread
  86. LOCAL_STATIC_LIBRARIES := liblog
  87. LOCAL_CFLAGS += $(hostSmpFlag)
  88. include $(BUILD_HOST_STATIC_LIBRARY)
  89. # Static library for host, 64-bit
  90. # ========================================================
  91. include $(CLEAR_VARS)
  92. LOCAL_MODULE := lib64cutils
  93. LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
  94. LOCAL_LDLIBS := -lpthread
  95. LOCAL_STATIC_LIBRARIES := lib64log
  96. LOCAL_CFLAGS += $(hostSmpFlag) -m64
  97. include $(BUILD_HOST_STATIC_LIBRARY)
  98. # Shared and static library for target
  99. # ========================================================
  100. # This is needed in LOCAL_C_INCLUDES to access the C library's private
  101. # header named <bionic_time.h>
  102. #
  103. libcutils_c_includes := bionic/libc/private
  104. include $(CLEAR_VARS)
  105. LOCAL_MODULE := libcutils
  106. LOCAL_SRC_FILES := $(commonSources) \
  107. android_reboot.c \
  108. ashmem-dev.c \
  109. debugger.c \
  110. klog.c \
  111. mq.c \
  112. partition_utils.c \
  113. qtaguid.c \
  114. uevent.c \
  115. misc_rw.c
  116. ifeq ($(TARGET_ARCH),arm)
  117. LOCAL_SRC_FILES += arch-arm/memset32.S
  118. else # !arm
  119. ifeq ($(TARGET_ARCH_VARIANT),x86-atom)
  120. LOCAL_CFLAGS += -DHAVE_MEMSET16 -DHAVE_MEMSET32
  121. LOCAL_SRC_FILES += arch-x86/android_memset16.S arch-x86/android_memset32.S memory.c
  122. else # !x86-atom
  123. LOCAL_SRC_FILES += memory.c
  124. endif # !x86-atom
  125. endif # !arm
  126. LOCAL_C_INCLUDES := $(libcutils_c_includes) $(KERNEL_HEADERS)
  127. LOCAL_STATIC_LIBRARIES := liblog
  128. LOCAL_CFLAGS += $(targetSmpFlag)
  129. include $(BUILD_STATIC_LIBRARY)
  130. include $(CLEAR_VARS)
  131. LOCAL_MODULE := libcutils
  132. LOCAL_WHOLE_STATIC_LIBRARIES := libcutils
  133. LOCAL_SHARED_LIBRARIES := liblog
  134. LOCAL_CFLAGS += $(targetSmpFlag)
  135. LOCAL_C_INCLUDES := $(libcutils_c_includes)
  136. include $(BUILD_SHARED_LIBRARY)
  137. include $(CLEAR_VARS)
  138. LOCAL_MODULE := tst_str_parms
  139. LOCAL_CFLAGS += -DTEST_STR_PARMS
  140. LOCAL_SRC_FILES := str_parms.c hashmap.c memory.c
  141. LOCAL_SHARED_LIBRARIES := liblog
  142. LOCAL_MODULE_TAGS := optional
  143. include $(BUILD_EXECUTABLE)