Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 1 | # Copyright (C) 2017 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 | current_makefile := $(lastword $(MAKEFILE_LIST)) |
| 16 | |
| 17 | # BOARD_VNDK_VERSION must be set to 'current' in order to generate a VNDK snapshot. |
| 18 | ifeq ($(BOARD_VNDK_VERSION),current) |
| 19 | |
Jae Shin | 0b1792e | 2017-12-21 19:04:13 +0900 | [diff] [blame] | 20 | # PLATFORM_VNDK_VERSION must be set. |
| 21 | ifneq (,$(PLATFORM_VNDK_VERSION)) |
| 22 | |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 23 | .PHONY: vndk |
Inseob Kim | 65c91ff | 2019-10-23 15:48:03 +0900 | [diff] [blame] | 24 | vndk: $(SOONG_VNDK_SNAPSHOT_ZIP) |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 25 | |
Inseob Kim | 65c91ff | 2019-10-23 15:48:03 +0900 | [diff] [blame] | 26 | $(call dist-for-goals, vndk, $(SOONG_VNDK_SNAPSHOT_ZIP)) |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 27 | |
Jae Shin | 0b1792e | 2017-12-21 19:04:13 +0900 | [diff] [blame] | 28 | else # PLATFORM_VNDK_VERSION is NOT set |
Justin Yun | 4dff0c6 | 2018-01-04 10:51:16 +0900 | [diff] [blame] | 29 | error_msg := "CANNOT generate VNDK snapshot. PLATFORM_VNDK_VERSION must be set." |
Jae Shin | 0b1792e | 2017-12-21 19:04:13 +0900 | [diff] [blame] | 30 | endif # PLATFORM_VNDK_VERSION |
| 31 | |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 32 | else # BOARD_VNDK_VERSION is NOT set to 'current' |
Justin Yun | 4dff0c6 | 2018-01-04 10:51:16 +0900 | [diff] [blame] | 33 | error_msg := "CANNOT generate VNDK snapshot. BOARD_VNDK_VERSION must be set to 'current'." |
| 34 | endif # BOARD_VNDK_VERSION |
| 35 | |
| 36 | ifneq (,$(error_msg)) |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 37 | |
| 38 | .PHONY: vndk |
Inseob Kim | c465e20 | 2019-11-15 09:59:23 +0900 | [diff] [blame] | 39 | vndk: PRIVATE_MAKEFILE := $(current_makefile) |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 40 | vndk: |
Inseob Kim | c465e20 | 2019-11-15 09:59:23 +0900 | [diff] [blame] | 41 | $(call echo-error,$(PRIVATE_MAKEFILE),$(error_msg)) |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 42 | exit 1 |
| 43 | |
Justin Yun | 4dff0c6 | 2018-01-04 10:51:16 +0900 | [diff] [blame] | 44 | endif |