forked from trueserve/openUF
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (54 loc) · 1.75 KB
/
Makefile
File metadata and controls
65 lines (54 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# openuf — OpenWrt SDK package Makefile
include $(TOPDIR)/rules.mk
PKG_NAME := openuf
PKG_VERSION := 0.4.0
PKG_RELEASE := 1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/openuf
SECTION := net
CATEGORY := Network
TITLE := openUF — UniFi bridge daemon for OpenWrt
DEPENDS := +libmbedtls +libuci +libjson-c +kmod-tun
URL := https://github.com/openuf/openuf
endef
define Package/openuf/description
Emulates a UniFi U6 IW access point, allowing OpenWrt to be managed
by a UniFi Network controller. Supports adoption, WiFi config push
(band steering, fast roaming, WPA3, PMF), client reporting, CPU/RAM
stats, and LLDP topology.
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
TARGET_LDFLAGS += -lmbedtls -lmbedcrypto -luci -ljson-c
ifdef ENABLE_LOGGING
TARGET_CFLAGS += -DENABLE_LOGGING
endif
define Build/Compile
$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) \
-o $(PKG_BUILD_DIR)/openuf \
$(PKG_BUILD_DIR)/main.c \
$(PKG_BUILD_DIR)/config.c \
$(PKG_BUILD_DIR)/state.c \
$(PKG_BUILD_DIR)/crypto.c \
$(PKG_BUILD_DIR)/http.c \
$(PKG_BUILD_DIR)/announce.c \
$(PKG_BUILD_DIR)/inform.c \
$(PKG_BUILD_DIR)/wlan.c \
$(PKG_BUILD_DIR)/sysinfo.c \
$(PKG_BUILD_DIR)/clients.c \
$(PKG_BUILD_DIR)/lldp.c \
$(PKG_BUILD_DIR)/models.c
endef
define Package/openuf/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/openuf $(1)/usr/sbin/openuf
$(INSTALL_DIR) $(1)/etc/openuf
$(INSTALL_CONF) ./files/openuf.conf $(1)/etc/openuf/openuf.conf
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/openuf.init $(1)/etc/init.d/openuf
endef
$(eval $(call BuildPackage,openuf))