Skip to content

Commit

Permalink
build: Support bitbake
Browse files Browse the repository at this point in the history
LDFLAGS can be defined from outside

This will fix observed issues:

    Subprocess output:arm-poky-linux-musleabi-strip:
    /.../demo: file format not recognized

    ERROR: lvgl-0.0.0-r012 do_package_qa:
    QA Issue: File /usr/lib/lvgl/bin/demo in package lvgl
    doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags]

Relate-to: lvgl/lvgl#2534
Signed-off-by: Philippe Coval <[email protected]>
  • Loading branch information
rzr committed Sep 6, 2021
1 parent b8e073c commit d0929d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
MAKEFLAGS := -j $(shell nproc)
SRC_EXT := c
OBJ_EXT := o
CC := gcc
CC ?= gcc

SRC_DIR := ./
WORKING_DIR := ./build
Expand All @@ -29,7 +29,7 @@ DEFINES := -D SIMULATOR=1 -D LV_BUILD_TEST=0

# Include simulator inc folder first so lv_conf.h from custom UI can be used instead
INC := -I./ui/simulator/inc/ -I./ -I./lvgl/
LDFLAGS := -lSDL2 -lm
LDLIBS := -lSDL2 -lm
BIN := $(BIN_DIR)/demo

COMPILE = $(CC) $(CFLAGS) $(INC) $(DEFINES)
Expand All @@ -47,7 +47,7 @@ $(BUILD_DIR)/%.$(OBJ_EXT): $(SRC_DIR)/%.$(SRC_EXT)

default: $(OBJECTS)
@mkdir -p $(BIN_DIR)
$(CC) -o $(BIN) $(OBJECTS) $(LDFLAGS)
$(CC) -o $(BIN) $(OBJECTS) $(LDFLAGS) ${LDLIBS}

clean:
rm -rf $(WORKING_DIR)

0 comments on commit d0929d4

Please sign in to comment.