70 lines
2.4 KiB
Groff
70 lines
2.4 KiB
Groff
# ==============================================================================
|
|
# OREBOLT OS v1.4 -- Hardware Library + Payload Matrix
|
|
# ==============================================================================
|
|
# Builds liborebolt.a (static archive) from src/modules/*.c and runs
|
|
# inject_payloads.sh to regenerate the 150-payload HID macro matrix under
|
|
# overlay/data/payloads/{linux,macos,windows}/.
|
|
#
|
|
# v1.4 changes:
|
|
# * bitchat mesh module (mod_bitchat_mesh.c) added under AGPL-3.0-only.
|
|
# It is compiled with -DAGPL_BITCHAT so the source can self-identify at
|
|
# runtime for license-display purposes.
|
|
# * HARDWARE_GPIO default flipped to 0 (safe stubs). Set HARDWARE_GPIO=1
|
|
# ONLY on real H2 hardware -- the stubs are for host dev/testing.
|
|
# * Kernel headers now plumbed through from master Makefile.
|
|
# ==============================================================================
|
|
|
|
CROSS ?= mipsel-linux-musl-
|
|
CC := $(CROSS)gcc
|
|
AR := $(CROSS)ar
|
|
RANLIB := $(CROSS)ranlib
|
|
|
|
KERNEL_HEADERS ?= /opt/fiio-m3k-linux
|
|
HARDWARE_GPIO ?= 0
|
|
|
|
ARCHFLAGS := -march=mips32r2 -mhard-float -Os -fPIC -fno-strict-aliasing -Wall
|
|
INCLUDES := -Iinclude -Isrc/modules \
|
|
-I$(KERNEL_HEADERS)/include/uapi \
|
|
-I$(KERNEL_HEADERS)/arch/mips/include \
|
|
-I$(KERNEL_HEADERS)/arch/mips/include/asm/mach-jz4760
|
|
|
|
CFLAGS := $(ARCHFLAGS) $(INCLUDES) \
|
|
-DHARDWARE_GPIO=$(HARDWARE_GPIO)
|
|
|
|
# v1.4: source list aligned with src/modules/ on disk.
|
|
OREBOLT_SRCS := \
|
|
src/modules/mod_core_hid.c \
|
|
src/modules/mod_forensics.c \
|
|
src/modules/mod_panic_hardware_purge.c \
|
|
src/modules/mod_panic_purge.c \
|
|
src/modules/mod_radio_input_multiplex.c \
|
|
src/modules/mod_ui_frame_graphics.c \
|
|
src/modules/mod_bitchat_mesh.c
|
|
|
|
OREBOLT_OBJS := $(OREBOLT_SRCS:.c=.o)
|
|
|
|
.PHONY: all clean payloads
|
|
|
|
all: liborebolt.a payloads
|
|
|
|
liborebolt.a: $(OREBOLT_OBJS)
|
|
@echo ">>> Archiving liborebolt.a..."
|
|
$(AR) rcs $@ $(OREBOLT_OBJS)
|
|
$(RANLIB) $@
|
|
|
|
# Per-object rule so we can apply AGPL_BITCHAT define to the bitchat object
|
|
# only. All other objects use the project default (GPL-2.0-or-later).
|
|
src/modules/mod_bitchat_mesh.o: src/modules/mod_bitchat_mesh.c
|
|
$(CC) $(CFLAGS) -DAGPL_BITCHAT -c $< -o $@
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
payloads:
|
|
@echo ">>> Regenerating 150-payload HID matrix..."
|
|
@chmod +x inject_payloads.sh
|
|
@./inject_payloads.sh
|
|
|
|
clean:
|
|
rm -f $(OREBOLT_OBJS) liborebolt.a
|