blob: 29f3c449f6139149ac25bf0f63c07e98f110b215 [file] [log] [blame]
Simran Basi03f52532018-09-06 12:23:11 -07001# Copyright (C) 2018 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.
Florian Mayer5e3f57c2023-02-22 00:18:08 +000014# Create an artifact to include OWNERS files in source tree.
Simran Basi03f52532018-09-06 12:23:11 -070015
16.PHONY: owners
17
18intermediates := $(call intermediates-dir-for,PACKAGING,owners)
19owners_zip := $(intermediates)/owners.zip
20owners_list := $(OUT_DIR)/.module_paths/OWNERS.list
21owners := $(file <$(owners_list))
22$(owners_zip) : PRIVATE_owners := $(subst $(newline),\n,$(owners))
23
24$(owners_zip) : $(owners) $(SOONG_ZIP)
25 @echo "Building artifact to include OWNERS files."
26 rm -rf $@
27 echo -e "$(PRIVATE_owners)" > $@.list
28 $(SOONG_ZIP) -o $@ -C . -l $@.list
29 rm -f $@.list
30
31owners : $(owners_zip)
32
33$(call dist-for-goals, general-tests, $(owners_zip))
Bob Badour3a0f0c12022-04-05 10:43:45 -070034
35$(call declare-0p-target,$(owners_zip))