LVGL -- Light and Versatile Graphics Library

The demo code worked well on both Linux desktop, as described by @cbrake above, as well as on Windows desktop.

Windows desktop

Linux desktop (Ubuntu 20.04) with frame buffer:

Embedded Linux - cross compiling on Ubuntu for aarch64

  • git clone git@github.com:lvgl/lv_port_linux_frame_buffer.git
  • cd lv_port_linux_frame_buffer
  • git submodule update --init --recursive
  • mkdir build && cd build
  • download the “aarch64-linux-musl” option from https://musl.cc/ and place in the build/ directory
  • export CC="aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc"
  • cmake -DCMAKE_EXE_LINKER_FLAGS="-static -Os" ..
  • make

The following error results:

[ 41%] Built target lvgl 
[ 46%] Built target lv_drivers
[ 60%] Built target lvgl_demos
[ 99%] Built target lvgl_examples
[100%] Linking C executable lvgl_fb
/home/******/lv_port_linux_frame_buffer/build/aarch64-linux-musl-cross/bin/../lib/gcc/aarch64-linux-musl/11.2.1/../../../../aarch64-linux-musl/bin/ld: cannot find -lwayland-client
/home/******/lv_port_linux_frame_buffer/build/aarch64-linux-musl-cross/bin/../lib/gcc/aarch64-linux-musl/11.2.1/../../../../aarch64-linux-musl/bin/ld: cannot find -lwayland-cursor
/home/******/lv_port_linux_frame_buffer/build/aarch64-linux-musl-cross/bin/../lib/gcc/aarch64-linux-musl/11.2.1/../../../../aarch64-linux-musl/bin/ld: cannot find -lxkbcommon
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/lvgl_fb.dir/build.make:104: lvgl_fb] Error 1
make[1]: *** [CMakeFiles/Makefile2:124: CMakeFiles/lvgl_fb.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

If anyone has an idea, please let me know. Thanks!

@collinbrake if you want to cross compile using ubuntu you will need all dependencies cross-compiled as well. Its needing wayland and xkbcommon but these inturn might need more so it can be a bit more packages and they should be compiled for musl since thats what you are using. See this article also on how cross-compiling would work on a native linux distro

https://jensd.be/1126/linux/cross-compiling-for-arm-or-aarch64-on-debian-or-ubuntu

You can also take advantage of ubuntu/debian multiarch support, so add arm64 to your base distro

sudo dpkg --add-architecture arm64
sudo touch /etc/apt/sources.list.d/arm64-cross-compile-sources.list

The add the apt sources to /etc/apt/sources.list.d/arm64-cross-compile-sources.list

deb [arch=arm64] http://ports.ubuntu.com/ focal main restricted
deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main restricted
deb [arch=arm64] http://ports.ubuntu.com/ focal universe
deb [arch=arm64] http://ports.ubuntu.com/ focal-updates universe
deb [arch=arm64] http://ports.ubuntu.com/ focal multiverse
deb [arch=arm64] http://ports.ubuntu.com/ focal-updates multiverse
deb [arch=arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse

add following to /etc/apt/sources.list

deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse

run sudo apt update

now you can install arm64 packages

sudo apt-get install gcc-aarch64-linux-gnu
sudo apt install wayland:arm64
sudo apt install xkbcommon:arm64

Now you can use the cross compiler to build your packages use.
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ in env

I would think it will be better to use Yocto SDK, perhaps with all dependencies built into SDK

maybe @cbrake can generate one for you using yoe

bitbake -cpopulate_sdk yoe-sdk-image

will generate it and then you can simply install it on your ubuntu box via the self installer that it will generate.

also see
https://docs.yoctoproject.org/sdk-manual/using.html

@khem Thank you very much - I am working on it, and should go the yocto route from the beginning, as you said.

Start of a lvgl recipe here:

It has some packaging problems, but does build a binary that I can scp over to the target i.MX8 device. The result is not perfect but runs:

Probably need to configure the FB size or something …

Recipe for the LVGL PC demo:

Again, builds fine, but has some packaging issues.

Copied libsdl over to the target and installed it:

root@imx8qxp-var-som:~# opkg install libsdl2-2.0-0_2.0.22-r0.0_cortexa35-mx8.ipk 
Installing libsdl2-2.0-0 (2.0.22) on root
Configuring libsdl2-2.0-0.

Then scp’d the LVGL binary and ran it:

root@imx8qxp-var-som:~# ./main 
[Warn]  (0.000, +0)      lv_init: Memory integrity checks are enabled via LV_USE_ASSERT_MEM_INTEGRITY which makes LVGL much slower      (in lv_obj.c line #160)
[Warn]  (0.000, +0)      lv_init: Object sanity checks are enabled via LV_USE_ASSERT_OBJ which makes LVGL much slower   (in lv_obj.c line #164)
[Warn]  (0.000, +0)      lv_init: Style sanity checks are enabled that uses more RAM    (in lv_obj.c line #168)

But, nothing on the screen – probably need X/Wayland, etc.

Asked for help on the LVGL forum, and the author suggested changing the color format – it works!

[cbrake@ceres git]$ git diff
diff --git a/lv_conf.h b/lv_conf.h
index 6bfe50f..e83dc55 100644
--- a/lv_conf.h
+++ b/lv_conf.h
@@ -24,7 +24,7 @@
  *====================*/
 
 /*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/
-#define LV_COLOR_DEPTH 32
+#define LV_COLOR_DEPTH 16
 
 /*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/
 #define LV_COLOR_16_SWAP 0

Touchscreen is not working yet, so that is the next project …

1 Like

for touchscreen perhaps we need to look into

Some porting docs on input drivers

https://docs.lvgl.io/master/porting/indev.html

with the latest yoe/master, we are using Clang 15 and now getting a compile error in the fb demo, so opened an issue here:

Clang is trying to get rid of pre-c99 constructs which is nice to clean up but its everywhere :frowning: There is fix I proposed

yeah, forces everyone to clean up their code – not a bad thing. Works, thanks!

These diagnostics have been demoted into warnings in clang 15.0.1 release which we will have shortly for Yoe too.

nevertheless, I agree that 20 years is enough of a time to migrate

1 Like

Even though “bitbake lvgl-demo-fb” works, I get the following
error after addin lvgl-demo-gb into IMAGE_INSTALL of my BSP:

NOTE: Executing Tasks
ERROR: imx8mmevk-image-demo-1.0-r0 do_rootfs: Could not invoke dnf. Command ‘/work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c /work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=/work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/rootfs/etc/yum.repos.d --installroot=/work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/rootfs --setopt=logdir=/work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/temp --repofrompath=oe-repo,/work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/oe-rootfs-repo --nogpgcheck install beep btrfs-tools ca-certificates canutils devmem2 dropbear ethtool evtest freerdp gstreamer1.0 gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good i2c-tools init-ifupdown iperf3 iproute2 iw kernel-devicetree kernel-modules kmscube libdrm libegl-mesa libgbm libglapi libgles1-mesa libgles2-mesa libgpiod libgpiod-tools libubootenv-bin lvgl-demo-fb mesa mesa-megadriver mmc-utils mtd-utils nano openssl-engines packagegroup-base-extended packagegroup-core-boot packagegroup-core-sdk packagegroup-core-standalone-sdk-target packagegroup-core-tools-debug packagegroup-core-tools-profile pciutils rng-tools run-postinsts stress-ng swupdate-keys swupdate-tools swupdate-www systemd-conf u-boot-default-env u-boot-fw-utils virtual/bootloader weston weston-examples weston-init wireless-regdb-static wpa-supplicant locale-base-en-us locale-base-en-gb’ returned 1:
DNF version: 4.11.1
cachedir: /work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/rootfs/var/cache/dnf
Added oe-repo repo from /work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/oe-rootfs-repo
User-Agent: falling back to ‘libdnf’: could not detect OS or basearch
repo: using cache for: oe-repo
oe-repo: using metadata from Fri 13 Jan 2023 05:08:39 PM UTC.
Last metadata expiration check: 0:00:01 ago on Fri 13 Jan 2023 05:08:39 PM UTC.
No match for argument: lvgl-demo-fb
Error: Unable to find a match: lvgl-demo-fb

ERROR: Logfile of failure stored in: /work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/temp/log.do_rootfs.1775660
ERROR: Task (/work/festevam/imx8mmevk/oe/meta-imx8mmevk-extras/dynamic-layers/core/recipes-core/images/imx8mmevk-image-demo.bb:do_rootfs) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 5083 tasks of which 5082 didn’t need to be rerun and 1 failed.

Any suggestions?

Thanks

Hi @cbrake and @khem

I tried to build cbrake’s lvgl-demo-fb.bb recipe:

but I am getting the following build error in kirkstone:

ERROR: lvgl-demo-fb-1.0-r0 do_package_write_rpm: ExecutionError(‘/work/festevam/imx8mmevk/oe/poky/build/tmp/work/aarch64-imx8mmevklinux-linux/lvgl-demo-fb/1.0-r0/temp/run.BUILDSPEC.1710793’, 1, None, None)
ERROR: Logfile of failure stored in: /work/festevam/imx8mmevk/oe/poky/build/tmp/work/aarch64-imx8mmevklinux-linux/lvgl-demo-fb/1.0-r0/temp/log.do_package_write_rpm.1710793
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are [‘virtual:native:/work/festevam/imx8mmevk/oe/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot’, ‘virtual:native:/work/festevam/imx8mmevk/oe/poky/meta/recipes-devtools/rpm/rpm_4.17.1.bb:do_populate_sysroot’]
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: [‘pseudo-native’, ‘rpm-native’, ‘libgcrypt-native’, ‘elfutils-native’, ‘sqlite3-native’, ‘bzip2-native’, ‘lua-native’, ‘xz-native’, ‘popt-native’, ‘file-native’, ‘python3-native’, ‘zstd-native’, ‘gettext-minimal-native’, ‘libtool-native’, ‘libcap-native’, ‘libgpg-error-native’, ‘texinfo-dummy-native’, ‘zlib-native’, ‘readline-native’, ‘libffi-native’, ‘gdbm-native’, ‘ncurses-native’, ‘libnsl2-native’, ‘libtirpc-native’, ‘openssl-native’, ‘util-linux-libuuid-native’, ‘perl-native’, ‘make-native’]
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing python function sstate_task_prefunc
| DEBUG: Python function sstate_task_prefunc finished
| DEBUG: Executing python function do_package_write_rpm
| DEBUG: Executing python function read_subpackage_metadata
| DEBUG: Python function read_subpackage_metadata finished
| DEBUG: Executing python function do_package_rpm
| DEBUG: Executing python function write_specfile
| NOTE: Creating RPM package for lvgl-demo-fb-src
| NOTE: Creating empty RPM package for lvgl-demo-fb-dbg
| NOTE: Creating RPM package for lvgl-demo-fb-staticdev
| NOTE: Creating RPM package for lvgl-demo-fb-dev
| NOTE: Not creating empty RPM package for lvgl-demo-fb-doc
| NOTE: Not creating empty RPM package for lvgl-demo-fb-locale
| NOTE: Not creating empty RPM package for lvgl-demo-fb
| DEBUG: Python function write_specfile finished
| DEBUG: PKGWRITEDIR: /work/festevam/imx8mmevk/oe/poky/build/tmp/work/aarch64-imx8mmevklinux-linux/lvgl-demo-fb/1.0-r0/deploy-rpms/aarch64
| DEBUG: Executing shell function BUILDSPEC
| error: line 6: Empty tag: Group:
| Building target platforms: aarch64-imx8mmevklinux-linux
| Building for target aarch64-imx8mmevklinux-linux
| WARNING: /work/festevam/imx8mmevk/oe/poky/build/tmp/work/aarch64-imx8mmevklinux-linux/lvgl-demo-fb/1.0-r0/temp/run.BUILDSPEC.1710793:145 exit 1 from ‘rpmbuild --noclean --nodeps --short-circuit --target aarch64-imx8mmevklinux-linux --buildroot /work/festevam/imx8mmevk/oe/poky/build/tmp/work/aarch64-imx8mmevklinux-linux/lvgl-demo-fb/1.0-r0/package --define ‘_topdir /work/festevam/imx8mmevk/oe/poky/build/tmp/work/aarch64-imx8mmevklinux-linux/lvgl-demo-fb/1.0-r0’ --define ‘_rpmdir /work/festevam/imx8mmevk/oe/poky/build/tmp/work/aarch64-imx8mmevklinux-linux/lvgl-demo-fb/1.0-r0/deploy-rpms/aarch64’ --define ‘_builddir /work/festevam/imx8mmevk/oe/poky/build/tmp/work/aarch64-imx8mmevklinux-linux/lvgl-demo-fb/1.0-r0/build’ --define ‘_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm’ --define ‘_use_internal_dependency_generator 0’ --define ‘_binaries_in_noarch_packages_terminate_build 0’ --define ‘_build_id_links none’ --define ‘_binary_payload w19T64.zstdio’ --define ‘_source_payload w19T64.zstdio’ --define ‘clamp_mtime_to_source_date_epoch 1’ --define ‘use_source_date_epoch_as_buildtime 1’ --define ‘_buildhost reproducible’ --define ‘__font_provides %{nil}’ --define ‘__find_requires %{nil}’ --define ‘__find_provides %{nil}’ --define ‘_unpackaged_files_terminate_build 0’ --define ‘debug_package %{nil}’ --define ‘_tmppath /work/festevam/imx8mmevk/oe/poky/build/tmp/work/aarch64-imx8mmevklinux-linux/lvgl-demo-fb/1.0-r0’ -bb /work/festevam/imx8mmevk/oe/poky/build/tmp/work/aarch64-imx8mmevklinux-linux/lvgl-demo-fb/1.0-r0/lvgl-demo-fb.spec’
| WARNING: Backtrace (BB generated script):
| #1: BUILDSPEC, /work/festevam/imx8mmevk/oe/poky/build/tmp/work/aarch64-imx8mmevklinux-linux/lvgl-demo-fb/1.0-r0/temp/run.BUILDSPEC.1710793, line 145
| #2: main, /work/festevam/imx8mmevk/oe/poky/build/tmp/work/aarch64-imx8mmevklinux-linux/lvgl-demo-fb/1.0-r0/temp/run.BUILDSPEC.1710793, line 149
| DEBUG: Python function do_package_rpm finished
| DEBUG: Python function do_package_write_rpm finished
ERROR: Task (/work/festevam/imx8mmevk/oe/meta-imx8mmevk-extras/recipes-graphics/lvgl/lvgl-demo-fb.bb:do_package_write_rpm) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 566 tasks of which 565 didn’t need to be rerun and 1 failed.

Would you have any suggestions?

Thanks

Interesting, removing the SECTION line from the recipe made it to work fine.

With the version below, it builds without errors:

# Copyright (C) 2022 Cliff Brake <cbrake@bec-systems.com>
# Released under the MIT license (see COPYING.MIT for the terms)

SUMMARY = "LVGL Demo Application (FB)"
HOMEPAGE = "https://github.com/lvgl/lv_port_linux_frame_buffer"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

inherit cmake

SRC_URI = "gitsm://github.com/lvgl/lv_port_linux_frame_buffer.git;branch=master;protocol=https"

SRCREV = "a2384b74cec9ffd7407d12ed64a8326b5696f309"

S = "${WORKDIR}/git"

I can try to upstream it.

Thanks

welcome @Fabio_Estevam !!

I think we also need to adjust LIC_FILES_CHKSUM to use lv_port_linux_frame_buffer/LICENSE at master · lvgl/lv_port_linux_frame_buffer · GitHub

Hi @khem

Thanks.

I was not subscribed and I think my posts went a bit out of order. Sorry about that.

I will adjust LIC_FILES_CHKSUM as per your suggestion.

Here is the current status:

“bitbake lvgl-demo-fb” works fine.

After I add lvgl-demo-fb into IMAGE_INSTALL, the following error is seen:

NOTE: Executing Tasks
ERROR: imx8mmevk-image-demo-1.0-r0 do_rootfs: Could not invoke dnf. Command ‘/work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c /work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=/work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/rootfs/etc/yum.repos.d --installroot=/work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/rootfs --setopt=logdir=/work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/temp --repofrompath=oe-repo,/work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/oe-rootfs-repo --nogpgcheck install beep btrfs-tools ca-certificates canutils devmem2 dropbear ethtool evtest freerdp gstreamer1.0 gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good i2c-tools init-ifupdown iperf3 iproute2 iw kernel-devicetree kernel-modules kmscube libdrm libegl-mesa libgbm libglapi libgles1-mesa libgles2-mesa libgpiod libgpiod-tools libubootenv-bin lvgl-demo-fb mesa mesa-megadriver mmc-utils mtd-utils nano openssl-engines packagegroup-base-extended packagegroup-core-boot packagegroup-core-sdk packagegroup-core-standalone-sdk-target packagegroup-core-tools-debug packagegroup-core-tools-profile pciutils rng-tools run-postinsts stress-ng swupdate-keys swupdate-tools swupdate-www systemd-conf u-boot-default-env u-boot-fw-utils virtual/bootloader weston weston-examples weston-init wireless-regdb-static wpa-supplicant locale-base-en-us locale-base-en-gb’ returned 1:
DNF version: 4.11.1
cachedir: /work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/rootfs/var/cache/dnf
Added oe-repo repo from /work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/oe-rootfs-repo
User-Agent: falling back to ‘libdnf’: could not detect OS or basearch
repo: using cache for: oe-repo
oe-repo: using metadata from Fri 13 Jan 2023 05:08:39 PM UTC.
Last metadata expiration check: 0:00:01 ago on Fri 13 Jan 2023 05:08:39 PM UTC.
No match for argument: lvgl-demo-fb
Error: Unable to find a match: lvgl-demo-fb

ERROR: Logfile of failure stored in: /work/festevam/imx8mmevk/oe/poky/build/tmp/work/imx8mmevk-imx8mmevklinux-linux/imx8mmevk-image-demo/1.0-r0/temp/log.do_rootfs.1775660
ERROR: Task (/work/festevam/imx8mmevk/oe/meta-imx8mmevk-extras/dynamic-layers/core/recipes-core/images/imx8mmevk-image-demo.bb:do_rootfs) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 5083 tasks of which 5082 didn’t need to be rerun and 1 failed.

If you have any suggestions as to how to fix this error, please let me know.

Thanks

@Fabio_Estevam thanks for sharing your experiences. Running a build here to see if I can duplicate your issues.

Hi @cbrake and @khem

I made some progress and now I can add lvgl-demo-fb into IMAGE_INSTALL.

Here is the recipe that I am using now:

# Copyright (C) 2022 Cliff Brake <cbrake@bec-systems.com>
FILESEXTRAPATHS:append := "${THISDIR}/files:"

SUMMARY = "LVGL Demo Application for Framebuffer"
HOMEPAGE = "https://github.com/lvgl/lv_port_linux_frame_buffer"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=802d3d83ae80ef5f343050bf96cce3a4 \
                    file://lv_drivers/LICENSE;md5=d6fc0df890c5270ef045981b516bb8f2 \
                    file://lvgl/LICENCE.txt;md5=bf1198c89ae87f043108cea62460b03a"

SRC_URI = "gitsm://github.com/lvgl/lv_port_linux_frame_buffer.git;branch=master;protocol=https"
SRC_URI += "file://0001-improvemakefile.patch"
SRCREV = "a2384b74cec9ffd7407d12ed64a8326b5696f309"

S = "${WORKDIR}/git"

EXTRA_OEMAKE = "DESTDIR=${D}"

do_install() {
        oe_runmake install
}

and the lv_port_linux_frame_buffer patch is

From 5462a44c91e1605a73c98ea689ce0c6824f6460e Mon Sep 17 00:00:00 2001
From: Fabio Estevam <festevam@denx.de>
Date: Fri, 13 Jan 2023 14:38:57 -0300
Subject: [PATCH] lvgl_fb: Add a Makefile

Add a Makefile to make installation and uninstallation
process easier.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Makefile b/Makefile
index ba6972b..c05746d 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,8 @@ CFLAGS ?= -O3 -g0 -I$(LVGL_DIR)/ -Wall -Wshadow -Wundef -Wmissing-prototypes -Wn
 LDFLAGS ?= -lm
 BIN = demo
 
+prefix ?= /usr
+bindir ?= $(prefix)/bin
 
 #Collect the files to compile
 MAINSRC = ./main.c
@@ -41,3 +43,9 @@ default: $(AOBJS) $(COBJS) $(MAINOBJ)
 clean: 
 	rm -f $(BIN) $(AOBJS) $(COBJS) $(MAINOBJ)
 
+install:
+	install -d $(DESTDIR)$(bindir)
+	install $(BIN) $(DESTDIR)$(bindir)
+
+uninstall:
+	$(RM) -r $(addprefix $(DESTDIR)$(bindir)/,$(BIN))
-- 
2.25.1

The rootfs/usr/bin/demo binary is getting installed.

I don’t have my board at the moment to try a run-time test.

Thanks

Running the “demo” binary shows the LVGL application successfully on the display :slight_smile:

Also, sent the Makefile improvement patch:

2 Likes

Nice work @Fabio_Estevam – thanks for sharing!