build: Support bitbake

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: https://github.com/lvgl/lvgl/issues/2534
Signed-off-by: Philippe Coval <philippe.coval@huawei.com>
This commit is contained in:
Philippe Coval 2021-09-06 11:08:15 +02:00
parent b8e073c11e
commit d0929d489a

View File

@ -6,7 +6,7 @@
MAKEFLAGS := -j $(shell nproc)
SRC_EXT := c
OBJ_EXT := o
CC := gcc
CC ?= gcc
SRC_DIR := ./
WORKING_DIR := ./build
@ -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)
@ -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)