01-11-2021 10:40 PM
Hi.
To run post build script in an app - I go to:
project properties -> C/C++ Build -> settings -> Build Steps -> Post-Build steps.
What do I do to run pre build in a BSP project?
Thank you.
David.
01-13-2021 03:13 AM
Hi @davidfi1
Not sure if you are talking about SDK or Vitis but anyway is almost identical in both cases. The BSP project in SDK or the Platform project in Vitis are not CDT projects so there is no C/C++ Build settings where you can add pre and post build steps. Instead both projects are Makefile based so the only way you can add pre or post scripts is modifying the Makefiles adding dependency targets to the builds.
Regards
01-13-2021 03:13 AM
Hi @davidfi1
Not sure if you are talking about SDK or Vitis but anyway is almost identical in both cases. The BSP project in SDK or the Platform project in Vitis are not CDT projects so there is no C/C++ Build settings where you can add pre and post build steps. Instead both projects are Makefile based so the only way you can add pre or post scripts is modifying the Makefiles adding dependency targets to the builds.
Regards
01-13-2021 05:51 AM
Can you point me to a tutorial / example ?
I see the Makefile in the BSP's directory - Can I edit it?
01-13-2021 06:30 AM - edited 01-14-2021 12:53 AM
Open BSP filder -> right click "makefile" -> open with makefile editor
add this lines in the end:
pre-build:
-DataCpuBSP_PreBuild.bat
-@echo " Finished DataCpuBSP_PreBuild.bat "
Change the line for " all: libs " to all: pre-build libs
inset a batch file in the BSP directory:
if exist DataCPU_MB0/bsp_fixed.txt goto skip_bsp_fix
git checkout DataCPU_MB0/libsrc/lwip202_v1_2/src/contrib/ports/xilinx/netif/xadapter.c
git checkout DataCPU_MB0/libsrc/lwip202_v1_2/src/contrib/ports/xilinx/netif/xemacliteif.c
echo "bsp fixed" > DataCPU_MB0/bsp_fixed.txt
:skip_bsp_fix
Right click on Makefile -> Properties -> Attributes: Mark Read Only