Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Makefile 2.62 KB
Newer Older
Michael Ott's avatar
Michael Ott committed
1
include ../config.mk
2

3
CXXFLAGS =	-O0 -g --std=c++11 -Wall -fmessage-length=0 -I$(DCDBDEPLOYPATH)/include/
4
5
6
7
8
9
10
11
OBJS =		collectagent.o \
			simplemqttserver.o \
			simplemqttserverthread.o \
			simplemqttservermessage.o \
			sensordatastore.o \
			cassandra/Cassandra.o \
			cassandra/cassandra_constants.o \
			cassandra/cassandra_types.o
12
SRC = 		$(patsubst cassandra/%,,$(OBJS:.o=.cpp))
13
LIBS =		-L$(DCDBDEPLOYPATH)/lib/ -lthrift -lssl -lcrypto -lpthread -lboost_system -lboost_thread
14
TARGET =	collectagent
15

16
SUBTARGETS = cassandra/Cassandra.h
17

18
.PHONY : check-thrift-env clean clean-cassandra-headers install
19

20
P =		$(shell cd $(DCDBDEPLOYPATH)/lib/ && pwd)
21
U =		$(shell uname)
22

23
24
25
$(TARGET): $(SRC)
	$(MAKE) cassandra/Cassandra.h
	$(MAKE) $(OBJS)
26
27
28
29
	$(CXX) -o $(TARGET) $(OBJS) $(LIBS)

all:	$(TARGET)

30
31
32
33
check-thrift-env:
	@if [ "$U" = "Darwin" ]; then \
	R=`echo $$DYLD_LIBRARY_PATH | grep $P`; \
	if [ "$$R" = "" ]; then \
Michael Ott's avatar
Michael Ott committed
34
	printf "\n******************************************\nPlease type the following line before running:\n  export DYLD_LIBRARY_PATH=$$DYLD_LIBRARY_PATH:$P\n******************************************\n"; \
35
36
	fi; \
	fi
37
38
39
	@if [ "$U" = "Linux" ]; then \
	R=`echo $$LD_LIBRARY_PATH | grep $P`; \
	if [ "$$R" = "" ]; then \
Michael Ott's avatar
Michael Ott committed
40
	printf "\n******************************************\nPlease type the following line before running:\n  export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$P\n******************************************\n"; \
41
42
43
	fi; \
	fi

44
45
46
cassandra/Cassandra.h:
	@if [ ! -e cassandra ]; then \
	printf "Building Thrift interface headers... "; \
Michael Ott's avatar
Michael Ott committed
47
	$(DCDBDEPLOYPATH)/bin/thrift --gen cpp $(DCDBDEPLOYPATH)/cassandra/interface/cassandra.thrift; \
48
49
50
	mv gen-cpp cassandra; \
	echo "Done."; \
	fi
51
	@if [ "$U" = "Linux" ]; then \
52
	echo "Fixing Thrift includes... "; \
53
54
55
56
	grep stdint cassandra/cassandra_types.h > /dev/null; \
	if [ "$$?" -eq "1" ]; then sed -i '1i#include <stdint.h>' cassandra/cassandra_types.h; fi;\
	grep stdint cassandra/Cassandra.h > /dev/null; \
	if [ "$$?" -eq "1" ]; then sed -i '1i#include <stdint.h>' cassandra/Cassandra.h; fi;\
57
	fi
58
59
60
	@# This is a really bad way of adding a line of text from a Makefile, but the differences between sed on Mac OS and Linux leave me with no options...
	@sed -e 's/#include "cassandra_types.h"/#include "cassandra_types.h"$$#undef VERSION/' cassandra/cassandra_constants.h > cassandra/cassandra_constants.h_newline
	@cat cassandra/cassandra_constants.h_newline | tr $$ '\n' > cassandra/cassandra_constants.h
Axel Auweter's avatar
Axel Auweter committed
61
	@rm cassandra/cassandra_constants.h_newline
62
63
64
65
66

clean: clean-cassandra-headers
	rm -f $(OBJS) $(TARGET)

clean-cassandra-headers:
67
	rm -rf cassandra
68
69
70

install: $(TARGET) check-thrift-env
	install $(TARGET) $(DCDBDEPLOYPATH)/bin/