128bb8be0SLorenzo Colitti# Copyright (C) 2007 The Android Open Source Project
228bb8be0SLorenzo Colitti#
328bb8be0SLorenzo Colitti# Licensed under the Apache License, Version 2.0 (the "License");
428bb8be0SLorenzo Colitti# you may not use this file except in compliance with the License.
528bb8be0SLorenzo Colitti# You may obtain a copy of the License at
628bb8be0SLorenzo Colitti#
728bb8be0SLorenzo Colitti#      http://www.apache.org/licenses/LICENSE-2.0
828bb8be0SLorenzo Colitti#
928bb8be0SLorenzo Colitti# Unless required by applicable law or agreed to in writing, software
1028bb8be0SLorenzo Colitti# distributed under the License is distributed on an "AS IS" BASIS,
1128bb8be0SLorenzo Colitti# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1228bb8be0SLorenzo Colitti# See the License for the specific language governing permissions and
1328bb8be0SLorenzo Colitti# limitations under the License.
1428bb8be0SLorenzo Colitti#
1528bb8be0SLorenzo Colitti
1628bb8be0SLorenzo Colitti# If you don't need to do a full clean build but would like to touch
1728bb8be0SLorenzo Colitti# a file or delete some intermediate files, add a clean step to the end
1828bb8be0SLorenzo Colitti# of the list.  These steps will only be run once, if they haven't been
1928bb8be0SLorenzo Colitti# run before.
2028bb8be0SLorenzo Colitti#
2128bb8be0SLorenzo Colitti# E.g.:
2228bb8be0SLorenzo Colitti#     $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
2328bb8be0SLorenzo Colitti#     $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
2428bb8be0SLorenzo Colitti#
2528bb8be0SLorenzo Colitti# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
2628bb8be0SLorenzo Colitti# files that are missing or have been moved.
2728bb8be0SLorenzo Colitti#
2828bb8be0SLorenzo Colitti# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
2928bb8be0SLorenzo Colitti# Use $(OUT_DIR) to refer to the "out" directory.
3028bb8be0SLorenzo Colitti#
3128bb8be0SLorenzo Colitti# If you need to re-do something that's already mentioned, just copy
3228bb8be0SLorenzo Colitti# the command and add it to the bottom of the list.  E.g., if a change
3328bb8be0SLorenzo Colitti# that you made last week required touching a file and a change you
3428bb8be0SLorenzo Colitti# made today requires touching the same file, just copy the old
3528bb8be0SLorenzo Colitti# touch step and add it to the end of the list.
3628bb8be0SLorenzo Colitti#
3728bb8be0SLorenzo Colitti# ************************************************
3828bb8be0SLorenzo Colitti# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
3928bb8be0SLorenzo Colitti# ************************************************
4028bb8be0SLorenzo Colitti
4128bb8be0SLorenzo Colitti# For example:
4228bb8be0SLorenzo Colitti#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
4328bb8be0SLorenzo Colitti#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
4428bb8be0SLorenzo Colitti#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
4528bb8be0SLorenzo Colitti#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
4628bb8be0SLorenzo Colitti
4728bb8be0SLorenzo Colitti$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/CorpApp_intermediates)
4828bb8be0SLorenzo Colitti
4928bb8be0SLorenzo Colitti# ************************************************
5028bb8be0SLorenzo Colitti# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
5128bb8be0SLorenzo Colitti# ************************************************
52