Commit 12c6c6b2 authored by Michael Ott's avatar Michael Ott
Browse files

Make proper install targets for libs and conf files

parent c4e52efc
......@@ -14,26 +14,25 @@ include $(DCDBCOREPATH)/common.mk
CXXFLAGS = -std=c++11 -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -O2 -g -Wall -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-variable -DBOOST_LOG_DYN_LINK -I$(DCDBBASEPATH)/dcdb/include -I$(DCDBDEPLOYPATH)/include
LIBS = -L../deps/mosquitto_build/lib -L$(DCDBDEPLOYPATH)/lib/ -ldl -lmosquitto -lboost_system -lboost_thread -lboost_log_setup -lboost_log -lpthread -rdynamic
OBJS = src/dcdbpusher.o src/Configuration.o src/Sensor.o src/MQTTPusher.o
PLUGINS_BASE = libdcdbplugin_pdu libdcdbplugin_sysfs libdcdbplugin_ipmi libdcdbplugin_bacnet
PLUGINS = pdu sysfs ipmi bacnet
ifeq ($(OS),Darwin)
BACNET_PORT = bsd
LIBEXT = dylib
LIBFLAGS = -dynamiclib -install_name
PLUGINS = $(foreach p,$(PLUGINS_BASE),$(p).dylib)
else
BACNET_PORT = linux
LIBEXT = so
LIBFLAGS = -shared -Wl,-soname,
PLUGINS_BASE += libdcdbplugin_perfevent
PLUGINS+= perfevent
PLUGINFLAGS = -fPIC
endif
PLUGINS = $(foreach p,$(PLUGINS_BASE),$(p).$(LIBEXT))
PLUGIN_LIBS = $(foreach p,$(PLUGINS),libdcdbplugin_$(p).$(LIBEXT))
$(TARGET): $(foreach f,$(DISTFILESPATHS),$(DCDBDEPSPATH)/$(f)/.installed) $(OBJS)
$(CXX) -o $(TARGET) $(OBJS) $(LIBS)
all: $(TARGET) $(PLUGINS)
all: $(TARGET) $(PLUGIN_LIBS)
debug: CXXFLAGS += -DDEBUG
debug: all
......@@ -54,9 +53,14 @@ $(DCDBDEPSPATH)/freeipmi-$(FREEIPMI_VERSION)/.installed: $(DCDBDEPSPATH)/freeipm
$(OBJS) : %.o : %.cpp
install: $(TARGET)
install_lib: $(PLUGIN_LIBS)
install $^ $(DCDBDEPLOYPATH)/lib/
install_conf: $(foreach p,global $(PLUGINS),config/$(p).conf)
install -m 644 $^ $(DCDBDEPLOYPATH)/etc/
install: $(TARGET) install_lib install_conf
install $(TARGET) $(DCDBDEPLOYPATH)/bin/
install -m 644 $(TARGET).conf $(DCDBDEPLOYPATH)/etc
src/Sensor.o: CXXFLAGS+= $(PLUGINFLAGS)
src/sensors/%.o: CXXFLAGS+= $(PLUGINFLAGS) -I$(DCDBDEPSPATH)/bacnet-stack-$(BACNET-STACK_VERSION)/include -I$(DCDBDEPSPATH)/bacnet-stack-$(BACNET-STACK_VERSION)/ports/$(BACNET_PORT)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment