[OS-BUILD PATCHv3 2/4] [redhat] Makefile: dist-dump-variables, dist-check-variables, dist-clean-scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ben Crocker <bcrocker@xxxxxxxxxx>

Add dist-dump-variables and dist-check-variables for dynamically
deriving variables from Makefile.common and dumping or checking them.
At the moment, the dist-dump-variables and dist-check-variables are
identical, except in the name of the script generated.

Add a dist-clean-scripts target to clean up generated scripts.

Signed-off-by: Ben Crocker <bcrocker@xxxxxxxxxx>
---
 redhat/Makefile | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/redhat/Makefile b/redhat/Makefile
index ee3702434e05..7ec891df01ac 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -166,7 +166,11 @@ dist-clean-rpmdirs:
 		rm -rf $$i; \
 	done;
 
-dist-clean: dist-clean-sources dist-clean-configs dist-clean-rpmdirs
+dist-clean-scripts:
+	@if [ -f dist-dump-variables.sh ]; then rm dist-dump-variables.sh; fi
+	@if [ -f dist-check-variables.sh ]; then rm dist-check-variables.sh; fi
+
+dist-clean: dist-clean-sources dist-clean-configs dist-clean-rpmdirs dist-clean-scripts
 
 dist-stub-key:
 	@echo "Copying pre-generated keys";
@@ -382,6 +386,18 @@ dist-get-latest:
 dist-os-version:
 	@echo "OSVERSION: $(RHEL_MAJOR).$(RHEL_MINOR)"
 
+.EXPORT_ALL_VARIABLES:
+.PHONY: dist-dump-variables
+dist-dump-variables:
+	grep "^[ 	]*[a-zA-Z_][a-zA-Z_0-9]*[ 	]*[:?]*=" $(REDHAT)/Makefile.common | sed -e 's/[ 	]*\([a-zA-Z_][a-zA-Z_0-9]*\).*/echo "\1=$$\1"/' | sort | uniq > dist-dump-variables.sh
+	chmod +x $(REDHAT)/dist-dump-variables.sh
+	@$(REDHAT)/dist-dump-variables.sh
+
+dist-check-variables:
+	grep "^[ 	]*[a-zA-Z_][a-zA-Z_0-9]*[ 	]*[:?]*=" $(REDHAT)/Makefile.common | sed -e 's/[ 	]*\([a-zA-Z_][a-zA-Z_0-9]*\).*/echo "\1=$$\1"/' | sort | uniq > dist-check-variables.sh
+	chmod +x $(REDHAT)/dist-check-variables.sh
+	@$(REDHAT)/dist-check-variables.sh
+
 dist-help:
 	@echo  'Cleaning targets:'
 	@echo  '  dist-clean          - Clean redhat/configs/ and redhat/rpm/ directories.'
-- 
GitLab
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux