config-tools: introduce xslt transform and clang-format in genconf.sh

Add "transform" to generate following files with xsltproc in genconf.sh:
  - ivshmem_cfg.h
  - misc_cfg.h
  - pt_intx.c
  - vm_configurations.c
  - vm_configurations.h

Add code formatter using clang-format. It formats the gernerated code
with customized condfiguration if clang-format package and configuraion
file ".clang-format" exist.

Add sed in genconf.sh "transform" to replace the copyright "YEAR" of generated files.

Tracked-On: #5980
Signed-off-by: Yang,Yu-chu <yu-chu.yang@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Yang,Yu-chu
2021-03-08 12:39:05 -08:00
committed by wenlingz
parent 6d81112428
commit 5f2f82f4d8
3 changed files with 125 additions and 2 deletions

View File

@@ -238,7 +238,7 @@ $(HV_CONFIG_H): $(HV_UNIFIED_XML)
@echo "$@ generated"
$(HV_CONFIG_TIMESTAMP): $(HV_UNIFIED_XML) ${HV_DIFFCONFIG_LIST} | $(HV_CONFIG_DIR)
@sh $(BASEDIR)/scripts/genconf.sh $(BASEDIR) $(HV_BOARD_XML) $(HV_SCENARIO_XML) $(HV_CONFIG_DIR)
@sh $(BASEDIR)/scripts/genconf.sh $(BASEDIR) $(HV_BOARD_XML) $(HV_SCENARIO_XML) $(HV_CONFIG_DIR) $(HV_UNIFIED_XML)
@touch $@
.PHONY: defconfig
@@ -253,7 +253,7 @@ showconfig:
diffconfig:
@rm -rf $(HV_CONFIG_A_DIR) $(HV_CONFIG_B_DIR)
@sh $(BASEDIR)/scripts/genconf.sh $(BASEDIR) $(BOARD_FILE) $(HV_SCENARIO_XML) $(HV_CONFIG_A_DIR)
@sh $(BASEDIR)/scripts/genconf.sh $(BASEDIR) $(BOARD_FILE) $(HV_SCENARIO_XML) $(HV_CONFIG_A_DIR) $(HV_UNIFIED_XML)
@cd $(HV_CONFIG_DIR) && find . -name '*.c' -or -name '*.h' -or -name '*.config' -or -name '*.asl' | while read f; do \
nf=$(HV_CONFIG_B_DIR)/$${f}; mkdir -p `dirname $${nf}` && cp $${f} $${nf}; \
done