Files
OpenUniFi/Makefile.standalone
KodaandKoda 3fcd99af1f
Build and publish release / metadata (push) Successful in 44s
Build and publish release / create-release (push) Successful in 49s
Build and publish release / publish-release (push) Canceled after 0s
Build and publish release / build (push) Canceled after 7m44s
refactor #1 + adding documentation (#36)
Reviewed-on: #36
Co-authored-by: Koda YeenBean <n122330@gmail.com>
2026-07-19 21:26:28 +01:00

54 lines
1.3 KiB
Makefile

# openuf — Makefile to compile directly on the device
#
# Requirements:
# apk add gcc make \
# libmbedtls-dev libuci-dev libjson-c-dev \
# lldpd (optional for LLDP neighbor discovery, UniFi tree view)
#
# Use:
# make -f Makefile.standalone
# make -f Makefile.standalone install
CC = gcc
CFLAGS = -Wall -Wextra -O2 -I/usr/include -Isrc -Isrc/inform -Isrc/wlan -DENABLE_LOGGING=1
LDFLAGS = -lmbedtls -lmbedcrypto -luci -ljson-c
SRCS = src/main.c \
src/config.c \
src/state.c \
src/crypto.c \
src/http.c \
src/announce.c \
src/inform/inform.c \
src/inform/payload.c \
src/inform/packet.c \
src/inform/response.c \
src/wlan/common.c \
src/wlan/uci.c \
src/wlan/radio.c \
src/wlan/provision.c \
src/wlan/legacy.c \
src/wlan/telemetry.c \
src/sysinfo.c \
src/clients.c \
src/lldp.c \
src/models.c
TARGET = openuf
all: $(TARGET)
$(TARGET): $(SRCS)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
install: $(TARGET)
install -m 755 $(TARGET) /usr/sbin/openuf
[ -f /etc/openuf/openuf.conf ] || install -D -m 644 files/openuf.conf /etc/openuf/openuf.conf
install -m 755 files/openuf.init /etc/init.d/openuf
# /etc/init.d/openuf enable
clean:
rm -f $(TARGET)
.PHONY: all install clean