forked from hallard/teleinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (33 loc) · 1.24 KB
/
Makefile
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
SHELL=/bin/sh
# Teleinfo Makefile version 1.0.8
# if you do not want teleinfo log to mysql database you can remove
# the link with mysql client library
# could be usfull because installing mysqlclient library can be quite
# complicated on NAS device such as synology and different versions
# so compile with it only is needed or if it works
# Comment these 2 following lines if you want to use mysql features
CFLAGSSQL=-DUSE_MYSQL
LIBSSQL=-lmysqlclient
# if you do not want to compile for EMONCMS publication
# remove the link to curl library
# Comment these 2 following lines if you do not want to use emoncms features
CFLAGSEMONCMS=-DUSE_EMONCMS
LIBSEMONCMS=-lcurl
# Where you want it installed when you do 'make install'
# /bin will be added to that prefix.
PREFIX=/usr/local
OBJS= teleinfo.o
all: teleinfo
# ===== Compile
teleinfo.o: teleinfo.c
$(CC) $(CFLAGS) $(CFLAGSSQL) $(CFLAGSEMONCMS) -c teleinfo.c
# ===== Link
teleinfo: teleinfo.o
$(CC) $(CFLAGS) $(CFLAGSMYSQL) $(CFLAGSEMONCMS) $(LDFLAGS) -o teleinfo teleinfo.o $(LIBSEMONCMS) $(LIBSSQL)
# ===== Install
install: teleinfo
if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
cp -f teleinfo $(PREFIX)/bin/teleinfo
chmod a+x $(PREFIX)/bin/teleinfo
clean:
rm -f *.o teleinfo