xtest: create output dir before generating regression_8100 header files
In some rare occurrence and with a lot of parallel jobs, the following
compilation failure of xtest could happen:
GEN out/xtest/regression_8100_ca_crt.h
python3 ../../scripts/file_to_c.py --inf ../../cert/ca.crt --out out/xtest/regression_8100_ca_crt.h --name regression_8100_ca_crt
Traceback (most recent call last):
File "../../scripts/file_to_c.py", line 48, in <module>
main()
File "../../scripts/file_to_c.py", line 24, in main
f = open(args.out, 'w')
FileNotFoundError: [Errno 2] No such file or directory: 'out/xtest/regression_8100_ca_crt.h'
make: *** [Makefile:226: out/xtest/regression_8100_ca_crt.h] Error 1
This is caused by the output directory `out/xtest/` not being created
when generating the following header files with the `embed-file` macro:
* regression_8100_ca_crt.h
* regression_8100_mid_crt.h
* regression_8100_my_crt.h
* regression_8100_my_csr.h
To avoid this issue, make sure the output directory is created before
generating the header files.
Fixes: 97d6e290 ("regression: add case 8102")
Signed-off-by: Clement Faure <clement.faure@nxp.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
diff --git a/host/xtest/Makefile b/host/xtest/Makefile
index 8e7c334..a898c57 100644
--- a/host/xtest/Makefile
+++ b/host/xtest/Makefile
@@ -215,6 +215,7 @@
cleanfiles += $(out-dir)/xtest/$(1).h
$(out-dir)/xtest/$(1).h: $(2)
+ $(q)mkdir -p $(out-dir)/xtest/
@echo ' GEN $$@'
$(q)$(PYTHON3) ../../scripts/file_to_c.py --inf $$< --out $$@ --name $(1)