# ============================================================================== # H2 CORE PLATFORM v6.3 -- LVGL + 17 OreBolt OS Modules # ============================================================================== # v1.6 changes from v6.2: # * radar.mod and wifi.mod REMOVED (merged into unified proxalarm.mod). # * proxalarm now contains bledsp (unified BLE+WiFi DSP), proxvec, # radar_ui, and proxalarm main -- absorbs all radar/wifi functionality. # * Module count: 17 .mod binaries + 1 standalone mapper daemon. # * Only proxalarm needs -lbluetooth (was: radar + proxalarm). # * bledsp_poll_wifi() stub added for future nl80211 integration. # ============================================================================== # v1.5 changes from v6.1: # * All 12 original module .c files restored from v1.3 upstream (were stubs). # * emulator_input_mapper is now FULLY INTEGRATED from addon-emulator-1.0. # Built as a standalone uinput daemon -- no LVGL linkage. Uses # hardened flags (-fstack-protector-strong, -D_FORTIFY_SOURCE=2). # ROM directories (11 systems) created at build time. # * Added -lbluetooth for radar module (BlueZ HCI). # * v1.5-patch: Added scalpel (Audio Synthesizer), vault upgraded to full # PIN auth, studio upgraded to UAC2 Mixer Console. # ============================================================================== CROSS ?= mipsel-linux-musl- CC := $(CROSS)gcc STRIP := $(CROSS)strip AR := $(CROSS)ar RANLIB := $(CROSS)ranlib ARCHFLAGS := -march=mips32r2 -mhard-float -Os -fPIC -fno-strict-aliasing \ -fno-common -Wall -Wextra -Wno-unused-parameter KERNEL_HEADERS ?= /opt/fiio-m3k-linux 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 # Extra libs for specific modules LDLIBS_BLUETOOTH := -lbluetooth # v1.6: 17 module .mod binaries (all have main() + own LVGL init) MODULES := \ vault:modules/orebolt-vault/vault.c \ nettaps:modules/orebolt-nettap/scalpel.c \ scalpel:modules/orebolt-scalpel/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 \ pauto:modules/orebolt-pauto/pauto.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 \ rfid:modules/orebolt-rfid/rfid.c \ glitch:modules/orebolt-glitch/glitch.c \ pwdb:modules/orebolt-pwdb/pwdb.c \ proxalarm:modules/orebolt-proxalarm/bledsp.c modules/orebolt-proxalarm/proxvec.c modules/orebolt-proxalarm/radar_ui.c modules/orebolt-proxalarm/proxalarm.c \ bitchat:modules/orebolt-bitchat/bitchat.c # Modules that need extra libraries BLUETOOTH_MODULES := proxalarm PTHREAD_MODULES := scalpel .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 (fork/exec broker) ------------------------------------- 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 (STANDALONE, NO LVGL) ------------------- # v1.5 FIX: The mapper is a uinput daemon, NOT an LVGL module. # It must NOT link against liblvgl.so. # v1.5-patch: Integrated from addon-emulator-1.0. Now also creates # ROM directories and installs the init script. MAPPER_SRC := modules/orebolt-emulate/emulator_input_mapper.c MAPPER_BIN := overlay/usr/bin/emulator_input_mapper ROM_BASE := overlay/data/roms ROM_SYSTEMS := nes snes gb gbc gba genesis sms gg pce atari2600 ngp mapper: $(MAPPER_BIN) rom-dirs @echo "[OK] emulator integrated (daemon + ROM dirs + init script)" $(MAPPER_BIN): $(MAPPER_SRC) @mkdir -p overlay/usr/bin @echo ">>> Building emulator_input_mapper (standalone daemon)..." $(CC) -march=mips32r2 -mhard-float -O2 -Wall -Wextra \ -fstack-protector-strong -D_FORTIFY_SOURCE=2 \ -Iinclude $< -o $@ $(STRIP) --strip-unneeded $@ rom-dirs: @for sysdir in $(ROM_SYSTEMS); do \ mkdir -p $(ROM_BASE)/$$sysdir; \ done @echo "[OK] ROM directories created: $(ROM_BASE)/{nes,snes,gb,...,ngp}" # --- 17 module .mod binaries ----------------------------------------------- modules: lvgl @for entry in $(MODULES); do \ name=$${entry%%:*}; \ src=$${entry#*:}; \ extralibs=""; \ for bm in $(BLUETOOTH_MODULES); do \ if [ "$$name" = "$$bm" ]; then extralibs="$(LDLIBS_BLUETOOTH)"; fi; \ done; \ echo ">>> Building module: $$name"; \ $(CC) $(CFLAGS) $$src -o overlay/apps/$$name.mod \ $(LDFLAGS) $(LDLIBS) $$extralibs || 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 rm -rf overlay/data/roms