blob: e672091a17c85c3308287f3e8c08e93fef356edc [file] [log] [blame]
Dmitriy Ivanovde017802014-10-03 17:52:44 -07001#
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
21# TODO: It there simple way to do this?
22$(bionic_2nd_arch_prefix)bionic_dlext_test_zip := \
23 $($(bionic_2nd_arch_prefix)TARGET_OUT_INTERMEDIATES)/libdlext_test_fd/dlext_test_origin.zip
24$(bionic_2nd_arch_prefix)bionic_dlext_test_zip_aligned := \
25 $($(bionic_2nd_arch_prefix)TARGET_OUT_DATA_NATIVE_TESTS)/libdlext_test_fd/dlext_test.zip
26ALL_MODULES += $($(bionic_2nd_arch_prefix)bionic_dlext_test_zip_aligned)
27
28$(bionic_2nd_arch_prefix)bionic_dlext_built_shared_libraries := \
29 $($(bionic_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/libdlext_test_fd.so
30
31bionic_dlext_test_zip_alignment := 4096 # PAGE_SIZE
32
33$(bionic_2nd_arch_prefix)bionic_dlext_test_zip_tmpdir := $(dir $($(bionic_2nd_arch_prefix)bionic_dlext_test_zip))
34
35$($(bionic_2nd_arch_prefix)bionic_dlext_test_zip)_prepare: $($(bionic_2nd_arch_prefix)bionic_dlext_built_shared_libraries)
36 $(hide) mkdir -p $(dir $@)
37 $(hide) cp -p $< $(dir $@)
38
39$($(bionic_2nd_arch_prefix)bionic_dlext_test_zip): $($(bionic_2nd_arch_prefix)bionic_dlext_test_zip)_prepare
40 @echo "Zip: $@"
41 $(hide) (cd $(dir $@) && touch empty_file.txt && zip -rD0 $(notdir $@) empty_file.txt libdlext_test_fd.so)
42
43$($(bionic_2nd_arch_prefix)bionic_dlext_test_zip_aligned): $($(bionic_2nd_arch_prefix)bionic_dlext_test_zip) | $(ZIPALIGN)
44 $(hide) rm -rf $@
45 $(hide) mkdir -p $(dir $@)
46 @echo "Zipalign $(bionic_dlext_test_zip_alignment): $@"
47 $(hide) zipalign $(bionic_dlext_test_zip_alignment) $< $@
48