cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Ryose93
Visitor
Visitor
132 Views
Registered: ‎03-16-2021

Manage Header file inside application template in Petalinux 2020.2

Hi everyone, I'm pretty new to the 2020.2 version of Petalinux and I'm trying to create a simple application inside my project using the C template. 

After creating the helloworld-app using the command:

petalinux-create -t apps --template c --name helloworld-app

After enabling the default application and building it successfully,I tried to add some functionality by creating a new directory under "helloworld-app/files" called Ethernet, containing 2 files Etherent.c and Ethernet.h

Finally, I added the Ethernet.o object to the list inside the auto-generated Makefile for the module, I also added a VPATH for simplicity.

Unfortunately the build fails, in fact bitbake tells me that Ethernet.c tries to include Ethernet.h, which is not found. Ho can i modify the makefile in order for this simple code to work?

Ethernet.c:

#include "Ethernet.h"
//some C code

helloworld-app.c:

#include <stdio.h>
#include "Ethernet/Ethernet.h"

//some C code

 Makefile:

APP = helloworld-app

VPATH=Ethernet

# Add any other object files to this list below
APP_OBJS = helloworld-app.o Ethernet.o

all: build

build: $(APP)

$(APP): $(APP_OBJS)
	$(CC) -o $@ $(APP_OBJS) $(LDFLAGS) $(LDLIBS)
clean:
	rm -f $(APP) *.o
0 Kudos
0 Replies