forked from trueserve/openUF
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile.standalone
More file actions
49 lines (40 loc) · 1.09 KB
/
Makefile.standalone
File metadata and controls
49 lines (40 loc) · 1.09 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
# openuf — Makefile para compilar directamente en el dispositivo
#
# Requisitos:
# opkg install gcc make \
# libmbedtls-dev libuci-dev libjson-c-dev \
# lldpd (opcional, para leer vecinos LLDP)
#
# Uso:
# make -f Makefile.standalone
# make -f Makefile.standalone install
CC = gcc
CFLAGS = -Wall -Wextra -O2 -I/usr/include
LDFLAGS = -lmbedtls -lmbedcrypto -luci -ljson-c
ifdef ENABLE_LOGGING
CFLAGS += -DENABLE_LOGGING
endif
SRCS = src/main.c \
src/config.c \
src/state.c \
src/crypto.c \
src/http.c \
src/announce.c \
src/inform.c \
src/wlan.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