113 lines
4.6 KiB
Groff
113 lines
4.6 KiB
Groff
# ==============================================================================
|
|
# H2 CORE PLATFORM v6.1 -- LVGL + 16 OreBolt OS Modules
|
|
# ==============================================================================
|
|
# v1.4: bumped from v6.0 to v6.1 to reflect the X1000E SoC correction and
|
|
# the FiiO M3K kernel-headers integration. All -I paths now point at
|
|
# $(KERNEL_HEADERS)/include/uapi and arch/mips/include.
|
|
# ==============================================================================
|
|
|
|
CROSS ?= mipsel-linux-musl-
|
|
CC := $(CROSS)gcc
|
|
STRIP := $(CROSS)strip
|
|
AR := $(CROSS)ar
|
|
RANLIB := $(CROSS)ranlib
|
|
|
|
# v1.4: target the actual H2 SoC. -march=mips32r2 matches the X1000E core
|
|
# (the JZ4760 family). -mhard-float is required -- the X1000E has an FPU.
|
|
ARCHFLAGS := -march=mips32r2 -mhard-float -Os -fPIC -fno-strict-aliasing \
|
|
-fno-common -Wall -Wextra -Wno-unused-parameter
|
|
|
|
# v1.4: kernel headers root comes from the master Makefile (or env).
|
|
KERNEL_HEADERS ?= /opt/fiio-m3k-linux
|
|
|
|
# Header search path:
|
|
# 1. workspace-local include/ (project headers: h2_ui.h, log_manager.h)
|
|
# 2. $(KERNEL_HEADERS)/include/uapi (Linux uapi -- clean, GPL)
|
|
# 3. $(KERNEL_HEADERS)/include (kernel-internal headers used by some drivers)
|
|
# 4. $(KERNEL_HEADERS)/arch/mips/include
|
|
# 5. $(KERNEL_HEADERS)/arch/mips/include/asm/mach-jz4760 (X1000E SoC headers)
|
|
# 6. lvgl/ and lv_drivers/ (cloned by build.sh Phase 5)
|
|
INCLUDES := -Iinclude \
|
|
-I$(KERNEL_HEADERS)/include/uapi \
|
|
-I$(KERNEL_HEADERS)/include \
|
|
-I$(KERNEL_HEADERS)/arch/mips/include \
|
|
-I$(KERNEL_HEADERS)/arch/mips/include/asm/mach-jz4760 \
|
|
-Ilvgl -Ilvgl/src -Ilv_drivers
|
|
|
|
CFLAGS := $(ARCHFLAGS) $(INCLUDES) -DLV_CONF_INCLUDE_SIMPLE=1 \
|
|
-DLV_LVGL_H_INCLUDE_SIMPLE=1
|
|
LDFLAGS := -Loverlay/usr/lib -Wl,-rpath,/usr/lib
|
|
LDLIBS := -llvgl -lm -ldl -lpthread
|
|
|
|
# v1.4: 16 modules (was 13 in SHA256SUMS, advertised as 16 in master Makefile
|
|
# and PREREQUISITES). v1.4 reconciles to 16.
|
|
MODULES := \
|
|
vault:modules/orebolt-vault/vault.c \
|
|
nettap:modules/orebolt-nettap/scalpel.c \
|
|
deploy:modules/orebolt-deploy/deploy.c \
|
|
studio:modules/orebolt-studio/studio.c \
|
|
probe:modules/orebolt-probe/probe.c \
|
|
vterm:modules/orebolt-vterm/vterm.c \
|
|
radar:modules/orebolt-radar/noise_radar.c \
|
|
ducky:modules/orebolt-ducky/ducky.c \
|
|
extract:modules/orebolt-extract/extract.c \
|
|
noise:modules/orebolt-noise/noise.c \
|
|
reset:modules/orebolt-reset/reset.c \
|
|
emulate:modules/orebolt-emulate/emulator.c \
|
|
emulator_input_mapper:modules/orebolt-emulate/emulator_input_mapper.c \
|
|
rfid:modules/orebolt-rfid/rfid.c \
|
|
wifi:modules/orebolt-wifi/wifi.c \
|
|
glitch:modules/orebolt-glitch/glitch.c \
|
|
pwdb:modules/orebolt-pwdb/pwdb.c \
|
|
bitchat:modules/orebolt-bitchat/bitchat.c
|
|
|
|
.PHONY: all clean lvgl modules launcher mapper
|
|
|
|
all: lvgl launcher mapper modules
|
|
|
|
# --- LVGL shared library -----------------------------------------------------
|
|
lvgl:
|
|
@if [ ! -d lvgl/src ]; then \
|
|
echo "[-] lvgl/src not found. Run build.sh Phase 5 first, or:"; \
|
|
echo " git clone --depth 1 -b v8.3.11 https://github.com/lvgl/lvgl.git"; \
|
|
echo " git clone --depth 1 -b v8.3.0 https://github.com/lvgl/lv_drivers.git"; \
|
|
exit 1; \
|
|
fi
|
|
@echo ">>> Building liblvgl.so (v8.3.11)..."
|
|
$(CC) $(CFLAGS) -shared -fPIC \
|
|
lvgl/src/*.c lvgl/src/draw/*.c lvgl/src/draw/sw/*.c \
|
|
lvgl/src/font/*.c lvgl/src/misc/*.c lvgl/src/widgets/*.c \
|
|
lvgl/src/extra/*.c lvgl/src/extra/layouts/*.c lvgl/src/extra/themes/*.c \
|
|
-o overlay/usr/lib/liblvgl.so
|
|
$(STRIP) overlay/usr/lib/liblvgl.so
|
|
|
|
# --- Master launcher ---------------------------------------------------------
|
|
launcher: lvgl
|
|
@echo ">>> Building h2_test launcher..."
|
|
$(CC) $(CFLAGS) main.c -o overlay/usr/bin/h2_test $(LDFLAGS) $(LDLIBS)
|
|
$(STRIP) overlay/usr/bin/h2_test
|
|
|
|
# --- Emulator input mapper daemon --------------------------------------------
|
|
mapper: lvgl
|
|
@echo ">>> Building emulator_input_mapper..."
|
|
$(CC) $(CFLAGS) modules/orebolt-emulate/emulator_input_mapper.c \
|
|
-o overlay/usr/bin/emulator_input_mapper $(LDFLAGS) $(LDLIBS)
|
|
$(STRIP) overlay/usr/bin/emulator_input_mapper
|
|
|
|
# --- 16 module binaries ------------------------------------------------------
|
|
modules: lvgl
|
|
@for entry in $(MODULES); do \
|
|
name=$${entry%%:*}; \
|
|
src=$${entry#*:}; \
|
|
echo ">>> Building module: $$name"; \
|
|
$(CC) $(CFLAGS) $$src -o overlay/apps/$$name.mod \
|
|
$(LDFLAGS) $(LDLIBS) || exit 1; \
|
|
$(STRIP) overlay/apps/$$name.mod; \
|
|
done
|
|
|
|
clean:
|
|
rm -f overlay/usr/lib/liblvgl.so
|
|
rm -f overlay/usr/bin/h2_test
|
|
rm -f overlay/usr/bin/emulator_input_mapper
|
|
rm -f overlay/apps/*.mod
|