Dmitriy Ivanov | 07e5bc1 | 2014-10-03 17:52:44 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2014 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 | |
| 17 | # ----------------------------------------------------------------------------- |
| 18 | # Library used by dlext tests - zipped and aligned |
| 19 | # ----------------------------------------------------------------------------- |
| 20 | |
Ying Wang | 667853d | 2014-10-08 16:22:03 -0700 | [diff] [blame] | 21 | include $(CLEAR_VARS) |
Dmitriy Ivanov | 07e5bc1 | 2014-10-03 17:52:44 -0700 | [diff] [blame] | 22 | |
Ying Wang | 667853d | 2014-10-08 16:22:03 -0700 | [diff] [blame] | 23 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 24 | LOCAL_MODULE := libdlext_test_fd_zipaligned |
| 25 | LOCAL_MODULE_SUFFIX := .zip |
| 26 | LOCAL_MODULE_TAGS := tests |
| 27 | LOCAL_MODULE_PATH := $($(bionic_2nd_arch_prefix)TARGET_OUT_DATA_NATIVE_TESTS)/libdlext_test_fd |
| 28 | LOCAL_2ND_ARCH_VAR_PREFIX := $(bionic_2nd_arch_prefix) |
Dmitriy Ivanov | 07e5bc1 | 2014-10-03 17:52:44 -0700 | [diff] [blame] | 29 | |
Ying Wang | 667853d | 2014-10-08 16:22:03 -0700 | [diff] [blame] | 30 | include $(BUILD_SYSTEM)/base_rules.mk |
Dmitriy Ivanov | 07e5bc1 | 2014-10-03 17:52:44 -0700 | [diff] [blame] | 31 | |
Ying Wang | 667853d | 2014-10-08 16:22:03 -0700 | [diff] [blame] | 32 | my_shared_libs := \ |
| 33 | $($(bionic_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/libdlext_test_fd.so |
Dmitriy Ivanov | 07e5bc1 | 2014-10-03 17:52:44 -0700 | [diff] [blame] | 34 | |
Ying Wang | 667853d | 2014-10-08 16:22:03 -0700 | [diff] [blame] | 35 | $(LOCAL_BUILT_MODULE): PRIVATE_ALIGNMENT := 4096 # PAGE_SIZE |
| 36 | $(LOCAL_BUILT_MODULE) : $(my_shared_libs) | $(ZIPALIGN) |
| 37 | @echo "Zipalign $(PRIVATE_ALIGNMENT): $@" |
| 38 | $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@) |
| 39 | $(hide) cp $^ $(dir $@) |
| 40 | $(hide) (cd $(dir $@) && touch empty_file.txt && zip -rD0 $(notdir $@).unaligned empty_file.txt *.so) |
| 41 | $(hide) $(ZIPALIGN) $(PRIVATE_ALIGNMENT) $@.unaligned $@ |