cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
davidfi1
Adventurer
Adventurer
447 Views
Registered: ‎10-08-2018

Pre / Post build script of a BSP

Jump to solution

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.

0 Kudos
1 Solution

Accepted Solutions
ibaie
Xilinx Employee
Xilinx Employee
384 Views
Registered: ‎10-06-2016

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


Ibai
Don’t forget to reply, kudo, and accept as solution.

View solution in original post

3 Replies
ibaie
Xilinx Employee
Xilinx Employee
385 Views
Registered: ‎10-06-2016

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


Ibai
Don’t forget to reply, kudo, and accept as solution.

View solution in original post

davidfi1
Adventurer
Adventurer
372 Views
Registered: ‎10-08-2018

Can you point me to a tutorial / example ?

I see the Makefile in the BSP's directory - Can I edit it?

0 Kudos
davidfi1
Adventurer
Adventurer
360 Views
Registered: ‎10-08-2018

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

 

0 Kudos