General rework for Yocto Project integration#2
General rework for Yocto Project integration#2otavio wants to merge 2 commits intonxp-imx-support:masterfrom
Conversation
This commit rework the Makefile targets so it provides a standardized set of targets and allow overriding of variables so cross compiling is properly supported. Fixes: nxp-imx-support#1. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
| COPTS = -g -Wall -Werror | ||
| CFLAGS = -I../inc/. | ||
| PREFIX ?= /usr/local | ||
| BINDIR ?= $(PREFIX)/bin |
There was a problem hiding this comment.
Currently my yocto scripts are pulling cst-singer binary and csf config files from home directory of cst-signer tool. I will not be able to apply this change in this release.
There was a problem hiding this comment.
It is recommended to use /usr/local for manually built applications, and /usr for packaged tools. The home directory is not suitable for this purpose.
| $(CC) $(COPTS) $(CFLAGS) -o $@ $(SRCS) | ||
| install: cst-signer | ||
| install -D -m 0755 cst-signer $(DESTDIR)/$(BINDIR)/cst-signer | ||
| install -D -m 0755 -t $(DESTDIR)$(DATADIR)/doc/cst-signer \ |
There was a problem hiding this comment.
I do not understand the usage of doc folder here. maybe its something I am not familiar with possibly autotools related?
There was a problem hiding this comment.
The .sample configuration files go to /usr/share/doc/ as
-rw-r--r-- root/root 230 2023-09-08 16:41 ./usr/share/doc/cst-signer/csf_ahab.cfg.sample
-rw-r--r-- root/root 430 2023-09-08 16:41 ./usr/share/doc/cst-signer/csf_hab4.cfg.sample
for target packages. Here for example I generated:
[0] ~/src/oe/oel/master/build/tmp/deploy/ipk/cortexa53-crypto/cst-signer-dev_0.3+0+7fa50daf32-r0_cortexa53-crypto.ipk [0]
[1] ~/src/oe/oel/master/build/tmp/deploy/ipk/cortexa53-crypto/cst-signer-doc_0.3+0+7fa50daf32-r0_cortexa53-crypto.ipk [1]
[2] ~/src/oe/oel/master/build/tmp/deploy/ipk/cortexa53-crypto/cst-signer_0.3+0+7fa50daf32-r0_cortexa53-crypto.ipk [2]
[3] ~/src/oe/oel/master/build/tmp/deploy/ipk/cortexa53-crypto/cst-signer-src_0.3+0+7fa50daf32-r0_cortexa53-crypto.ipk [3]
[4] ~/src/oe/oel/master/build/tmp/deploy/ipk/cortexa53-crypto/cst-signer-dbg_0.3+0+7fa50daf32-r0_cortexa53-crypto.ipk [4]
I understand that you use those files as templates, but in this particular case, it should be done in the native recipe. In my recipe I did this as well.
|
|
||
| clean: | ||
| rm -rf cst_signer fdt.o | ||
| rm -rf cst-signer *.o |
There was a problem hiding this comment.
Shouldnt DESTDIR be cleaned as well?
There was a problem hiding this comment.
No, 'clean' is not an uninstall target.
utkarshguptanxp
left a comment
There was a problem hiding this comment.
The header files are surrounded by quotes as they are not system header files. Angle brackets should be ok here even though we are using include directory as the compiler should first search in local include directory for these files.
|
Hi Otavio, I am back to working on this project. We had a new release in Q4 '23 which has gone public. Yocto Recipe: https://github.com/nxp-imx-support/meta-nxp-security-reference-design/tree/mickledore-6.1.55-2.2.0/meta-secure-boot |
|
Okay, I understand. Can you tell me what is left to be done before this PR can be merged? |
Please see my previous review comments from last few days. In addition I have made following changes to the Makefiles which are adapting your changes. But please also advice on the questions above. |
|
When including local headers, we typically use quotation marks ( |
|
Ok sounds good. Please also comment on the patch posted above and about the install/uninstall command. |
The two commit messages provide information about the changes made in the code:
Fix include of headers so it indicates it uses the includedir:
includedir.Improve Makefile so it is overridable and provides standardized targets:
installtarget in Makefile #1.