bmsd/Makefile

Mon, 18 May 2020 11:00:59 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 18 May 2020 11:00:59 +0200
changeset 679
48f8f3fce7c0
parent 678
14322825cb3d
child 680
0bb48333d133
permissions
-rw-r--r--

Added reconnecting-websocket.js to automatic reconnect the websocket if the connection is lost. Usefull for mobile devices that go to sleep after a while. Changed mon_fermenters to use websockets instead of polling. Fixed wrong temperature color ranges on the fermenter monior. Increased the websocket receive buffer to 2048. In cannot overflow, but larger messages are chunked and the application does not handle these split messages. Needs termferm 0.9.9 or newer.

# Makefile for the bmsd/bmsd.

include ../Makefile.global

SRCS		= $(wildcard *.c)
HDRS		= $(wildcard *.h)
OBJS		= $(SRCS:.c=.o)
SLIBS		= -lpthread
TARGET		= bmsd
OTHER		= Makefile

#############################################################################

.c.o:
		${CC} ${CFLAGS} ${INCLUDES} ${DEFINES} -c $<

all:		${TARGET}

bmsd:		${OBJS} ${SLIBS}
		${CC} -o bmsd ${OBJS} ${LDFLAGS} ${LIBS} ${SLIBS}

clean:
		rm -f ${TARGET} *.o *.h~ *.c~ core filelist Makefile.bak

install:	all
		${INSTALL} -d -g 314 -o 314 ${PREFIX} ${BINDIR}
		${INSTALL} -c -s -g 314 -o 314 -m 0755 bmsd ${BINDIR}

filelist:	Makefile
		BASE=`pwd`; \
		BASE=`basename $${BASE}`; \
		(for f in ${SRCS} ${HDRS} ${OTHER} ;do echo ${PACKAGE}-${VERSION}/$${BASE}/$$f; done) >filelist

depend:
	@rm -f Makefile.bak; \
	mv Makefile Makefile.bak; \
	sed -e '/^# DO NOT DELETE/,$$d' Makefile.bak >Makefile; \
	${ECHO} '# DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT' \
		>>Makefile; \
	${ECHO} '# Dependencies generated by make depend' >>Makefile; \
	for f in ${SRCS}; \
	do \
		${ECHO} "Dependencies for $$f:\c"; \
		${ECHO} "`basename $$f .c`.o:\c" >>Makefile; \
		for h in `sed -n -e \
			's/^#[ 	]*include[ 	]*"\([^"]*\)".*/\1/p' $$f`; \
		do \
			${ECHO} " $$h\c"; \
			${ECHO} " $$h\c" >>Makefile; \
		done; \
		${ECHO} " done."; \
		${ECHO} "" >>Makefile; \
	done; \
	${ECHO} '# End of generated dependencies' >>Makefile

# DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT
# Dependencies generated by make depend
mqtt.o: bms.h xutil.h mqtt.h nodes.h fermenters.h co2meters.h ispindels.h
lock.o: lock.h bms.h futil.h
nodes.o: bms.h xutil.h nodes.h mysql.h websocket.h
futil.o: bms.h futil.h
fermenters.o: bms.h xutil.h fermenters.h mysql.h websocket.h mqtt.h
co2meters.o: bms.h xutil.h co2meters.h mysql.h websocket.h
ispindels.o: bms.h xutil.h ispindels.h mysql.h nodes.h websocket.h
bms.o: bms.h xutil.h futil.h rdconfig.h lock.h mqtt.h mysql.h nodes.h websocket.h
xutil.o: bms.h xutil.h
rdconfig.o: bms.h xutil.h futil.h rdconfig.h
mysql.o: bms.h xutil.h mysql.h nodes.h
websocket.o: bms.h xutil.h websocket.h fermenters.h co2meters.h
# End of generated dependencies

mercurial