mqttauditing/Makefile

33 lines
636 B
Makefile
Raw Normal View History

2020-06-17 09:06:02 +02:00
CC=gcc
CFLAGS=-Wall
LDFLAGS=-lconfig -lpthread -lpaho-mqtt3c -lmariadb
2020-06-17 09:06:02 +02:00
INST_DIR=/opt/sbin
REFCNT:=$(shell git rev-list --all --count)
VERSION:=$(shell cat VERSION)
.PHONY: all
all: mqttauditing
2020-06-19 07:46:09 +00:00
mqttauditing: mqttauditing.o mqttreceiver.o mqtttopicmatcher.o sink.o mariadbsink.o logging.o ringbuffer.o version.o
2020-06-17 09:06:02 +02:00
$(CC) -o $@ $(LDFLAGS) $^
2020-06-17 18:26:49 +02:00
tests: tests.o ringbuffer.o mqtttopicmatcher.o
2020-06-17 13:53:54 +02:00
$(CC) -o $@ $(LDFLAGS) -lcunit $^
2020-06-17 09:06:02 +02:00
version.o: version.c VERSION
$(CC) -DD_REFCNT=$(REFCNT) -DD_VERSION=\"$(VERSION)\" -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
.PHONY: clean
clean:
2020-06-17 13:53:54 +02:00
-rm -f *.o mqttauditing tests
.PHONY: test
test: tests
./tests