54 lines
1.3 KiB
Makefile
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
|