diff --git a/Makefile b/Makefile index cf2da96e7..556aeb10f 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ endif CFLAGS += $(shell $(PKGCONFIG) --cflags ${PKGS}) LDLIBS += $(shell $(PKGCONFIG) --libs ${PKGS}) -all: src plugins tools +all: src plugins tools tests clients src plugins tools tests: lib # Build all variants: debug, coverage, ... diff --git a/clients/Makefile.inc b/clients/Makefile.inc index 354abeaf5..162850c03 100644 --- a/clients/Makefile.inc +++ b/clients/Makefile.inc @@ -20,23 +20,15 @@ # along with this program. If not, see . ################################################################################### -ASYNCIP_PATH = $(SRCDIR)/clients/opal/models/send_receive +CLIENTS = + +ifneq ($(wildcard $(SRCDIR)/thirdparty/libopal/include/opal/AsyncApi.h),) + -include $(SRCDIR)/clients/Makefile.opal.inc +endif -ASYNCIP_OPTS = RTLAB_INTEL_COMPILER=0 \ - PROTOCOL=GTNET_SKT \ - OPAL_LIBS="-lSystem -luuid" \ - OPAL_LIBPATH=-L$(SRCDIR)/thirdparty/libopal/ \ - OPAL_INCPATH=-I$(SRCDIR)/thirdparty/libopal/include/opal +clients: $(addprefix clients-,$(CLIENTS)) -clients: clients-opal - -clients-opal: - $(MAKE) -C $(ASYNCIP_PATH) -f Makefile.mk AsyncIP $(ASYNCIP_OPTS) - -clean-clients: - $(MAKE) -C $(ASYNCIP_PATH) -f Makefile.mk clean $(ASYNCIP_OPTS) - -install-clients: - $(MAKE) -C $(ASYNCIP_PATH) -f Makefile.mk install $(ASYNCIP_OPTS) +clean-clients: $(addprefix clean-clients-,$(CLIENTS)) +install-clients: $(addprefix install-clients-,$(CLIENTS)) .PHONY: clients clean-clients install-clients diff --git a/clients/Makefile.opal.inc b/clients/Makefile.opal.inc new file mode 100644 index 000000000..c67bede93 --- /dev/null +++ b/clients/Makefile.opal.inc @@ -0,0 +1,42 @@ +# Makefile. +# +# @author Steffen Vogel +# @copyright 2017, Institute for Automation of Complex Power Systems, EONERC +# @license GNU General Public License (version 3) +# +# VILLASnode +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +################################################################################### + +CLIENTS += opal + +ASYNCIP_PATH = $(SRCDIR)/clients/opal/models/send_receive + +ASYNCIP_OPTS = RTLAB_INTEL_COMPILER=0 \ + PROTOCOL=GTNET_SKT \ + OPAL_LIBS="-lSystem -luuid" \ + OPAL_LIBPATH=-L$(SRCDIR)/thirdparty/libopal/ \ + OPAL_INCPATH=-I$(SRCDIR)/thirdparty/libopal/include/opal + +clients-opal: + $(MAKE) -C $(ASYNCIP_PATH) -f Makefile.mk AsyncIP $(ASYNCIP_OPTS) + +clean-clients-opal: + $(MAKE) -C $(ASYNCIP_PATH) -f Makefile.mk clean $(ASYNCIP_OPTS) + +install-clients-opal: + $(MAKE) -C $(ASYNCIP_PATH) -f Makefile.mk install $(ASYNCIP_OPTS) + +.PHONY: clients-opal clean-clients-opal install-clients-opal diff --git a/lib/nodes/Makefile.inc b/lib/nodes/Makefile.inc index e173fecb3..0ddb86bb2 100644 --- a/lib/nodes/Makefile.inc +++ b/lib/nodes/Makefile.inc @@ -101,11 +101,11 @@ endif # Enable OPAL-RT Asynchronous Process support (will result in 32bit binary!!!) ifeq ($(WITH_OPAL),1) -ifneq ($(wildcard thirdparty/libopal/include/opal/AsyncApi.h),) +ifneq ($(wildcard $(SRCDIR)/thirdparty/libopal/include/opal/AsyncApi.h),) LIB_OBJS += opal.o - LIB_CFLAGS += -I thirdparty/libopal/include/opal/ -DWITH_OPAL - LIB_LDFLAGS += -L/lib/i386-linux-gnu/ -L/usr/lib/i386-linux-gnu/ -Lthirdparty/libopal/ + LIB_CFLAGS += -I $(SRCDIR)/thirdparty/libopal/include/opal/ -DWITH_OPAL + LIB_LDFLAGS += -L/lib/i386-linux-gnu/ -L/usr/lib/i386-linux-gnu/ -L$(SRCDIR)/thirdparty/libopal/ LIB_LDLIBS += -lOpalAsyncApiCore -lOpalCore -lOpalUtils -lirc # libOpalAsyncApi is a 32bit library. So we need to build everything in 32bit