Makefile 1.63 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
include ../config.mk
include ../common.mk

CXXFLAGS =	-std=c++11 -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -DBOOST_NETWORK_ENABLE_HTTPS -O2 -g -Wall -Wno-unused-function -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-unused-variable -DBOOST_LOG_DYN_LINK -I$(DCDBBASEPATH)/dcdb/common/include -I$(DCDBDEPLOYPATH)/include -DVERSION=\"$(VERSION)\"
LIBS = -L$(DCDBDEPLOYPATH)/lib/ -ldl -lboost_system -lboost_thread -lboost_log_setup -lboost_log -lboost_regex -lpthread -rdynamic

ANALYZERS = average

ifeq ($(OS),Darwin)
	BACNET_PORT = bsd
	LIBEXT = dylib
	LIBFLAGS = -dynamiclib -install_name
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 34 35 36 37 38 39 40 41 42 43

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

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

install_conf: $(foreach p,global $(ANALYZERS),config/$(p).conf)
	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 46 47

libdcdbanalyzer_average.$(LIBEXT): analyzers/average/AverageAnalyzer.o analyzers/average/AverageConfigurator.o ../common/src/sensornavigator.o
	$(CXX) $(LIBFLAGS)$@ -o $@ $^ -L$(DCDBDEPLOYPATH)/lib/ -lboost_log -lboost_system -lboost_regex