Makefile 3.19 KB
Newer Older
1
include ../config.mk
2
#include ../common.mk
3

Alessio Netti's avatar
Alessio Netti committed
4
CXXFLAGS += -DBOOST_NETWORK_ENABLE_HTTPS -I../common/include -I$(DCDBDEPLOYPATH)/include -I$(DCDBDEPLOYPATH)/include/opencv4
5
LIBS = -L../lib -L$(DCDBDEPLOYPATH)/lib/ -ldl -lboost_system -lboost_thread -lboost_log_setup -lboost_log -lboost_regex -lpthread -rdynamic
6

Carla Guillen's avatar
Carla Guillen committed
7
OPERATORS = aggregator regressor job_aggregator testeroperator filesink smucngperf persystsql
8 9 10 11

ifeq ($(OS),Darwin)
	BACNET_PORT = bsd
	LIBEXT = dylib
12
	LIBFLAGS = -dynamiclib -install_name 
13 14 15 16 17 18
else
	BACNET_PORT = linux
	LIBEXT = so
	LIBFLAGS = -shared -Wl,-soname,
	PLUGINFLAGS = -fPIC
endif
19
OPERATOR_LIBS = $(foreach p,$(OPERATORS),libdcdboperator_$(p).$(LIBEXT))
20

21
all:   $(OPERATOR_LIBS)
22 23 24 25
debug: CXXFLAGS += -DDEBUG
debug: all

clean:
26
	rm -f $(OPERATOR_LIBS) $(shell find . -name "*.o")
Alessio Netti's avatar
Alessio Netti committed
27
	rm -f ../common/src/sensornavigator.o
28 29 30

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

31
install_operator: $(OPERATOR_LIBS)
32 33
	install $^ $(DCDBDEPLOYPATH)/lib/

34
install_conf: $(foreach p,$(OPERATORS),config/$(p).conf)
35 36
	install -m 644 $^ $(DCDBDEPLOYPATH)/etc/

37
install: install_operator
38 39 40 41 42
	@echo "Done with installation."
	@echo "====================================="
	@echo "To copy the configuration files type:"
	@echo "				     > make install_conf"

43
operators/%.o: CXXFLAGS+= $(PLUGINFLAGS)
Alessio Netti's avatar
Alessio Netti committed
44
../common/src/sensornavigator.o: CXXFLAGS+= $(PLUGINFLAGS)
45

46
libdcdboperator_aggregator.$(LIBEXT): operators/aggregator/AggregatorOperator.o operators/aggregator/AggregatorConfigurator.o ../common/src/sensornavigator.o
47
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex
48
	
49
libdcdboperator_regressor.$(LIBEXT): operators/regressor/RegressorOperator.o operators/regressor/RegressorConfigurator.o ../common/src/sensornavigator.o
Alessio Netti's avatar
Alessio Netti committed
50 51
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex -lopencv_core -lopencv_ml
	
52
libdcdboperator_job_aggregator.$(LIBEXT): operators/aggregator/AggregatorOperator.o operators/aggregator/JobAggregatorOperator.o operators/aggregator/JobAggregatorConfigurator.o ../common/src/sensornavigator.o
53
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex
54
	
55
libdcdboperator_testeroperator.$(LIBEXT): operators/testeroperator/TesterOperator.o operators/testeroperator/TesterOperatorConfigurator.o ../common/src/sensornavigator.o
56
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex
57
	
58
libdcdboperator_filesink.$(LIBEXT): operators/filesink/FilesinkOperator.o operators/filesink/FilesinkConfigurator.o ../common/src/sensornavigator.o
59
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex
60

Carla Guillen's avatar
Carla Guillen committed
61
libdcdboperator_smucngperf.$(LIBEXT): operators/smucngperf/SMUCNGPerfOperator.o operators/smucngperf/SMUCNGPerfConfigurator.o operators/smucngperf/SKXPMUMetrics.o ../common/src/sensornavigator.o
62
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex
Carla Guillen's avatar
Carla Guillen committed
63

64
libdcdboperator_persystsql.$(LIBEXT): operators/persystsql/PerSystSqlOperator.o operators/persystsql/PerSystSqlConfigurator.o operators/persystsql/PerSystDB.o ../common/src/sensornavigator.o
Carla Guillen's avatar
Carla Guillen committed
65 66
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex