Makefile 2.34 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

7
ANALYZERS = aggregator regressor job_aggregator testeranalyzer
8 9 10 11

ifeq ($(OS),Darwin)
	BACNET_PORT = bsd
	LIBEXT = dylib
12
	LIBFLAGS = -dynamiclib -install_name 
13 14 15 16 17 18 19 20 21 22 23 24 25 26
else
	BACNET_PORT = linux
	LIBEXT = so
	LIBFLAGS = -shared -Wl,-soname,
	PLUGINFLAGS = -fPIC
endif
ANALYZER_LIBS = $(foreach p,$(ANALYZERS),libdcdbanalyzer_$(p).$(LIBEXT))

all:   $(ANALYZER_LIBS)
debug: CXXFLAGS += -DDEBUG
debug: all

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

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

install_analyzer: $(ANALYZER_LIBS)
	install $^ $(DCDBDEPLOYPATH)/lib/

Alessio Netti's avatar
Alessio Netti committed
34
install_conf: $(foreach p,$(ANALYZERS),config/$(p).conf)
35 36 37 38 39 40 41 42 43
	install -m 644 $^ $(DCDBDEPLOYPATH)/etc/

install: install_analyzer
	@echo "Done with installation."
	@echo "====================================="
	@echo "To copy the configuration files type:"
	@echo "				     > make install_conf"

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

Alessio Netti's avatar
Alessio Netti committed
46
libdcdbanalyzer_aggregator.$(LIBEXT): analyzers/aggregator/AggregatorAnalyzer.o analyzers/aggregator/AggregatorConfigurator.o ../common/src/sensornavigator.o
47
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex
48
	
Alessio Netti's avatar
Alessio Netti committed
49 50 51
libdcdbanalyzer_regressor.$(LIBEXT): analyzers/regressor/RegressorAnalyzer.o analyzers/regressor/RegressorConfigurator.o ../common/src/sensornavigator.o
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex -lopencv_core -lopencv_ml
	
52 53
libdcdbanalyzer_job_aggregator.$(LIBEXT): analyzers/aggregator/AggregatorAnalyzer.o analyzers/aggregator/JobAggregatorAnalyzer.o analyzers/aggregator/JobAggregatorConfigurator.o ../common/src/sensornavigator.o
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex
54 55 56
	
libdcdbanalyzer_testeranalyzer.$(LIBEXT): analyzers/testeranalyzer/TesterAnalyzer.o analyzers/testeranalyzer/TesterAnalyzerConfigurator.o ../common/src/sensornavigator.o
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex