-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathMake.config
117 lines (89 loc) · 2.45 KB
/
Make.config
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Make.config
#
# See the README file for copyright information and how to reach the author.
#
-include Make.user
TARGET = p4d
CLASS = P4d
# NAME: used for DB (name, user and password)
NAME = p4
W1TARGET = w1mqtt
CMDTARGET = p4
CHARTTARGET = dbchart
PREFIX ?= /usr/local
BINDEST = $(DESTDIR)$(PREFIX)/bin
_BINDEST = $(PREFIX)/bin
CONFDEST = $(DESTDIR)/etc/$(TARGET)
WEBDEST = $(DESTDIR)/var/lib/$(TARGET)
SYSTEMDDEST = $(DESTDIR)/etc/systemd/system
AVR_DEVICE = /dev/ttyS0
DEBUG = 1
# USE_CLANG = 1
# -------------------
# internals
CPPCHECK_SUPPRESS=--suppress=unmatchedSuppression --suppress=cstyleCast --suppress=missingInclude
SQLCFG = mariadb_config
ifdef MYSQL
SQLCFG = mysql_config
endif
ifdef USE_CLANG
CPP = clang++
else
CPP = g++
endif
doCompile = $(CPP) -c $(CFLAGS) $(DEFINES)
doLink = $(CPP) $(LFLAGS)
doLib = ar -rs
PLGSRCDIR = ./PLUGINS
TMPDIR = $(DESTDIR)/tmp
#USELIBXML = 1
#USECURL = 1
#USEJPEG = 1
USES = -DUSEUUID -DUSEMD5 -DUSELIBARCHIVE -DUSEJSON -DUSEGUNZIP -DUSEDB
DEFINES += -std=c++2a -D_GNU_SOURCE -DTARGET='"$(TARGET)"' -DCLASS='$(CLASS)' -DNAME='"$(NAME)"' -DLOG_PREFIX='""' $(USES)
DEFINES += -DBIN_PATH='"$(_BINDEST)"'
ifdef POOL
DEFINES += -D_POOL
endif
ifdef WOMO
DEFINES += -D_WOMO
endif
ifdef NO_RASPBERRY_PI
DEFINES += -D_NO_RASPBERRY_PI_
endif
WIRINGPI ?= no
# RASPI
ifneq (,$(wildcard /usr/lib/libwiringPi.so))
WIRINGPI = yes
endif
#ODROID
ifneq (,$(wildcard /usr/lib/aarch64-linux-gnu/libwiringPi.so))
WIRINGPI = yes
DEFINES += -I/usr/include/wiringpi2
endif
ifeq ($(WIRINGPI),yes)
LIBS += -lwiringPi
else
DEFINES += -D_NO_RASPBERRY_PI_
endif
ifdef USELIBXML
CFLAGS += $(shell xml2-config --cflags)
LIBS += $(shell xml2-config --libs)
endif
LIBS += $(shell pkg-config --libs libwebsockets | sed -e 's/ -lwebsockets/ -l:libwebsockets.a/g')
#LIBS += $(shell pkg-config --libs libwebsockets)
LIBS += $(shell pkg-config --cflags --libs jansson)
LIBS += -lssl -lz -lcap
ifdef DEBUG
CFLAGS += -ggdb -O0
endif
CFLAGS += -pthread -fPIC -std=c++17 -Wall -Wreturn-type -Wformat -pedantic -Wunused-variable -Wunused-label \
-Wunused-value -Wunused-function -Wno-long-long -Wno-unused-parameter -Wno-deprecated-enum-float-conversion -Wno-deprecated-enum-enum-conversion \
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
ifdef USE_CLANG
CFLAGS += -x c++
else
CFLAGS += -Wno-psabi
endif
%.o: %.c
$(doCompile) -o $@ $<