xref: /aosp_15_r20/build/make/core/cleanspec.mk (revision 9e94795a3d4ef5c1d47486f9a02bb378756cea8a)
1*9e94795aSAndroid Build Coastguard Worker# Copyright (C) 2007 The Android Open Source Project
2*9e94795aSAndroid Build Coastguard Worker#
3*9e94795aSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
4*9e94795aSAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
5*9e94795aSAndroid Build Coastguard Worker# You may obtain a copy of the License at
6*9e94795aSAndroid Build Coastguard Worker#
7*9e94795aSAndroid Build Coastguard Worker#      http://www.apache.org/licenses/LICENSE-2.0
8*9e94795aSAndroid Build Coastguard Worker#
9*9e94795aSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
10*9e94795aSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
11*9e94795aSAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*9e94795aSAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
13*9e94795aSAndroid Build Coastguard Worker# limitations under the License.
14*9e94795aSAndroid Build Coastguard Worker#
15*9e94795aSAndroid Build Coastguard Worker
16*9e94795aSAndroid Build Coastguard Worker# Just bump this if you want to force a clean build.
17*9e94795aSAndroid Build Coastguard Worker# **********************************************************************
18*9e94795aSAndroid Build Coastguard Worker# WHEN DOING SO
19*9e94795aSAndroid Build Coastguard Worker# 1. DELETE ANY "add-clean-step" ENTRIES THAT HAVE PILED UP IN THIS FILE.
20*9e94795aSAndroid Build Coastguard Worker# 2. REMOVE ALL FILES NAMED CleanSpec.mk.
21*9e94795aSAndroid Build Coastguard Worker# 3. BUMP THE VERSION.
22*9e94795aSAndroid Build Coastguard Worker# IDEALLY, THOSE STEPS SHOULD BE DONE ATOMICALLY.
23*9e94795aSAndroid Build Coastguard Worker# **********************************************************************
24*9e94795aSAndroid Build Coastguard Worker#
25*9e94795aSAndroid Build Coastguard WorkerINTERNAL_CLEAN_BUILD_VERSION := 6
26*9e94795aSAndroid Build Coastguard Worker#
27*9e94795aSAndroid Build Coastguard Worker# ***********************************************************************
28*9e94795aSAndroid Build Coastguard Worker# Do not touch INTERNAL_CLEAN_BUILD_VERSION if you've added a clean step!
29*9e94795aSAndroid Build Coastguard Worker# ***********************************************************************
30*9e94795aSAndroid Build Coastguard Worker
31*9e94795aSAndroid Build Coastguard Worker# If you don't need to do a full clean build but would like to touch
32*9e94795aSAndroid Build Coastguard Worker# a file or delete some intermediate files, add a clean step to the end
33*9e94795aSAndroid Build Coastguard Worker# of the list.  These steps will only be run once, if they haven't been
34*9e94795aSAndroid Build Coastguard Worker# run before.
35*9e94795aSAndroid Build Coastguard Worker#
36*9e94795aSAndroid Build Coastguard Worker# E.g.:
37*9e94795aSAndroid Build Coastguard Worker#     $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
38*9e94795aSAndroid Build Coastguard Worker#     $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
39*9e94795aSAndroid Build Coastguard Worker#
40*9e94795aSAndroid Build Coastguard Worker# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
41*9e94795aSAndroid Build Coastguard Worker# files that are missing or have been moved.
42*9e94795aSAndroid Build Coastguard Worker#
43*9e94795aSAndroid Build Coastguard Worker# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
44*9e94795aSAndroid Build Coastguard Worker# Use $(OUT_DIR) to refer to the "out" directory.
45*9e94795aSAndroid Build Coastguard Worker#
46*9e94795aSAndroid Build Coastguard Worker# If you need to re-do something that's already mentioned, just copy
47*9e94795aSAndroid Build Coastguard Worker# the command and add it to the bottom of the list.  E.g., if a change
48*9e94795aSAndroid Build Coastguard Worker# that you made last week required touching a file and a change you
49*9e94795aSAndroid Build Coastguard Worker# made today requires touching the same file, just copy the old
50*9e94795aSAndroid Build Coastguard Worker# touch step and add it to the end of the list.
51*9e94795aSAndroid Build Coastguard Worker#
52*9e94795aSAndroid Build Coastguard Worker# ************************************************
53*9e94795aSAndroid Build Coastguard Worker# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
54*9e94795aSAndroid Build Coastguard Worker# ************************************************
55*9e94795aSAndroid Build Coastguard Worker
56*9e94795aSAndroid Build Coastguard Worker# For example:
57*9e94795aSAndroid Build Coastguard Worker#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
58*9e94795aSAndroid Build Coastguard Worker#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
59*9e94795aSAndroid Build Coastguard Worker#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
60*9e94795aSAndroid Build Coastguard Worker#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
61*9e94795aSAndroid Build Coastguard Worker$(call add-clean-step, rm -rf $(OUT_DIR)/obj/ETC/build_manifest-vendor_intermediates)
62*9e94795aSAndroid Build Coastguard Worker$(call add-clean-step, rm -rf $(OUT_DIR)/obj/ETC/build_manifest-odm_intermediates)
63*9e94795aSAndroid Build Coastguard Worker$(call add-clean-step, rm -rf $(OUT_DIR)/obj/ETC/build_manifest-product_intermediates)
64*9e94795aSAndroid Build Coastguard Worker$(call add-clean-step, rm -rf $(TARGET_OUT_VENDOR)/etc/security/fsverity)
65*9e94795aSAndroid Build Coastguard Worker$(call add-clean-step, rm -rf $(TARGET_OUT_ODM)/etc/security/fsverity)
66*9e94795aSAndroid Build Coastguard Worker$(call add-clean-step, rm -rf $(TARGET_OUT_PRODUCT)/etc/security/fsverity)
67*9e94795aSAndroid Build Coastguard Worker
68*9e94795aSAndroid Build Coastguard Worker# ************************************************
69*9e94795aSAndroid Build Coastguard Worker# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
70*9e94795aSAndroid Build Coastguard Worker# ************************************************
71*9e94795aSAndroid Build Coastguard Worker
72*9e94795aSAndroid Build Coastguard Workersubdir_cleanspecs := \
73*9e94795aSAndroid Build Coastguard Worker    $(file <$(OUT_DIR)/.module_paths/CleanSpec.mk.list)
74*9e94795aSAndroid Build Coastguard Workerinclude $(subdir_cleanspecs)
75*9e94795aSAndroid Build Coastguard Workersubdir_cleanspecs :=
76