From 495e58502a60dde2c3b1407e2139ff798f2da26f Mon Sep 17 00:00:00 2001 From: Steve Block Date: Wed, 29 Feb 2012 19:18:08 +0000 Subject: [PATCH] Revert "Remove unused notice_files target" This broke the PRODUCT-sdk-(win_)sdk target of SDK builds This reverts commit 620a5270fc77431b773f3cfe948c467e03a2c72e. Change-Id: I81afe68ae98b5daac5fe136ec8d04f6fba5af9b4 --- core/Makefile | 49 +++++++++++++++++++++++++++++++++++++++++-------- core/binary.mk | 2 +- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/core/Makefile b/core/Makefile index 0d3ddc8d2..819eb3822 100644 --- a/core/Makefile +++ b/core/Makefile @@ -410,12 +410,15 @@ endif # ALL_DEFAULT_INSTALLED_MODULES, which those use to pick which files # go into the systemimage. +.PHONY: notice_files + # Create the rule to combine the files into text and html forms -# $(1) - HTML output file -# $(2) - File title -# $(3) - Directory to use. Notice files are all $(3)/src. Other +# $(1) - Plain text output file +# $(2) - HTML output file +# $(3) - File title +# $(4) - Directory to use. Notice files are all $(4)/src. Other # directories in there will be used for scratch -# $(4) - Dependencies for the output files +# $(5) - Dependencies for the output files # # The algorithm here is that we go collect a hash for each of the notice # files and write the names of the files that match that hash. Then @@ -429,9 +432,9 @@ endif # original notice files instead of making rules to copy them somwehere. # Then we could traverse that without quite as much bash drama. define combine-notice-files -$(1): PRIVATE_MESSAGE := $(2) -$(1) $(3)/hash-timestamp: PRIVATE_DIR := $(3) -$(3)/hash-timestamp: $(4) $(BUILD_SYSTEM)/Makefile +$(1) $(2): PRIVATE_MESSAGE := $(3) +$(1) $(2) $(4)/hash-timestamp: PRIVATE_DIR := $(4) +$(4)/hash-timestamp: $(5) $(BUILD_SYSTEM)/Makefile @echo Finding NOTICE files: $$@ $$(hide) rm -rf $$@ $$(PRIVATE_DIR)/hash $$(hide) mkdir -p $$(PRIVATE_DIR)/hash @@ -441,7 +444,32 @@ $(3)/hash-timestamp: $(4) $(BUILD_SYSTEM)/Makefile echo $$$$file >> $$$$hashfile; \ done $$(hide) touch $$@ -$(1): $(3)/hash-timestamp +$(1): $(4)/hash-timestamp + @echo Combining NOTICE files: $$@ + $$(hide) mkdir -p $$(dir $$@) + $$(hide) echo $$(PRIVATE_MESSAGE) > $$@ + $$(hide) find $$(PRIVATE_DIR)/hash -type f | xargs cat | sort | \ + sed -e "s:$$(PRIVATE_DIR)/src\(.*\)\.txt: \1:" >> $$@ + $$(hide) echo >> $$@ + $$(hide) echo >> $$@ + $$(hide) echo >> $$@ + $$(hide) for hashfile in $$$$(find $$(PRIVATE_DIR)/hash -type f); do \ + echo "============================================================"\ + >> $$@; \ + echo "Notices for file(s):" >> $$@; \ + cat $$$$hashfile | sort | \ + sed -e "s:$$(PRIVATE_DIR)/src\(.*\)\.txt: \1:" >> \ + $$@; \ + echo "------------------------------------------------------------"\ + >> $$@; \ + echo >> $$@; \ + orig=$$$$(head -n 1 $$$$hashfile); \ + cat $$$$orig >> $$@; \ + echo >> $$@; \ + echo >> $$@; \ + echo >> $$@; \ + done +$(2): $(4)/hash-timestamp @echo Combining NOTICE files: $$@ $$(hide) mkdir -p $$(dir $$@) $$(hide) echo "" > $$@ @@ -477,25 +505,30 @@ $(1): $(3)/hash-timestamp done $$(hide) echo "" >> $$@ $$(hide) echo "" >> $$@ +notice_files: $(1) $(2) endef # TODO These intermediate NOTICE.txt/NOTICE.html files should go into # TARGET_OUT_NOTICE_FILES now that the notice files are gathered from # the src subdirectory. +target_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE.txt target_notice_file_html := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html target_notice_file_html_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html.gz +tools_notice_file_txt := $(HOST_OUT_INTERMEDIATES)/NOTICE.txt tools_notice_file_html := $(HOST_OUT_INTERMEDIATES)/NOTICE.html kernel_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/kernel.txt $(eval $(call combine-notice-files, \ + $(target_notice_file_txt), \ $(target_notice_file_html), \ "Notices for files contained in the filesystem images in this directory:", \ $(TARGET_OUT_NOTICE_FILES), \ $(ALL_DEFAULT_INSTALLED_MODULES) $(kernel_notice_file))) $(eval $(call combine-notice-files, \ + $(tools_notice_file_txt), \ $(tools_notice_file_html), \ "Notices for files contained in the tools directory:", \ $(HOST_OUT_NOTICE_FILES), \ diff --git a/core/binary.mk b/core/binary.mk index e72916448..e4882001b 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -571,7 +571,7 @@ built_whole_libraries := \ # We don't care about installed static libraries, since the # libraries have already been linked into the module at that point. # We do, however, care about the NOTICE files for any static -# libraries that we use. (see notice_files.mk) +# libraries that we use. (see notice_files.make) installed_static_library_notice_file_targets := \ $(foreach lib,$(LOCAL_STATIC_LIBRARIES) $(LOCAL_WHOLE_STATIC_LIBRARIES), \ -- 2.11.0