echo "#" >> $@;
$(hide) $(foreach line,$(ADDITIONAL_DEFAULT_PROPERTIES), \
echo "$(line)" >> $@;)
- build/tools/post_process_props.py $@
+ $(hide) echo "#" >> $@; \
+ echo "# BOOTIMAGE_BUILD_PROPERTIES" >> $@; \
+ echo "#" >> $@;
- $(hide) echo ro.bootimage.build.date=`date`>>$@
- $(hide) echo ro.bootimage.build.date.utc=`date +%s`>>$@
++ $(hide) echo ro.bootimage.build.date=`date -d "$(BUILD_DATETIME_FROM_FILE)"`>>$@
++ $(hide) echo ro.bootimage.build.date.utc=`date -d "$(BUILD_DATETIME_FROM_FILE)" +%s`>>$@
+ $(hide) echo ro.bootimage.build.fingerprint="$(BUILD_FINGERPRINT_FROM_FILE)">>$@
+ $(hide) build/tools/post_process_props.py $@
# -----------------------------------------------------------------
# build.prop
# are specific to the user's build configuration.
include $(BUILD_SYSTEM)/envsetup.mk
+# Pruned directory options used when using findleaves.py
+# See envsetup.mk for a description of SCAN_EXCLUDE_DIRS
+FIND_LEAVES_EXCLUDES := $(addprefix --prune=, $(OUT_DIR) $(SCAN_EXCLUDE_DIRS) .repo .git)
+
+ # ---------------------------------------------------------------
+ # Allow the C/C++ macros __DATE__ and __TIME__ to be set to the
+ # build date and time, so that a build may be repeated.
+ # Write the date and time to a file so that the command line
+ # doesn't change every time, which would cause ninja to rebuild
+ # the files.
+ $(shell mkdir -p $(OUT_DIR) && \
+ date -d "$(BUILD_DATETIME)" "+%b %_d %Y" > $(OUT_DIR)/build_c_date.txt && \
+ date -d "$(BUILD_DATETIME)" +%T > $(OUT_DIR)/build_c_time.txt)
+ BUILD_DATETIME_C_DATE := $$(cat $(OUT_DIR)/build_c_date.txt)
+ BUILD_DATETIME_C_TIME := $$(cat $(OUT_DIR)/build_c_time.txt)
+
+ ifeq ($(OVERRIDE_C_DATE_TIME),true)
+ COMMON_GLOBAL_CFLAGS += -Wno-builtin-macro-redefined -D__DATE__="\"$(BUILD_DATETIME_C_DATE)\"" -D__TIME__=\"$(BUILD_DATETIME_C_TIME)\"
+ COMMON_GLOBAL_CPPFLAGS += -Wno-builtin-macro-redefined -D__DATE__="\"$(BUILD_DATETIME_C_DATE)\"" -D__TIME__=\"$(BUILD_DATETIME_C_TIME)\"
+ endif
+
# The build system exposes several variables for where to find the kernel
# headers:
# TARGET_DEVICE_KERNEL_HEADERS is automatically created for the current