forked from OP-TEE/optee_os
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mk/checkconf.mk: update generation of conf.mk
Make generation of conf.mk more consistent with what we do for conf.h, that is: - conf.mk shall not be touched if its content does not change, - write "CHK" when checking the file, then "UPD" only if it needs updating. Signed-off-by: Jerome Forissier <[email protected]> Reviewed-by: Jens Wiklander <[email protected]> Reviewed-by: Pascal Brand <[email protected]>
- Loading branch information
1 parent
0670725
commit 3354f9b
Showing
2 changed files
with
15 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,16 +23,12 @@ define check-conf-h | |
echo "#define $${guard}" >>[email protected]; \ | ||
echo -n "$${cnf}" | sed 's/_nl_ */\n/g' >>[email protected]; \ | ||
echo "#endif" >>[email protected]; \ | ||
if [ -r $@ ] && cmp -s $@ [email protected]; then \ | ||
rm -f [email protected]; \ | ||
else \ | ||
echo ' UPD $@'; \ | ||
mv [email protected] $@; \ | ||
fi | ||
$(call mv-if-changed,[email protected],$@) | ||
endef | ||
|
||
define build-conf-mk | ||
define check-conf-mk | ||
$(q)set -e; \ | ||
echo ' CHK $@'; \ | ||
cnf="$(strip $(foreach var, \ | ||
$(call cfg-vars-by-prefix,CFG_), \ | ||
$(call cfg-make-variable,$(var))))"; \ | ||
|
@@ -43,8 +39,17 @@ define build-conf-mk | |
echo "PLATFORM=${PLATFORM}" >>[email protected]; \ | ||
echo "PLATFORM_FLAVOR=${PLATFORM_FLAVOR}" >>[email protected]; \ | ||
echo -n "$${cnf}" | sed 's/_nl_ */\n/g' >>[email protected]; \ | ||
echo ' UPD $@'; \ | ||
mv [email protected] $@; | ||
$(call mv-if-changed,[email protected],$@) | ||
endef | ||
|
||
# Rename $1 to $2 only if file content differs. Otherwise just delete $1. | ||
define mv-if-changed | ||
if [ -r $2 ] && cmp -s $2 $1; then \ | ||
rm -f $1; \ | ||
else \ | ||
echo ' UPD $2'; \ | ||
mv $1 $2; \ | ||
fi | ||
endef | ||
|
||
define cfg-vars-by-prefix | ||
|