PROG = xaafloor SRC = $(PROG).c sensfloor.c OBJS = $(SRC:.c=.o) CFLAGS = -Wall -I. -g -O0 LDLIBS = -L. -lxaal -lcbor -luuid -lsodium SHELL = /bin/bash all: $(PROG) $(PROG): $(OBJS) clean: -rm -f *.o *~ proper: clean uninstall -rm -f $(PROG) xaal-$(PROG).service test: @echo Try: @echo make test_tcp @echo make test_usb @echo make test_file test_tcp: $(PROG) LD_LIBRARY_PATH+=:. ./$(PROG) -S floor1.enstb.org -P 5000 -a 224.0.29.200 -p 1236 -s xaal # LD_LIBRARY_PATH+=:. ./$(PROG) -S 192.168.5.5 -P 5000 -a 224.0.29.200 -p 1236 -s my_secret test_usb: $(PROG) LD_LIBRARY_PATH+=:. ./$(PROG) -D /dev/ttyUSB0 -a 224.0.29.200 -p 1236 -s my_secret test_file: $(PROG) export LD_LIBRARY_PATH=:. ; pv -L 80 -q ./floor_alert.dump | ./$(PROG) -F - -a 224.0.29.200 -p 1236 -s my_secret Makefile.dep: $(PROG).c $(CC) $(CFLAGS) -MM $^ > $@ include Makefile.dep .PHONY: all clean proper install uninstall svnignore test test_tcp test_usb test_file .SUFFIXES: .service .service.in .svnignore: echo $(PROG).o $(PROG) xaal-$(PROG).service | tr ' ' '\012' > $@ svnignore: .svnignore svn propset svn:ignore -F $< . install: xaal-$(PROG).service $(PROG) sudo systemctl --system --now enable $(PWD)/$< xaal-%.service: %.service.in envsubst < $< > $@ uninstall: -if systemctl --system --quiet is-enabled xaal-$(PROG) &>/dev/null ; then \ sudo systemctl --system --now disable xaal-$(PROG) ; \ fi status: -sudo systemctl --system --no-pager -l status xaal-$(PROG)