ina260-zmq-publisher/Makefile

32 lines
733 B
Makefile
Raw Normal View History

2023-07-14 20:08:36 +02:00
CONF=$(PWD)/config.mk
include $(CONF)
2023-07-14 18:26:31 +02:00
CC="gcc"
2023-07-14 19:29:18 +02:00
CFLAGS=
2023-07-14 18:26:31 +02:00
2023-07-15 19:31:17 +02:00
all: publisher subscriber logger
2023-07-14 18:26:31 +02:00
2023-07-15 10:31:36 +02:00
publisher: src/publisher.c src/utils.c
2023-07-15 08:38:33 +02:00
$(CC) -lzmq $^ -o $@
2023-07-14 18:28:02 +02:00
2023-07-15 19:31:17 +02:00
subscriber: src/subscriber.c src/utils.c
2023-07-15 08:38:33 +02:00
$(CC) -lzmq $^ -o $@
2023-07-14 20:42:12 +02:00
2023-07-15 10:31:36 +02:00
logger: src/logger.c src/utils.c
2023-07-15 08:38:33 +02:00
$(CC) $^ -o $@
2023-07-14 18:28:02 +02:00
2023-07-15 19:31:17 +02:00
publish: publisher logger
2023-07-15 21:20:55 +02:00
[ -f pid ] && { kill $(shell cat pid); rm pid; }
for client in $$(basename -a /home/loic/registers/*); \
do \
./logger $(LOGGERS_DIR) $$client $(LOG_INTERVAL) &> logger_$${client}.log & echo $$! >> pid; \
done
2023-07-15 20:51:45 +02:00
./publisher $(LOGGERS_DIR) $(LOG_INTERVAL) $(SUBSCRIBER_ADDR) $(ZMQ_PORT) $(KEY)
2023-07-15 19:31:17 +02:00
subscribe: subscriber
2023-07-15 19:45:32 +02:00
./subscriber $(ZMQ_PORT) $(SUBSCRIBER_DIR)
2023-07-15 13:54:03 +02:00
2023-07-14 18:26:31 +02:00
clean:
2023-07-15 19:31:17 +02:00
rm -f logger subscriber publisher
2023-07-14 18:26:31 +02:00
2023-07-15 19:31:17 +02:00
.PHONY: clean publish subscribe