Home | History | Annotate | Download | only in libutils
      1 # Copyright (C) 2008 The Android Open Source Project
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #      http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 
     15 LOCAL_PATH:= $(call my-dir)
     16 
     17 # libutils is a little unique: It's built twice, once for the host
     18 # and once for the device.
     19 
     20 commonSources:= \
     21 	BasicHashtable.cpp \
     22 	BlobCache.cpp \
     23 	CallStack.cpp \
     24 	FileMap.cpp \
     25 	JenkinsHash.cpp \
     26 	LinearAllocator.cpp \
     27 	LinearTransform.cpp \
     28 	Log.cpp \
     29 	Printer.cpp \
     30 	ProcessCallStack.cpp \
     31 	PropertyMap.cpp \
     32 	RefBase.cpp \
     33 	SharedBuffer.cpp \
     34 	Static.cpp \
     35 	StopWatch.cpp \
     36 	String8.cpp \
     37 	String16.cpp \
     38 	SystemClock.cpp \
     39 	Threads.cpp \
     40 	Timers.cpp \
     41 	Tokenizer.cpp \
     42 	Unicode.cpp \
     43 	VectorImpl.cpp \
     44 	misc.cpp
     45 
     46 host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
     47 
     48 ifeq ($(HOST_OS),windows)
     49 ifeq ($(strip $(USE_CYGWIN),),)
     50 # Under MinGW, ctype.h doesn't need multi-byte support
     51 host_commonCflags += -DMB_CUR_MAX=1
     52 endif
     53 endif
     54 
     55 host_commonLdlibs :=
     56 
     57 ifeq ($(TARGET_OS),linux)
     58 host_commonLdlibs += -lrt -ldl
     59 endif
     60 
     61 
     62 # For the host
     63 # =====================================================
     64 include $(CLEAR_VARS)
     65 LOCAL_SRC_FILES:= $(commonSources)
     66 ifeq ($(HOST_OS), linux)
     67 LOCAL_SRC_FILES += Looper.cpp
     68 endif
     69 LOCAL_MODULE:= libutils
     70 LOCAL_STATIC_LIBRARIES := liblog
     71 LOCAL_CFLAGS += $(host_commonCflags)
     72 LOCAL_LDLIBS += $(host_commonLdlibs)
     73 include $(BUILD_HOST_STATIC_LIBRARY)
     74 
     75 
     76 # For the host, 64-bit
     77 # =====================================================
     78 include $(CLEAR_VARS)
     79 LOCAL_SRC_FILES:= $(commonSources)
     80 ifeq ($(HOST_OS), linux)
     81 LOCAL_SRC_FILES += Looper.cpp
     82 endif
     83 LOCAL_MODULE:= lib64utils
     84 LOCAL_STATIC_LIBRARIES := liblog
     85 LOCAL_CFLAGS += $(host_commonCflags) -m64
     86 LOCAL_LDLIBS += $(host_commonLdlibs)
     87 include $(BUILD_HOST_STATIC_LIBRARY)
     88 
     89 
     90 # For the device, static
     91 # =====================================================
     92 include $(CLEAR_VARS)
     93 
     94 
     95 # we have the common sources, plus some device-specific stuff
     96 LOCAL_SRC_FILES:= \
     97 	$(commonSources) \
     98 	Looper.cpp \
     99 	Trace.cpp
    100 
    101 ifeq ($(TARGET_OS),linux)
    102 LOCAL_LDLIBS += -lrt -ldl
    103 endif
    104 
    105 ifeq ($(TARGET_ARCH),mips)
    106 LOCAL_CFLAGS += -DALIGN_DOUBLE
    107 endif
    108 
    109 LOCAL_C_INCLUDES += \
    110 		bionic/libc/private \
    111 		external/zlib
    112 
    113 LOCAL_LDLIBS += -lpthread
    114 
    115 LOCAL_STATIC_LIBRARIES := \
    116 	libcutils
    117 
    118 LOCAL_SHARED_LIBRARIES := \
    119         libcorkscrew \
    120         liblog \
    121         libdl
    122 
    123 LOCAL_MODULE:= libutils
    124 include $(BUILD_STATIC_LIBRARY)
    125 
    126 # For the device, shared
    127 # =====================================================
    128 include $(CLEAR_VARS)
    129 LOCAL_MODULE:= libutils
    130 LOCAL_WHOLE_STATIC_LIBRARIES := libutils
    131 LOCAL_SHARED_LIBRARIES := \
    132         liblog \
    133         libcutils \
    134         libdl \
    135         libcorkscrew
    136 
    137 include $(BUILD_SHARED_LIBRARY)
    138 
    139 # Include subdirectory makefiles
    140 # ============================================================
    141 
    142 # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
    143 # team really wants is to build the stuff defined by this makefile.
    144 ifeq (,$(ONE_SHOT_MAKEFILE))
    145 include $(call first-makefiles-under,$(LOCAL_PATH))
    146 endif
    147