PROGS = splsensor beep splog CFLAGS = -Wall -I. -g -O0 LD_xAAL = -L. -lxaal -lcbor -luuid -lsodium LD_SND = -lasound -lm -lfftw3f SHELL = /bin/bash all: $(PROGS) splsensor: splsensor.o spl.o $(LINK.o) $^ $(LD_xAAL) $(LD_SND) -o $@ beep: beep.o spl.o $(LINK.o) $^ $(LD_SND) -o $@ splog: splog.o $(LINK.o) $^ $(LD_xAAL) -o $@ clean: -rm -f *.o *~ proper: clean uninstall -rm -f $(PROGS) xaal-$(PROG).service test: splsensor splog -killall splsensor -LD_LIBRARY_PATH+=:. trap 'killall splsensor' SIGINT; ./splsensor -a 224.0.29.200 -p 1236 -s my_secret $(SPLARGS) & ./splog -a 224.0.29.200 -p 1236 -s my_secret Makefile.dep: splsensor.c beep.c spl.c $(CC) $(CFLAGS) -MM $^ > $@ include Makefile.dep .svnignore: echo $(PROGS:=.o) $(PROGS) xaal-splsensor.service | tr ' ' '\012' > $@ svnignore: .svnignore svn propset svn:ignore -F $< . .PHONY: all clean proper install uninstall svnignore test .SUFFIXES: .service .service.in install: xaal-splsensor.service splsensor sudo systemctl --system --now enable $(PWD)/$< xaal-%.service: %.service.in envsubst < $< > $@ uninstall: -if systemctl --system --quiet is-enabled xaal-splsensor &>/dev/null ; then \ sudo systemctl --system --now disable xaal-splsensor ; \ fi status: -sudo systemctl --system --no-pager -l status xaal-splsensor