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 	NativeHandle.cpp \
     30 	Printer.cpp \
     31 	ProcessCallStack.cpp \
     32 	PropertyMap.cpp \
     33 	RefBase.cpp \
     34 	SharedBuffer.cpp \
     35 	Static.cpp \
     36 	StopWatch.cpp \
     37 	String8.cpp \
     38 	String16.cpp \
     39 	SystemClock.cpp \
     40 	Threads.cpp \
     41 	Timers.cpp \
     42 	Tokenizer.cpp \
     43 	Unicode.cpp \
     44 	VectorImpl.cpp \
     45 	misc.cpp
     46 
     47 host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -Werror
     48 
     49 ifeq ($(HOST_OS),windows)
     50 ifeq ($(strip $(USE_CYGWIN),),)
     51 # Under MinGW, ctype.h doesn't need multi-byte support
     52 host_commonCflags += -DMB_CUR_MAX=1
     53 endif
     54 endif
     55 
     56 host_commonLdlibs :=
     57 
     58 ifeq ($(TARGET_OS),linux)
     59 host_commonLdlibs += -lrt -ldl
     60 endif
     61 
     62 
     63 # For the host
     64 # =====================================================
     65 include $(CLEAR_VARS)
     66 LOCAL_SRC_FILES:= $(commonSources)
     67 ifeq ($(HOST_OS), linux)
     68 LOCAL_SRC_FILES += Looper.cpp
     69 endif
     70 LOCAL_MODULE:= libutils
     71 LOCAL_STATIC_LIBRARIES := liblog
     72 LOCAL_CFLAGS += $(host_commonCflags)
     73 LOCAL_MULTILIB := both
     74 include $(BUILD_HOST_STATIC_LIBRARY)
     75 
     76 
     77 # For the device, static
     78 # =====================================================
     79 include $(CLEAR_VARS)
     80 
     81 
     82 # we have the common sources, plus some device-specific stuff
     83 LOCAL_SRC_FILES:= \
     84 	$(commonSources) \
     85 	Looper.cpp \
     86 	Trace.cpp
     87 
     88 ifeq ($(TARGET_ARCH),mips)
     89 LOCAL_CFLAGS += -DALIGN_DOUBLE
     90 endif
     91 LOCAL_CFLAGS += -Werror
     92 
     93 LOCAL_C_INCLUDES += \
     94 		bionic/libc \
     95 		external/zlib
     96 
     97 LOCAL_STATIC_LIBRARIES := \
     98 	libcutils
     99 
    100 LOCAL_SHARED_LIBRARIES := \
    101         libbacktrace \
    102         liblog \
    103         libdl
    104 
    105 include external/stlport/libstlport.mk
    106 
    107 LOCAL_MODULE:= libutils
    108 include $(BUILD_STATIC_LIBRARY)
    109 
    110 # For the device, shared
    111 # =====================================================
    112 include $(CLEAR_VARS)
    113 LOCAL_MODULE:= libutils
    114 LOCAL_WHOLE_STATIC_LIBRARIES := libutils
    115 LOCAL_SHARED_LIBRARIES := \
    116         libbacktrace \
    117         libcutils \
    118         libdl \
    119         liblog
    120 LOCAL_CFLAGS := -Werror
    121 
    122 include external/stlport/libstlport.mk
    123 
    124 include $(BUILD_SHARED_LIBRARY)
    125 
    126 # Include subdirectory makefiles
    127 # ============================================================
    128 
    129 # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
    130 # team really wants is to build the stuff defined by this makefile.
    131 ifeq (,$(ONE_SHOT_MAKEFILE))
    132 include $(call first-makefiles-under,$(LOCAL_PATH))
    133 endif
    134