Makefile for IMX8M custom embedded board .c files project

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Makefile for IMX8M custom embedded board .c files project

775 Views
althummar
Contributor I

Hi,

I am working with IMX8M custom embedded yocto board and building image file for yocto board on Linux host.

I build the toolchain for the same to cross-compile my project for the Yocto board with below command and which is successful.

bitbake meta-toolchain 

which has generated fsl-imx-xwayland-glibc-x86_64-meta-toolchain-aarch64-toolchain-4.14-sumo.sh  installer script and installed at /opt/fsl-imx-xwayland/4.14-sumo.

My question is how can I use this tool-chain to cross compile my project which I have complied in Linux using below mentioned Makefile.

What to modify in this Makefile so that I can execute target.exe on yocto board generated using this cross-compiler toolchain. Can someone please guide me with this. I'm kind of stuck here and not able to find any related documents to understand the things. I am very new to this and also not sure the information I have shared is enough or not so please let me know if you need more clarification @sreedhar_appala @Yuri @igorpadykov @Bio_TICFSL 

 

 

# Compiler
CC = gcc
# Path to user static library source (testlib.a)
LDFLAGS=-L../../testLIBS/lib
LIBS=-lpthread
# C compiler flags (-c -Wall)
CFLAGS= -g -Wall
ifeq ($(OS),Windows_NT)
  RM=cmd \/C del
else
  RM=rm -f
endif
# Source files
SRCS = $(wildcard *.c)
# Object Files
OBJS = $(SRCS:.c=.o)
# Executable File
EXECUTABLE = target.exe
.PHONY: depend clean
all:  myprog
myprog: $(OBJS)
	$(CC) $(CFLAGS) -o $(EXECUTABLE) $^ $(LDFLAGS) $(LIBS)
# Clean .o and .exe files form the respective directories
# make clean
clean:
	$(RM) $(OBJS) $(EXECUTABLE)
# Read source files and create dependencies
depend: $(SRCS)
	makedepend $(INCLUDES) $^

 

 

0 Kudos
Reply
1 Reply

748 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello althummar,

You can compile with fsl-imx-xwayland-glibc-x86_64-meta-toolchain-aarch64-toolchain-4.14-sumo in yocto but it won´t generated the *.exe file since you are in linux. now if you have compiled already you can pass the file to yocto.

 

Regards

 

 

0 Kudos
Reply