Add argument parser dependency and adjust Makefile to allow C++
This commit is contained in:
parent
f519ba2140
commit
fe27f89b53
5
.gitmodules
vendored
5
.gitmodules
vendored
@ -1,3 +1,6 @@
|
||||
[submodule "lvgl"]
|
||||
path = lvgl
|
||||
path = deps/lvgl
|
||||
url = https://github.com/lvgl/lvgl.git
|
||||
[submodule "deps/argparse"]
|
||||
path = deps/argparse
|
||||
url = https://gitea.cam123.dev/CameronReed/Cpp-Argument-Parser.git
|
||||
|
28
Makefile
28
Makefile
@ -1,8 +1,10 @@
|
||||
include lv_dirs.mk
|
||||
|
||||
LVGL_PATH ?= lvgl
|
||||
SRC_DIRS := src src/fbd src/lvgl_port src/ui src/fonts $(LVGL_DIRS)
|
||||
INC_DIRS := inc inc/fbd inc/lvgl_port inc/ui . $(LVGL_PATH)
|
||||
DEPS_DIR := deps
|
||||
LVGL_PATH ?= $(DEPS_DIR)/lvgl
|
||||
ARGS_DIR := $(DEPS_DIR)/argparse
|
||||
SRC_DIRS := src src/fbd src/lvgl_port src/ui src/fonts $(LVGL_DIRS) $(ARGS_DIR)/Src
|
||||
INC_DIRS := inc inc/fbd inc/lvgl_port inc/ui $(DEPS_DIR) $(LVGL_PATH) $(ARGS_DIR)/Inc
|
||||
|
||||
|
||||
BIN_NAME := calzone_ui
|
||||
@ -13,19 +15,21 @@ INSTALL_DIR ?= /usr/local/bin
|
||||
|
||||
INCLUDES := $(addprefix -I, $(INC_DIRS))
|
||||
C_SOURCES := $(foreach dir, $(SRC_DIRS), $(wildcard $(dir)/*.c))
|
||||
CXX_SOURCES := $(foreach dir, $(SRC_DIRS), $(wildcard $(dir)/*.cpp))
|
||||
|
||||
|
||||
OFILES := $(addprefix $(OFILE_DIR)/, $(notdir $(C_SOURCES:.c=.o)))
|
||||
|
||||
OFILES := $(addprefix $(OFILE_DIR)/, $(notdir $(C_SOURCES:.c=.o) $(CXX_SOURCES:.cpp=.o)))
|
||||
|
||||
|
||||
OPT := -O2
|
||||
CPPFLAGS := $(INCLUDES) -MMD
|
||||
CFLAGS := $(OPT) -Wall -Wextra -Wpedantic
|
||||
CXXFLAGS := $(OPT) -std=c++17 -Wall -Wextra -Wpedantic
|
||||
|
||||
|
||||
LDFLAGS :=
|
||||
LDLIBS := -pthread
|
||||
LD := $(CC)
|
||||
|
||||
|
||||
DEPENDS := $(OFILES:.o=.d)
|
||||
@ -34,6 +38,12 @@ DEPENDS := $(OFILES:.o=.d)
|
||||
DIRS := $(BUILD_DIR) $(OFILE_DIR) $(PCH_DIR)
|
||||
|
||||
|
||||
ifeq ($(strip $(CXX_SOURCES)),)
|
||||
LD := $(CC)
|
||||
else
|
||||
LD := $(CXX)
|
||||
endif
|
||||
|
||||
|
||||
.PHONY: all run clean
|
||||
|
||||
@ -41,7 +51,7 @@ all: $(BUILD_DIR)/$(BIN_NAME)
|
||||
|
||||
run: all
|
||||
@printf "[ EXEC ] $@\n"
|
||||
@$(BUILD_DIR)/$(BIN_NAME)
|
||||
-@$(BUILD_DIR)/$(BIN_NAME)
|
||||
|
||||
install: all | $(INSTALL_DIR)
|
||||
@printf "[ CP ] $(BUILD_DIR)/$(BIN_NAME) -> $(INSTALL_DIR)/$(BIN_NAME)\r"
|
||||
@ -66,9 +76,15 @@ $(OFILE_DIR)/%.o: %.c | $(OFILE_DIR)
|
||||
@$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
||||
@printf "[ \e[32mCC\e[0m ]\n"
|
||||
|
||||
$(OFILE_DIR)/%.o: %.cpp | $(OFILE_DIR)
|
||||
@printf "[ CXX ] $@\r"
|
||||
@$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
|
||||
@printf "[ \e[32mCXX\e[0m ]\n"
|
||||
|
||||
|
||||
$(DIRS) $(INSTALL_DIR):
|
||||
@mkdir -p $@
|
||||
|
||||
|
||||
vpath %.c $(SRC_DIRS)
|
||||
vpath %.cpp $(SRC_DIRS)
|
||||
|
1
deps/argparse
vendored
Submodule
1
deps/argparse
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 1382930021be5955cf683de753e933e59cfa75ed
|
0
lv_conf.h → deps/lv_conf.h
vendored
0
lv_conf.h → deps/lv_conf.h
vendored
0
lvgl → deps/lvgl
vendored
0
lvgl → deps/lvgl
vendored
@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
LVGL_PATH="lvgl"
|
||||
LVGL_PATH="deps/lvgl"
|
||||
OUT_FILE="lv_dirs.mk"
|
||||
|
||||
printf "LVGL_PATH := ${LVGL_PATH}\n\n" > "${OUT_FILE}"
|
||||
|
||||
printf "LVGL_DIRS := " >> "${OUT_FILE}"
|
||||
find lvgl/src -type d | tr "\n" " " >> "${OUT_FILE}"
|
||||
find "${LVGL_PATH}/src" -type d | tr "\n" " " >> "${OUT_FILE}"
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
LVGL_PATH := lvgl
|
||||
LVGL_PATH := deps/lvgl
|
||||
|
||||
LVGL_DIRS := lvgl/src lvgl/src/layouts lvgl/src/layouts/grid lvgl/src/layouts/flex lvgl/src/display lvgl/src/indev lvgl/src/widgets lvgl/src/widgets/spinbox lvgl/src/widgets/keyboard lvgl/src/widgets/checkbox lvgl/src/widgets/tabview lvgl/src/widgets/led lvgl/src/widgets/image lvgl/src/widgets/line lvgl/src/widgets/tileview lvgl/src/widgets/chart lvgl/src/widgets/switch lvgl/src/widgets/buttonmatrix lvgl/src/widgets/arc lvgl/src/widgets/span lvgl/src/widgets/list lvgl/src/widgets/slider lvgl/src/widgets/spinner lvgl/src/widgets/label lvgl/src/widgets/menu lvgl/src/widgets/objx_templ lvgl/src/widgets/animimage lvgl/src/widgets/button lvgl/src/widgets/roller lvgl/src/widgets/calendar lvgl/src/widgets/textarea lvgl/src/widgets/win lvgl/src/widgets/scale lvgl/src/widgets/canvas lvgl/src/widgets/bar lvgl/src/widgets/msgbox lvgl/src/widgets/dropdown lvgl/src/widgets/table lvgl/src/widgets/imagebutton lvgl/src/core lvgl/src/themes lvgl/src/themes/mono lvgl/src/themes/default lvgl/src/themes/simple lvgl/src/stdlib lvgl/src/stdlib/micropython lvgl/src/stdlib/builtin lvgl/src/stdlib/clib lvgl/src/stdlib/rtthread lvgl/src/draw lvgl/src/draw/renesas lvgl/src/draw/renesas/dave2d lvgl/src/draw/sdl lvgl/src/draw/sw lvgl/src/draw/sw/arm2d lvgl/src/draw/sw/blend lvgl/src/draw/sw/blend/arm2d lvgl/src/draw/sw/blend/neon lvgl/src/draw/nxp lvgl/src/draw/nxp/vglite lvgl/src/draw/nxp/pxp lvgl/src/draw/vg_lite lvgl/src/others lvgl/src/others/fragment lvgl/src/others/vg_lite_tvg lvgl/src/others/gridnav lvgl/src/others/snapshot lvgl/src/others/ime lvgl/src/others/sysmon lvgl/src/others/file_explorer lvgl/src/others/observer lvgl/src/others/imgfont lvgl/src/others/monkey lvgl/src/misc lvgl/src/misc/cache lvgl/src/osal lvgl/src/font lvgl/src/tick lvgl/src/drivers lvgl/src/drivers/display lvgl/src/drivers/display/tft_espi lvgl/src/drivers/display/lcd lvgl/src/drivers/display/st7796 lvgl/src/drivers/display/ili9341 lvgl/src/drivers/display/drm lvgl/src/drivers/display/st7789 lvgl/src/drivers/display/st7735 lvgl/src/drivers/display/fb lvgl/src/drivers/evdev lvgl/src/drivers/windows lvgl/src/drivers/x11 lvgl/src/drivers/sdl lvgl/src/drivers/nuttx lvgl/src/libs lvgl/src/libs/fsdrv lvgl/src/libs/libpng lvgl/src/libs/lodepng lvgl/src/libs/qrcode lvgl/src/libs/barcode lvgl/src/libs/lz4 lvgl/src/libs/libjpeg_turbo lvgl/src/libs/thorvg lvgl/src/libs/tiny_ttf lvgl/src/libs/gif lvgl/src/libs/rlottie lvgl/src/libs/bin_decoder lvgl/src/libs/bmp lvgl/src/libs/ffmpeg lvgl/src/libs/freetype lvgl/src/libs/rle lvgl/src/libs/tjpgd
|
||||
LVGL_DIRS := deps/lvgl/src deps/lvgl/src/layouts deps/lvgl/src/layouts/grid deps/lvgl/src/layouts/flex deps/lvgl/src/display deps/lvgl/src/indev deps/lvgl/src/widgets deps/lvgl/src/widgets/spinbox deps/lvgl/src/widgets/keyboard deps/lvgl/src/widgets/checkbox deps/lvgl/src/widgets/tabview deps/lvgl/src/widgets/led deps/lvgl/src/widgets/image deps/lvgl/src/widgets/line deps/lvgl/src/widgets/tileview deps/lvgl/src/widgets/chart deps/lvgl/src/widgets/switch deps/lvgl/src/widgets/buttonmatrix deps/lvgl/src/widgets/arc deps/lvgl/src/widgets/span deps/lvgl/src/widgets/list deps/lvgl/src/widgets/slider deps/lvgl/src/widgets/spinner deps/lvgl/src/widgets/label deps/lvgl/src/widgets/menu deps/lvgl/src/widgets/objx_templ deps/lvgl/src/widgets/animimage deps/lvgl/src/widgets/button deps/lvgl/src/widgets/roller deps/lvgl/src/widgets/calendar deps/lvgl/src/widgets/textarea deps/lvgl/src/widgets/win deps/lvgl/src/widgets/scale deps/lvgl/src/widgets/canvas deps/lvgl/src/widgets/bar deps/lvgl/src/widgets/msgbox deps/lvgl/src/widgets/dropdown deps/lvgl/src/widgets/table deps/lvgl/src/widgets/imagebutton deps/lvgl/src/core deps/lvgl/src/themes deps/lvgl/src/themes/mono deps/lvgl/src/themes/default deps/lvgl/src/themes/simple deps/lvgl/src/stdlib deps/lvgl/src/stdlib/micropython deps/lvgl/src/stdlib/builtin deps/lvgl/src/stdlib/clib deps/lvgl/src/stdlib/rtthread deps/lvgl/src/draw deps/lvgl/src/draw/renesas deps/lvgl/src/draw/renesas/dave2d deps/lvgl/src/draw/sdl deps/lvgl/src/draw/sw deps/lvgl/src/draw/sw/arm2d deps/lvgl/src/draw/sw/blend deps/lvgl/src/draw/sw/blend/arm2d deps/lvgl/src/draw/sw/blend/neon deps/lvgl/src/draw/nxp deps/lvgl/src/draw/nxp/vglite deps/lvgl/src/draw/nxp/pxp deps/lvgl/src/draw/vg_lite deps/lvgl/src/others deps/lvgl/src/others/fragment deps/lvgl/src/others/vg_lite_tvg deps/lvgl/src/others/gridnav deps/lvgl/src/others/snapshot deps/lvgl/src/others/ime deps/lvgl/src/others/sysmon deps/lvgl/src/others/file_explorer deps/lvgl/src/others/observer deps/lvgl/src/others/imgfont deps/lvgl/src/others/monkey deps/lvgl/src/misc deps/lvgl/src/misc/cache deps/lvgl/src/osal deps/lvgl/src/font deps/lvgl/src/tick deps/lvgl/src/drivers deps/lvgl/src/drivers/display deps/lvgl/src/drivers/display/tft_espi deps/lvgl/src/drivers/display/lcd deps/lvgl/src/drivers/display/st7796 deps/lvgl/src/drivers/display/ili9341 deps/lvgl/src/drivers/display/drm deps/lvgl/src/drivers/display/st7789 deps/lvgl/src/drivers/display/st7735 deps/lvgl/src/drivers/display/fb deps/lvgl/src/drivers/evdev deps/lvgl/src/drivers/windows deps/lvgl/src/drivers/x11 deps/lvgl/src/drivers/sdl deps/lvgl/src/drivers/nuttx deps/lvgl/src/libs deps/lvgl/src/libs/fsdrv deps/lvgl/src/libs/libpng deps/lvgl/src/libs/lodepng deps/lvgl/src/libs/qrcode deps/lvgl/src/libs/barcode deps/lvgl/src/libs/lz4 deps/lvgl/src/libs/libjpeg_turbo deps/lvgl/src/libs/thorvg deps/lvgl/src/libs/tiny_ttf deps/lvgl/src/libs/gif deps/lvgl/src/libs/rlottie deps/lvgl/src/libs/bin_decoder deps/lvgl/src/libs/bmp deps/lvgl/src/libs/ffmpeg deps/lvgl/src/libs/freetype deps/lvgl/src/libs/rle deps/lvgl/src/libs/tjpgd
|
Loading…
Reference in New Issue
Block a user