PROG = xaaws SRC = xaaws.c options.c proto-http.c proto-xaal.c xaagent.c db.c db-device.c db-schema.c OBJS = $(SRC:.c=.o) CFLAGS = -Wall -g -O0 -I. LDLIBS = -L. -lxaal -lxaal_jc -lwebsockets -lcbor -ljson-c -luuid -lsodium -lcurl SHELL = /bin/bash all: $(PROG) $(PROG): $(OBJS) test: $(PROG) LD_LIBRARY_PATH+=:. ./$(PROG) -a 224.0.29.200 -p 1236 -s my_secret clean: -rm -f $(OBJS) *~ proper: clean uninstall -rm -f $(PROG) xaal-$(PROG).service Makefile.dep: $(PROG:=.c) $(SRC) $(CC) $(CFLAGS) -MM $^ > $@ include Makefile.dep .PHONY: all clean proper svnignore install uninstall status test .SUFFIXES: .service .service.in .svnignore: echo $(PROG).o $(PROG) $(OBJS) 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)