Starting from 2021-07-01, all LRZ GitLab users will be required to explicitly accept the GitLab Terms of Service. Please see the detailed information at https://doku.lrz.de/display/PUBLIC/GitLab and make sure that your projects conform to the requirements.

Makefile 4.47 KB
Newer Older
1 2
include ../config.mk

3
CXXFLAGS += -DBOOST_NETWORK_ENABLE_HTTPS \
4
           -I../common/include \
5
           -I$(DCDBDEPLOYPATH)/include
6
           
7
LIBS = -L$(DCDBDEPLOYPATH)/lib/ \
8 9 10 11
       -ldl \
       -lmosquitto \
       -lboost_system \
       -lboost_thread \
Micha Mueller's avatar
Micha Mueller committed
12
       -lboost_filesystem \
13 14 15 16 17 18 19 20 21 22 23
       -lboost_log_setup \
       -lboost_log \
       -lboost_regex \
       -lpthread \
       -lcrypto \
       -lssl \
       -rdynamic
       
OBJS = dcdbpusher.o \
       Configuration.o \
       MQTTPusher.o \
24
       RestAPI.o \
25
       PluginManager.o \
26
       ../analytics/OperatorManager.o \
27
       ../common/src/sensornavigator.o \
28
       ../common/src/globalconfiguration.o \
29
       ../common/src/logging.o \
30
       ../common/src/RESTHttpsServer.o
31 32 33 34 35 36

TARGET = dcdbpusher

ifeq ($(OS),Darwin)
	BACNET_PORT = bsd
	LIBEXT = dylib
37
	LIBFLAGS = -dynamiclib -install_name 
38
else
39
	LIBS+= -Wl,-rpath-link=$(DCDBDEPLOYPATH)/lib/
40 41 42 43 44 45 46
	BACNET_PORT = linux
	LIBEXT = so
	LIBFLAGS = -shared -Wl,-soname,
	PLUGINFLAGS = -fPIC
endif
PLUGIN_LIBS = $(foreach p,$(PLUGINS),libdcdbplugin_$(p).$(LIBEXT))

47 48
all:	$(TARGET) $(PLUGIN_LIBS)

49 50 51 52 53 54
$(TARGET): $(foreach f,$(DISTFILESPATHS),$(DCDBDEPSPATH)/$(f)/.installed) $(OBJS)
	$(CXX) -o $(TARGET) $(OBJS) $(LIBS)

debug: CXXFLAGS += -DDEBUG
debug: all

55 56 57
info:
	@echo $(PLUGINS) $(PLUGIN_LIBS)

58
clean:
59
	rm -f $(PLUGIN_LIBS) $(TARGET) $(OBJS) $(foreach p,$(PLUGINS),sensors/$(p)/*.o)
60 61 62 63 64 65

$(OBJS)	: %.o : %.cpp

install_lib: $(PLUGIN_LIBS)
	install $^ $(DCDBDEPLOYPATH)/lib/

Micha Müller's avatar
Micha Müller committed
66
install_conf: $(foreach p,dcdbpusher $(PLUGINS),config/$(p).conf)
67 68
	install -m 644 $^ $(DCDBDEPLOYPATH)/etc/

69
install: $(TARGET) install_lib
70 71 72 73 74 75 76 77 78
	install $(TARGET) $(DCDBDEPLOYPATH)/bin/
	@echo "Done with installation."
	@echo "====================================="
	@echo "To copy the configuration files type:"
	@echo "				     > make install_conf"

BACNET_SRC:= $(shell find $(DCDBDEPSPATH) -name "bacnet-stack-*" -type d)
sensors/%.o: CXXFLAGS+= $(PLUGINFLAGS)
sensors/bacnet/%.o: CXXFLAGS+= -I$(BACNET_SRC)/include -I$(BACNET_SRC)/ports/$(BACNET_PORT)
Alessio Netti's avatar
Alessio Netti committed
79
../common/src/sensornavigator.o: CXXFLAGS+= $(PLUGINFLAGS)
80 81 82 83 84

libdcdbplugin_sysfs.$(LIBEXT): sensors/sysfs/SysfsSensorGroup.o sensors/sysfs/SysfsConfigurator.o
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex

libdcdbplugin_perfevent.$(LIBEXT): sensors/perfevent/PerfSensorGroup.o sensors/perfevent/PerfeventConfigurator.o
85
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system
86

87
libdcdbplugin_ipmi.$(LIBEXT): sensors/ipmi/IPMISensorGroup.o sensors/ipmi/IPMIHost.o sensors/ipmi/IPMIConfigurator.o sensors/ipmi/LenovoXCC.o
88 89 90
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex -lfreeipmi

libdcdbplugin_pdu.$(LIBEXT): sensors/pdu/PDUSensorGroup.o sensors/pdu/PDUUnit.o sensors/pdu/PDUConfigurator.o
91
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lcrypto -lssl -lboost_log -lboost_system
92 93

libdcdbplugin_bacnet.$(LIBEXT): sensors/bacnet/BACnetSensorGroup.o sensors/bacnet/BACnetClient.o sensors/bacnet/BACnetConfigurator.o
94
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lbacnet
95 96

libdcdbplugin_snmp.$(LIBEXT): sensors/snmp/SNMPSensorGroup.o sensors/snmp/SNMPConnection.o sensors/snmp/SNMPConfigurator.o
97
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lnetsnmp -lnetsnmpagent
98 99 100 101 102

libdcdbplugin_procfs.$(LIBEXT): sensors/procfs/ProcfsSensorGroup.o sensors/procfs/ProcfsParser.o sensors/procfs/ProcfsConfigurator.o
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex

libdcdbplugin_tester.$(LIBEXT): sensors/tester/TesterSensorGroup.o sensors/tester/TesterConfigurator.o
103
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system
104 105

libdcdbplugin_gpfsmon.$(LIBEXT): sensors/gpfsmon/GpfsmonSensorGroup.o sensors/gpfsmon/GpfsmonConfigurator.o
106
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system
107

108 109
libdcdbplugin_opa.$(LIBEXT): sensors/opa/OpaSensorGroup.o sensors/opa/OpaConfigurator.o
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lopamgt -lssl
110

111 112 113
libdcdbplugin_msr.$(LIBEXT): sensors/msr/MSRSensorGroup.o sensors/msr/MSRConfigurator.o
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system

114
libdcdbplugin_caliper.$(LIBEXT): sensors/caliper/CaliperSensorGroup.o sensors/caliper/CaliperConfigurator.o
115
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system