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 16 # build a host executable, the name of the final executable should be 17 # put in LOCAL_BUILT_MODULE for use by the caller 18 # 19 20 #$(info STATIC_LIBRARY SRCS=$(LOCAL_SRC_FILES)) 21 LOCAL_BUILT_MODULE := $(call local-library-path,$(LOCAL_MODULE)) 22 LOCAL_CC ?= $(call local-host-tool,CC) 23 include $(BUILD_SYSTEM)/binary.make 24 25 LOCAL_AR := $(strip $(LOCAL_AR)) 26 ifndef LOCAL_AR 27 LOCAL_AR := $(call local-host-tool,AR) 28 endif 29 ARFLAGS := crs 30 31 $(LOCAL_BUILT_MODULE): PRIVATE_AR := $(LOCAL_AR) 32 $(LOCAL_BUILT_MODULE): PRIVATE_OBJECTS := $(LOCAL_OBJECTS) 33 $(LOCAL_BUILT_MODULE): $(LOCAL_OBJECTS) 34 @mkdir -p $(dir $@) 35 @echo "Library: $@" 36 $(hide) $(PRIVATE_AR) $(ARFLAGS) $@ $(PRIVATE_OBJECTS) 37 38 LIBRARIES += $(LOCAL_BUILT_MODULE) 39