Home | History | Annotate | Download | only in build
      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 # first, call a library containing all object files
     17 LOCAL_BUILT_MODULE := $(call local-executable-path,$(LOCAL_MODULE))
     18 include $(BUILD_SYSTEM)/binary.make
     19 
     20 LOCAL_LIBRARIES := $(foreach lib,$(LOCAL_STATIC_LIBRARIES),$(call local-library-path,$(lib)))
     21 
     22 LOCAL_LDLIBS := \
     23     $(foreach lib,$(LOCAL_STATIC_LIBRARIES),$(call local-library-path,$(lib))) \
     24     $(foreach lib,$(LOCAL_SHARED_LIBRARIES),$(call local-shared-library-path,$(lib))) \
     25     $(LOCAL_LDLIBS)
     26 
     27 $(LOCAL_BUILT_MODULE): PRIVATE_LDFLAGS := $(LDFLAGS) $(LOCAL_LDFLAGS)
     28 $(LOCAL_BUILT_MODULE): PRIVATE_LDLIBS  := $(LOCAL_LDLIBS)
     29 $(LOCAL_BUILT_MODULE): PRIVATE_LD      := $(LOCAL_LD)
     30 $(LOCAL_BUILT_MODULE): PRIVATE_OBJS    := $(LOCAL_OBJECTS)
     31 
     32 $(LOCAL_BUILT_MODULE): $(LOCAL_OBJECTS) $(LOCAL_LIBRARIES)
     33 	@ mkdir -p $(dir $@)
     34 	@ echo "Executable: $@"
     35 	$(hide) $(PRIVATE_LD) $(PRIVATE_LDFLAGS) -o $@ $(PRIVATE_LIBRARY) $(PRIVATE_OBJS) $(PRIVATE_LDLIBS)
     36 
     37 EXECUTABLES += $(LOCAL_BUILT_MODULE)
     38 $(LOCAL_BUILT_MODULE): $(foreach lib,$(LOCAL_STATIC_LIBRARIES),$(call local-library-path,$(lib)))
     39 $(LOCAL_BUILT_MODULE): $(foreach lib,$(LOCAL_SHARED_LIBRARIES),$(call local-shared-library-path,$(lib)))
     40