-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial guppy screen code commit. code at 0.0.11-beta
- Loading branch information
ballaswag
committed
Dec 13, 2023
1 parent
a11e0b6
commit 4a5cf94
Showing
1,067 changed files
with
559,426 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[submodule "lvgl"] | ||
path = lvgl | ||
url = https://github.com/lvgl/lvgl.git | ||
[submodule "lv_drivers"] | ||
path = lv_drivers | ||
url = https://github.com/littlevgl/lv_drivers.git | ||
[submodule "libhv"] | ||
path = libhv | ||
url = https://github.com/ithewei/libhv.git | ||
[submodule "spdlog"] | ||
path = spdlog | ||
url = https://github.com/gabime/spdlog.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# | ||
# Makefile | ||
# | ||
ifdef CROSS_COMPILE | ||
CC = $(CROSS_COMPILE)gcc | ||
CXX = $(CROSS_COMPILE)g++ | ||
CPP = $(CC) -E | ||
AS = $(CROSS_COMPILE)as | ||
LD = $(CROSS_COMPILE)ld | ||
AR = $(CROSS_COMPILE)ar | ||
NM = $(CROSS_COMPILE)nm | ||
STRIP = $(CROSS_COMPILE)strip | ||
endif | ||
|
||
LVGL_DIR_NAME ?= lvgl | ||
LVGL_DIR ?= . | ||
|
||
WARNINGS := -Wall -Wshadow -Wundef -Wmissing-prototypes -Wno-discarded-qualifiers -Wall -Wextra -Wno-unused-function -Wno-error=strict-prototypes -Wpointer-arith \ | ||
-fno-strict-aliasing -Wno-error=cpp -Wuninitialized -Wmaybe-uninitialized -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess \ | ||
-Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wformat-security -Wno-ignored-qualifiers -Wno-error=pedantic \ | ||
-Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body -Wtype-limits -Wshift-negative-value -Wstack-usage=2048 \ | ||
-Wno-unused-value -Wno-unused-parameter -Wno-missing-field-initializers -Wuninitialized -Wmaybe-uninitialized -Wall -Wextra -Wno-unused-parameter \ | ||
-Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wpointer-arith -Wno-cast-qual -Wmissing-prototypes \ | ||
-Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wno-discarded-qualifiers -Wformat-security -Wno-ignored-qualifiers -Wno-sign-compare -std=c99 | ||
CFLAGS ?= -O3 -g0 -I$(LVGL_DIR)/ $(WARNINGS) -Ilibhv/include/hv -Iwpa_supplicant/src/common | ||
LDFLAGS ?= -lm -Llibhv/lib -l:libhv.a -latomic -lpthread -Lwpa_supplicant/wpa_supplicant/ -l:libwpa_client.a -lstdc++fs | ||
BIN = guppyscreen | ||
BUILD_DIR = ./build | ||
BUILD_OBJ_DIR = $(BUILD_DIR)/obj | ||
BUILD_BIN_DIR = $(BUILD_DIR)/bin | ||
|
||
prefix ?= /usr | ||
bindir ?= $(prefix)/bin | ||
|
||
#Collect the files to compile | ||
MAINSRC = $(wildcard $(LVGL_DIR)/src/*.cpp) | ||
|
||
include $(LVGL_DIR)/lvgl/lvgl.mk | ||
include $(LVGL_DIR)/lv_drivers/lv_drivers.mk | ||
|
||
CSRCS += $(wildcard $(LVGL_DIR)/assets/*.c) | ||
|
||
ifdef ZBOLT | ||
CSRCS += $(wildcard $(LVGL_DIR)/assets/zbolt/*.c) | ||
DEFINES += -D ZBOLT | ||
else | ||
CSRCS += $(wildcard $(LVGL_DIR)/assets/material/*.c) | ||
endif | ||
|
||
ifdef GUPPYSCREEN_VERSION | ||
DEFINES += -D GUPPYSCREEN_VERSION="\"${GUPPYSCREEN_VERSION}\"" | ||
endif | ||
|
||
OBJEXT ?= .o | ||
|
||
AOBJS = $(ASRCS:.S=$(OBJEXT)) | ||
COBJS = $(CSRCS:.c=$(OBJEXT)) | ||
|
||
MAINOBJ = $(MAINSRC:.cpp=$(OBJEXT)) | ||
|
||
OBJS = $(AOBJS) $(COBJS) $(MAINOBJ) | ||
TARGET = $(addprefix $(BUILD_OBJ_DIR)/, $(patsubst ./%, %, $(OBJS))) | ||
|
||
INC := -I./ui/simulator/inc/ -I./ -I./lvgl/ -I./spdlog/include | ||
LDLIBS := -lm | ||
|
||
DEFINES += -D _GNU_SOURCE -D SPDLOG_HEADER_ONLY | ||
|
||
ifdef SIMULATION | ||
DEFINES += -D LV_BUILD_TEST=0 -D SIMULATOR | ||
LDLIBS += -lSDL2 | ||
endif | ||
|
||
COMPILE_CC = $(CC) $(CFLAGS) $(INC) $(DEFINES) | ||
COMPILE_CXX = $(CC) $(CFLAGS) $(INC) $(DEFINES) | ||
|
||
## MAINOBJ -> OBJFILES | ||
|
||
all: default | ||
|
||
build_libhv: | ||
$(MAKE) -C libhv -j $(nproc) clean | ||
|
||
build_wpaclient: | ||
$(MAKE) -C wpa_supplicant/wpa_supplicant -j $(nproc) libwpa_client.a | ||
|
||
$(BUILD_OBJ_DIR)/%.o: %.cpp | ||
@mkdir -p $(dir $@) | ||
@$(COMPILE_CXX) -std=c++17 $(CFLAGS) -c $< -o $@ | ||
@echo "CXX $<" | ||
|
||
$(BUILD_OBJ_DIR)/%.o: %.c | ||
@mkdir -p $(dir $@) | ||
@$(COMPILE_CC) $(CFLAGS) -c $< -o $@ | ||
@echo "CC $<" | ||
|
||
default: $(TARGET) | ||
@mkdir -p $(dir $(BUILD_BIN_DIR)/) | ||
$(CXX) -o $(BUILD_BIN_DIR)/$(BIN) $(TARGET) $(LDFLAGS) $(LDLIBS) | ||
@echo "CXX $<" | ||
|
||
libhvclean: | ||
$(MAKE) -C libhv clean | ||
|
||
wpaclean: | ||
$(MAKE) -C wpa_supplicant/wpa_supplicant clean | ||
|
||
clean: | ||
rm -rf $(BUILD_DIR) | ||
|
||
install: | ||
install -d $(DESTDIR)$(bindir) | ||
install $(BUILD_BIN_DIR)/$(BIN) $(DESTDIR)$(bindir) | ||
|
||
uninstall: | ||
$(RM) -r $(addprefix $(DESTDIR)$(bindir)/,$(BIN)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.