We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 67189

PetaLinux : Creating a Makefile for custom application with multiple C/C++ files


I have multiple C/C++ files that should be included in the custom application, how can I create a Makefile for this?


In this example there are three C files (meas_chain_eth_init.c,crome_global.c & crome_lib.c) in the custom application.

Follow the steps below:

1) Use the following command:

Petalinux-create -t apps  --template install --name meas_chain_eth_init  --enable

2) Copy the custom application source files to the petalinux project directorty:

/component/apps/meas_chain_eth_init  (meas_chain_eth_init.c file created by petalinux is replaced with your custom application source top)

3) Use += to include the object files for crome_global.c & crome_lib.c

4) Update the Makefile with the highlighted details in the snapshot

5) Use the following command:



AR# 67189
Date Created 05/10/2016
Last Updated 05/27/2016
Status Active
Type General Article
  • SoC
  • FPGA Device Families
  • PetaLinux