1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

remove most of the old Makefiles

This commit is contained in:
Steffen Vogel 2018-06-25 05:59:29 +02:00
parent a224821791
commit f585a94ebf
25 changed files with 0 additions and 1355 deletions

182
Makefile
View file

@ -1,182 +0,0 @@
## Main project Makefile
#
# The build system of this project is based on GNU Make and pkg-config
#
# To retain maintainability, the project is divided into multiple modules.
# Each module has its own Makefile which gets included.
#
# Please read "Recursive Make Considered Harmful" from Peter Miller
# to understand the motivation for this structure.
#
# [1] http://aegis.sourceforge.net/auug97.pdf
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
# Project modules
MODULES = lib packaging doc etc web tests
# Modules which are not included in default, install and clean targets
MODULES_EXCLUDE = thirdparty packaging doc
# Default prefix for install target
PREFIX ?= /usr/local
# Default out-of-source build path
BUILDDIR ?= build
# Default debug level for executables
V ?= 2
# Platform
PLATFORM ?= $(shell uname)
include Makefile.config
ifeq ($(WITH_SRC),1)
MODULES += src
endif
ifeq ($(WITH_TOOLS),1)
MODULES += tools
endif
ifeq ($(WITH_PLUGINS),1)
MODULES += plugins
endif
ifeq ($(WITH_TESTS),1)
MODULES += tests
endif
# Common flags
LDLIBS =
CFLAGS += -std=c11 -MMD -mcx16 -I$(BUILDDIR)/include -I$(SRCDIR)/include
CFLAGS += -Wall -Werror -fdiagnostics-color=auto -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE=1
ifeq ($(PLATFORM),Darwin)
CFLAGS += -D_DARWIN_C_SOURCE
endif
LDFLAGS += -L$(BUILDDIR)
# Some tools
PKG_CONFIG_PATH := $(PKG_CONFIG_PATH):/opt/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
PKGCONFIG := PKG_CONFIG_PATH=:$(PKG_CONFIG_PATH) pkg-config
SHELL := bash
# We must compile without optimizations for gcov!
ifdef DEBUG
CFLAGS += -O0 -g
VARIANTS += debug
else
CFLAGS += -O3
VARIANTS += release
endif
ifdef PROFILE
CFLAGS += -pg
LDFLAGS += -pg
VARIANTS += profile
endif
ifdef COVERAGE
CFLAGS += --coverage
LDLIBS += -lgcov
VARIANTS += coverage
endif
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
VARIANT = $(shell uname -s)-$(shell uname -m)-$(subst $(SPACE),-,$(strip $(VARIANTS)))
BUILDDIR := $(BUILDDIR)/$(VARIANT)
SRCDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
VPATH = $(SRCDIR)
# Add git revision and build variant defines
VERSION := $(shell git describe --tags --abbrev=0 --match 'v*')
VERSION_NUM := $(shell VERSION=$(VERSION); echo $${VERSION:1})
export BUILDDIR VARIANT VERSION VERSION_NUM
ifdef CI
VARIANT := $(VARIANT)-ci
GIT_REV := $(shell echo $${CI_COMMIT_SHA:0:7})
GIT_BRANCH := $(CI_COMMIT_REF_NAME)
ifdef CI_COMMIT_TAG
RELEASE = 1
else
RELEASE = 1.$(subst -,_,$(CI_COMMIT_REF_NAME))_$(subst -,_,$(VARIANT)).$(shell date +%Y%m%d)git$(GIT_REV)
endif
else
GIT_REV := $(shell git rev-parse --short=7 HEAD)
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
RELEASE = 1.$(subst -,_,$(GIT_BRANCH))_$(subst -,_,$(VARIANT)).$(shell date +%Y%m%d)git$(GIT_REV)
endif
BUILDID = "$(VERSION)-$(GIT_REV)-$(VARIANT)"
# pkg-config dependencies
PKGS = openssl jansson
ifeq ($(WITH_CONFIG),1)
PKGS += libconfig
endif
######## Targets ########
# Add flags by pkg-config
CFLAGS += $(shell $(PKGCONFIG) --cflags ${PKGS})
LDLIBS += $(shell $(PKGCONFIG) --libs ${PKGS})
all: $(filter-out $(MODULES_EXCLUDE),$(MODULES))
install: $(addprefix install-,$(filter-out $(MODULES_EXCLUDE),$(MODULES)))
clean: $(addprefix clean-, $(filter-out $(MODULES_EXCLUDE),$(MODULES)))
src plugins tools tests: lib
# Build all variants: debug, coverage, ...
everything:
$(MAKE) RELEASE=1
$(MAKE) DEBUG=1
$(MAKE) COVERAGE=1
$(MAKE) PROFILE=1
# Create non-existent directories
.SECONDEXPANSION:
.PRECIOUS: %/
%/:
mkdir -p $@
escape = $(shell echo $1 | tr a-z- A-Z_ | tr -dc ' A-Z0-9_')
.PHONY: all everything clean install
include $(wildcard $(BUILDDIR)/**/*.d)
include $(patsubst %,$(SRCDIR)/%/Makefile.inc,$(MODULES))
include Makefile.help

View file

@ -1,74 +0,0 @@
## Main project Makefile
#
# The build system of this project is based on GNU Make and pkg-config
#
# To retain maintainability, the project is divided into multiple modules.
# Each module has its own Makefile which gets included.
#
# Please read "Recursive Make Considered Harmful" from Peter Miller
# to understand the motivation for this structure.
#
# [1] http://aegis.sourceforge.net/auug97.pdf
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
# Select modules
WITH_SRC ?= 1
WITH_TOOLS ?= 1
WITH_PLUGINS ?= 1
WITH_TESTS ?= 0
WITH_CLIENTS ?= 0
# Select features
WITH_CONFIG ?= 1
WITH_HOOKS ?= 1
WITH_WEB ?= 1
WITH_API ?= 1
WITH_IO ?= 1
# Select IO formats
WITH_FORMAT_PROTOBUF ?= 1
# Select node-types
ifeq ($(PLATFORM),Linux)
IS_LINUX = 1
else
IS_LINUX = 0
endif
WITH_NODE_FPGA ?= $(IS_LINUX)
WITH_NODE_CBUILDER ?= $(IS_LINUX)
WITH_NODE_LOOPBACK ?= $(IS_LINUX)
WITH_NODE_COMEDI ?= $(IS_LINUX)
WITH_NODE_TEST_RTT ?= 1
WITH_NODE_FILE ?= 1
WITH_NODE_SIGNAL ?= 1
WITH_NODE_NGSI ?= 1
WITH_NODE_WEBSOCKET ?= 1
WITH_NODE_SOCKET ?= 1
WITH_NODE_ZEROMQ ?= 1
WITH_NODE_NANOMSG ?= 1
WITH_NODE_SHMEM ?= 1
WITH_NODE_STATS ?= 1
WITH_NODE_INFLUXDB ?= 1
WITH_NODE_AMQP ?= 1
WITH_NODE_IEC61850 ?= 1
WITH_NODE_MQTT ?= 1

View file

@ -1,102 +0,0 @@
# Makefile for clang autocompletion
#
# This Makefile produces .clang_complete files containing compiler flags
# which are used by clang autocompletion tools such as:
#
# - https://atom.io/packages/autocomplete-clang
# - https://github.com/Rip-Rip/clang_complete
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
E = @echo
help:
$E "The following make targets are available:"
$E
$E " - make all"
$E " Build libvillas, villas CLI tools, tests"
$E
$E " - make everything"
$E " Build all in all available build variants"
$E
$E " - make docker"
$E " - make run-docker"
$E " - make deploy-docker"
$E
$E " - make docker-{app,dev,dev-centos,dev-fedora}"
$E " Build Docker images"
$E
$E " - make run-docker-{app,dev,dev-centos,dev-fedora}"
$E " Run Docker containers"
$E
$E " - make deploy-docker-{app,dev,dev-centos,dev-fedora}"
$E " Deploy Docker images to official registry"
$E
$E "The following environment variables can change the build:"
$E " DEBUG = 1"
$E " COVERAGE = 1"
$E
$E "Use the following variables to enable/disabled certain features of VILLASnode"
$E " The list also shows the currently active (default) value"
$E
$E "Enable modules:"
$E " WITH_SRC = $(WITH_SRC)"
$E " WITH_TOOLS = $(WITH_TOOLS)"
$E " WITH_PLUGINS = $(WITH_PLUGINS)"
$E " WITH_TESTS = $(WITH_TESTS)"
$E " WITH_CLIENTS = $(WITH_CLIENTS)"
$E
$E "Enable features:"
$E " WITH_CONFIG = $(WITH_CONFIG)"
$E " WITH_HOOKS = $(WITH_HOOKS)"
$E " WITH_WEB = $(WITH_WEB)"
$E " WITH_API = $(WITH_API)"
$E " WITH_IO = $(WITH_IO)"
$E
$E "Enable IO formats:"
$E " WITH_FORMAT_PROTOBUF = $(WITH_FORMAT_PROTOBUF)"
$E
$E "Enable node-types:"
$E " WITH_NODE_FPGA = $(WITH_NODE_FPGA)"
$E " WITH_NODE_CBUILDER = $(WITH_NODE_CBUILDER)"
$E " WITH_NODE_LOOPBACK = $(WITH_NODE_LOOPBACK)"
$E " WITH_NODE_TEST_RTT = $(WITH_NODE_TEST_RTT)"
$E " WITH_NODE_FILE = $(WITH_NODE_FILE)"
$E " WITH_NODE_SIGNAL = $(WITH_NODE_SIGNAL)"
$E " WITH_NODE_NGSI = $(WITH_NODE_NGSI)"
$E " WITH_NODE_WEBSOCKET = $(WITH_NODE_WEBSOCKET)"
$E " WITH_NODE_SOCKET = $(WITH_NODE_SOCKET)"
$E " WITH_NODE_ZEROMQ = $(WITH_NODE_ZEROMQ)"
$E " WITH_NODE_NANOMSG = $(WITH_NODE_NANOMSG)"
$E " WITH_NODE_SHMEM = $(WITH_NODE_SHMEM)"
$E " WITH_NODE_STATS = $(WITH_NODE_STATS)"
$E " WITH_NODE_INFLUXDB = $(WITH_NODE_INFLUXDB)"
$E " WITH_NODE_AMQP = $(WITH_NODE_AMQP)"
$E " WITH_NODE_MQTT = $(WITH_NODE_MQTT)"
$E " WITH_NODE_IEC61850 = $(WITH_NODE_IEC61850)"
$E " WITH_NODE_MQTT = $(WITH_NODE_MQTT)"
$E " WITH_NODE_COMEDI = $(WITH_NODE_COMEDI)"
$E
$E "Available dependencies: $(LIB_PKGS)"
$E "Enabled node-types: $(LIB_NODES)"
$E "Enabled formats: $(LIB_FORMATS)"
.PHONY: help

View file

@ -1,32 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
CLIENTS =
include $(SRCDIR)/clients/python/Makefile.inc
include $(SRCDIR)/clients/opal/Makefile.inc
clients: $(addprefix clients-,$(filter-out opal,$(CLIENTS)))
clean-clients: $(addprefix clean-clients-,$(filter-out opal,$(CLIENTS)))
install-clients: $(addprefix install-clients-,$(filter-out opal,$(CLIENTS)))
.PHONY: clients clean-clients install-clients

View file

@ -1,46 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
ifneq ($(wildcard $(SRCDIR)/thirdparty/libopal/include/opal/AsyncApi.h),)
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
endif

View file

@ -1,24 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
clients/python/villas_pb2.py: lib/io/villas.proto
protoc --proto_path=$(dir $^) --python_out=$(dir $@) $^

View file

@ -1,33 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
doc: | $(BUILDDIR)/doc/
( cat Doxyfile ; echo "OUTPUT_DIRECTORY=$(BUILDDIR)/doc/" ) | doxygen -
install-doc: doc
mkdir -p $(DESTDIR)$(PREFIX)/share/villas/node/doc/
cp -R $(BUILDDIR)/doc/html/* $(DESTDIR)$(PREFIX)/share/villas/node/doc/
clean-doc:
rm -rf $(BUILDDIR)/doc/
.PHONY: doc install-doc clean-doc

View file

@ -1,30 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
etc:
install-etc: | $(DESTDIR)/etc/villas/node/
install -D -t $(DESTDIR)/etc/villas/node $(SRCDIR)/etc/*.conf
clean-etc:
.PHONY: etc install-etc clean-etc

View file

@ -1,64 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
SONAMES = villas villas-ext
LIBS = $(patsubst %, lib%, $(SONAMES))
LIB_CFLAGS += $(CFLAGS) -fPIC
include $(patsubst %, lib/Makefile.%.inc, $(SONAMES))
$(BUILDDIR)/include/villas/config.h: include/villas/config.h.in Makefile.config | $$(dir $$@)
cp $< $@
echo -e "\n" >> $@
echo "#define BUILDID \"$(BUILDID)\"" >> $@
echo "#define V $(V)" >> $@
echo "#define PREFIX \"$(PREFIX)\"" >> $@
echo -e "\n" >> $@
echo "/* Available Features */" >> $@
if (( $(WITH_WEB) )); then echo "#define WITH_WEB 1" >> $@; fi
if (( $(WITH_API) )); then echo "#define WITH_API 1" >> $@; fi
if (( $(WITH_HOOKS) )); then echo "#define WITH_HOOKS 1" >> $@; fi
if (( $(WITH_IO) )); then echo "#define WITH_IO 1" >> $@; fi
if (( $(WITH_CONFIG) )); then echo "#define WITH_CONFIG 1" >> $@; fi
for NODE in $(call escape,$(LIB_NODES)); do echo "#define WITH_NODE_$${NODE} 1" >> $@; done
for FORMAT in $(call escape,$(LIB_FORMATS)); do echo "#define WITH_FORMAT_$${FORMAT} 1" >> $@; done
for PKG in $(call escape,$(LIB_PKGS)); do echo "#define WITH_$${PKG} 1" >> $@; done
# Compile
$(BUILDDIR)/lib/%.o: lib/%.c $(BUILDDIR)/include/villas/config.h | $$(dir $$@)
$(CC) $(LIB_CFLAGS) -c $< -o $@
lib: $(patsubst %, lib%, $(SONAMES))
install-lib: $(patsubst %, install-lib%, $(SONAMES))
clean-lib: $(patsubst %, clean-lib%, $(SONAMES))
rm -rf $(BUILDDIR)/lib
rm -rf $(BUILDDIR)/include
.PHONY: lib install-lib clean-lib

View file

@ -1,54 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
LIBEXT_NAME = libvillas-ext
LIBEXT_ABI_VERSION = 1
LIBEXT = $(BUILDDIR)/$(LIBEXT_NAME).so.$(LIBEXT_ABI_VERSION)
LIBEXT_SRCS += $(addprefix lib/, sample.c queue.c queue_signalled.c \
memory.c log.c shmem.c utils.c kernel/kernel.c list.c \
timing.c pool.c log_helper.c \
)
LIBEXT_LDFLAGS = -shared
LIBEXT_LDLIBS +=
ifeq ($(PLATFORM),Linux)
LIBEXT_LDLIBS += -ldl -lrt -Wl,-soname,$(LIBEXT_NAME).so.$(LIBEXT_ABI_VERSION)
endif
LIBEXT_OBJS = $(patsubst %.c, $(BUILDDIR)/%.o, $(LIBEXT_SRCS))
$(LIBEXT_NAME): $(LIBEXT)
$(LIBEXT): $(LIBEXT_OBJS)
$(CC) $(LIBEXT_LDFLAGS) -o $@ $^ $(LIBEXT_LDLIBS)
ln -srf $@ $(BUILDDIR)/$(LIBEXT_NAME).so
install-libvillas-ext: libvillas-ext
install -m 0755 -D -T $(LIBEXT) $(DESTDIR)$(PREFIX)/lib/$(LIBEXT_NAME).so.$(LIBEXT_ABI_VERSION)
ln -srf $(DESTDIR)$(PREFIX)/lib/$(LIBEXT_NAME).so.$(LIBEXT_ABI_VERSION) $(DESTDIR)$(PREFIX)/lib/$(LIBEXT_NAME).so
clean-libvillas-ext:
rm -f $(LIBEXT)
.PHONY: install-libvillas-ext clean-libvillas-ext $(LIBEXT_NAME)

View file

@ -1,93 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
LIB_NAME = libvillas
LIB_ABI_VERSION = 1
LIB = $(BUILDDIR)/$(LIB_NAME).so.$(LIB_ABI_VERSION)
# Object files for libvillas
LIB_SRCS += $(addprefix lib/kernel/, kernel.c rt.c) \
$(addprefix lib/, sample.c path.c node.c hook.c log.c log_config.c \
utils.c super_node.c hist.c timing.c pool.c list.c queue.c \
queue_signalled.c memory.c advio.c plugin.c node_type.c stats.c \
mapping.c shmem.c config_helper.c crypt.c compat.c \
log_helper.c task.c buffer.c table.c bitset.c signal.c \
)
LIB_LDFLAGS += -shared
LIB_LDLIBS += $(LDLIBS)
ifeq ($(PLATFORM),Linux)
LIB_LDLIBS += -ldl -lrt -Wl,-soname,$(LIB_NAME).so.$(LIB_ABI_VERSION)
endif
LIB_PKGS += openssl libcurl
include lib/nodes/Makefile.inc
ifeq ($(WITH_IO),1)
LIB_SRCS += lib/io.c lib/format_type.c
include lib/formats/Makefile.inc
endif
ifeq ($(WITH_HOOKS),1)
LIB_SRCS += lib/hook.c lib/hook_type.c
include lib/hooks/Makefile.inc
endif
ifeq ($(WITH_WEB),1)
LIB_SRCS += lib/web.c
LIB_PKGS += libwebsockets
endif
ifeq ($(WITH_API),1)
LIB_SRCS += lib/api.c
include lib/api/Makefile.inc
endif
LIB_SRCS += $(patsubst %, lib/nodes/%.c, $(LIB_NODES))
LIB_SRCS += $(patsubst %, lib/formats/%.c, $(LIB_FORMATS))
# Add flags by pkg-config
LIB_LDLIBS += $(shell $(PKGCONFIG) --libs $(LIB_PKGS))
LIB_CFLAGS += $(shell $(PKGCONFIG) --cflags $(LIB_PKGS))
LIB_OBJS = $(patsubst %.c, $(BUILDDIR)/%.o, $(LIB_SRCS))
$(LIB_NAME): $(LIB)
# Link
$(LIB): $(LIB_OBJS)
$(CC) $(LIB_LDFLAGS) -o $@ $^ $(LIB_LDLIBS)
ln -srf $@ $(BUILDDIR)/$(LIB_NAME).so
# Install
install-libvillas: libvillas | $(DESTDIR)$(PREFIX)/include/villas/
install -m 0755 -D -T $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB_NAME).so.$(LIB_ABI_VERSION)
install -m 0644 -D -t $(DESTDIR)$(PREFIX)/include/villas/ include/villas/*.h
ln -srf $(DESTDIR)$(PREFIX)/lib/$(LIB_NAME).so.$(LIB_ABI_VERSION) $(DESTDIR)$(PREFIX)/lib/$(LIB_NAME).so
if [ "$(PLATFORM)" == "Linux" ]; then ldconfig; fi
clean-libvillas:
rm -f $(LIB)
.PHONY: install-libvillas clean-libvillas $(LIB_NAME)

View file

@ -1,25 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
LIB_SRCS += $(wildcard lib/api/*.c)
include lib/api/actions/Makefile.inc

View file

@ -1,23 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
LIB_SRCS += $(wildcard lib/api/actions/*.c)

View file

@ -1,41 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
LIB_FORMATS += json json_reserve villas_binary villas_human csv raw
LIB_SRCS += lib/formats/msg.c
# Enable Google Protobuf format
ifeq ($(WITH_FORMAT_PROTOBUF),1)
ifeq ($(shell $(PKGCONFIG) libprotobuf-c; echo $$?),0)
LIB_SRCS += lib/formats/protobuf.c lib/formats/villas.pb-c.c
LIB_PKGS += libprotobuf-c
LIB_FORMATS += protobuf
endif
endif
%.pb-c.c %.pb-c.h: %.proto
protoc-c --proto_path=$(SRCDIR) --c_out=$(SRCDIR) --dependency_out=$(BUILDDIR)/$*.d $(realpath $^)
$(BUILDDIR)/%.pb-c.o: LIB_CFLAGS += -I$(SRCDIR)
$(BUILDDIR)/lib/formats/protobuf.o: LIB_CFLAGS += -I$(SRCDIR)/lib/formats
$(BUILDDIR)/lib/formats/protobuf.o: lib/formats/villas.pb-c.h

View file

@ -1,29 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
LIB_SRCS += $(addprefix lib/hooks/, convert.c decimate.c drop.c jitter_calc.c \
map.c restart.c shift_seq.c shift_ts.c \
skip_first.c stats.c ts.c limit_rate.c scale.c)
ifeq ($(WITH_IO),1)
LIB_SRCS += lib/hooks/print.c
endif

View file

@ -1,56 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
TAR_OPTS = --exclude-ignore-recursive=$(SRCDIR)/.distignore --transform='s|^\.|villas-node-$(VERSION_NUM)|' --show-transformed-names
TAR_VILLAS = $(BUILDDIR)/packaging/villas-node-$(VERSION_NUM)-$(RELEASE).tar.gz
DEPLOY_USER ?= deploy
DEPLOY_HOST ?= acs-os-fein-website
DEPLOY_PATH ?= /var/www/villas/node
packaging: rpm dist
deploy: deploy-dist deploy-rpm deploy-docker
# Source tarballs
dist: $(TAR_VILLAS)
$(TAR_VILLAS): | $$(dir $$@)
tar $(TAR_OPTS) -C $(SRCDIR) -czf $@ .
deploy-dist: $(TAR_VILLAS)
rsync $(TAR_VILLAS) $(DEPLOY_USER)@$(DEPLOY_HOST):$(DEPLOY_PATH)/src
deploy-rpm:
rsync -a --progress $(BUILDDIR)/../Linux-x86_64-release/packaging/rpm/RPMS/ $(DEPLOY_USER)@$(DEPLOY_HOST):/var/www/packages/redhat/
ssh $(DEPLOY_USER)@$(DEPLOY_HOST) createrepo /var/www/packages/redhat
clean-packaging:
rm -f $(BUILDDIR)/packaging/villas-node-$(VERSION_NUM).tar.gz
install-packaging:
.PHONY: packaging install-packaging clean-packaging deploy deploy-dist deploy-rpm dist $(TAR_VILLAS)
include packaging/rpm/Makefile.inc
include packaging/docker/Makefile.inc

View file

@ -1,74 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
DOCKER = docker
DOCKER_FILE ?= Dockerfile
DOCKER_IMAGE ?= villas/node
DOCKER_TAG ?= $(GIT_BRANCH)
DOCKER_TARGETS = docker-app docker-dev docker-dev-centos docker-dev-ubuntu
DOCKER_RUN_TARGETS = $(addprefix run-,$(DOCKER_TARGETS))
DOCKER_DEPLOY_TARGETS = $(addprefix deploy-,$(DOCKER_TARGETS))
ifneq ($(CI_COMMIT_TAG),)
DOCKER_OPTS += --tag $(DOCKER_IMAGE)-$*:$(CI_COMMIT_TAG)
endif
DOCKER_RUN_OPTS = --interactive --tty \
--publish 80:80 --publish 443:443 --publish 12000:12000/udp --publish 12001:12001/udp \
--privileged --security-opt seccomp:unconfined --volume "$(SRCDIR):/villas"
# Special cases for 'docker'target
run-docker: run-docker-app
deploy-docker: deploy-docker-app
docker: docker-app
$(DOCKER) tag $(DOCKER_IMAGE)-app:$(DOCKER_TAG) $(DOCKER_IMAGE):$(DOCKER_TAG)
$(DOCKER) tag $(DOCKER_IMAGE)-app:$(DOCKER_TAG) $(DOCKER_IMAGE):latest
.PHONY: docker run-docker deploy-docker
$(DOCKER_DEPLOY_TARGETS): deploy-docker-%: docker-%
$(DOCKER) push $(DOCKER_IMAGE)-$*:$(DOCKER_TAG)
$(DOCKER_RUN_TARGETS): run-docker-%: docker-%
$(DOCKER) run $(DOCKER_RUN_OPTS) $(DOCKER_IMAGE)-$*:$(DOCKER_TAG)
$(DOCKER_TARGETS): docker-%: $(BUILDDIR)/packaging/docker/Image.%
# The docker build targets use the --iidfile option to write the newly build image
# id to an file. Make is using the modification timestamp of this file and the Dockerfile
# to determine when the image needs to be rebuild.
$(BUILDDIR)/packaging/docker/Image.%: packaging/docker/Dockerfile.% | $(BUILDDIR)/packaging/docker/
$(DOCKER) build \
--file $< --iidfile $@ \
--tag $(DOCKER_IMAGE)-$*:$(DOCKER_TAG) \
--tag $(DOCKER_IMAGE)-$*:latest \
--build-arg BUILDER_IMAGE=$(DOCKER_IMAGE)-dev:$(DOCKER_TAG) \
--build-arg DOCKER_TAG=${DOCKER_TAG} \
--build-arg GIT_BRANCH=${GIT_BRANCH} \
--build-arg GIT_REV=${GIT_REV} \
--build-arg VERSION=${VERSION} \
--build-arg VARIANT=${VARIANT} \
$(DOCKER_OPTS) $(SRCDIR)
.PHONY: $(DOCKER_TARGETS) $(DOCKER_RUN_TARGETS) $(DOCKER_DEPLOY_TARGETS)

View file

@ -1,44 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
RPMDIR = $(BUILDDIR)/packaging/rpm
SPEC_VILLAS = $(BUILDDIR)/packaging/rpm/villas-node.spec
rpm: rpm-villas-node
rpm-villas-node: $(TAR_VILLAS) $(SPEC_VILLAS) | $(RPMDIR)/SOURCES/
cp $(TAR_VILLAS) $(RPMDIR)/SOURCES
rpmbuild -ba --define="_topdir $$(pwd)/$(RPMDIR)" $(BUILDDIR)/packaging/rpm/villas-node.spec
# We patch version number and release fields of the spec file based on the current Git commit
$(SPEC_VILLAS): packaging/rpm/villas-node.spec | $$(dir $$@)
sed -e "s/§VERSION§/$(VERSION_NUM)/g" \
-e "s/§RELEASE§/$(RELEASE)/g" < $^ > $@
sign-rpm:
rpmsign $(RPMDIR)/RPMS/*/.rpm
clean-rpm:
rm -rf $(RPMDIR)
.PHONY: rpm clean-rpm rpm-libwebsockets rpm-libxil $(SPEC_VILLAS)

View file

@ -1,55 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
# Plugins
PLUGINS = $(BUILDDIR)/simple_circuit.so
ifeq ($(WITH_HOOKS),1)
PLUGINS += $(BUILDDIR)/example_hook.so
endif
PLUGIN_CFLAGS = -fPIC -DVILLAS -I../include/villas
PLUGIN_LDFLAGS = -shared -L$(BUILDDIR)
PLUGIN_LDLIBS = -lvillas
# Dependencies for plugins
$(BUILDDIR)/example_hook.so: $(BUILDDIR)/plugins/hooks/example_hook.o
$(BUILDDIR)/simple_circuit.so: $(BUILDDIR)/plugins/models/simple_circuit.o
plugins: $(PLUGINS)
# Compile
$(BUILDDIR)/plugins/%.o: plugins/%.c | $$(dir $$@)
$(CC) $(CFLAGS) $(PLUGIN_CFLAGS) -c $< -o $@
# Link
$(PLUGINS):
$(CC) $(PLUGIN_LDFLAGS) -o $@ $^ $(PLUGIN_LDLIBS)
# Plugins are not installed to the system for now...
install-plugins: plugins | $(DESTDIR)$(PREFIX)/share/villas/node/plugins/
install -D -t $(DESTDIR)$(PREFIX)/share/villas/node/plugins $(PLUGINS)
clean-plugins:
rm -rf $(BUILDDIR)/plugins $(PLUGINS)
.PHONY: plugins install-plugins clean-plugins

View file

@ -1,66 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
# Executables
TARGETS = $(BUILDDIR)/villas-node \
$(BUILDDIR)/villas-test-rtt \
$(BUILDDIR)/villas-test-shmem \
$(BUILDDIR)/villas-convert
ifeq ($(WITH_IO),1)
ifeq ($(WITH_HOOKS),1)
TARGETS += $(BUILDDIR)/villas-hook
endif
TARGETS += $(BUILDDIR)/villas-pipe \
$(BUILDDIR)/villas-signal \
$(BUILDDIR)/villas-test-cmp
endif
SRC_LDLIBS = $(LDLIBS) -pthread -lm -lvillas
SRC_CFLAGS = $(CFLAGS)
SRC_LDFLAGS = $(LDFLAGS) -Wl,-rpath,'$$ORIGIN'
src: $(TARGETS)
$(TARGETS): $(BUILDDIR)/villas-%: $(BUILDDIR)/src/%.o
# Compile executable objects
$(BUILDDIR)/src/%.o: src/%.c | $$(dir $$@)
$(CC) $(SRC_CFLAGS) -c $< -o $@
# Build villas-shmem only with libvillas-ext (to ensure that libext contains everything needed)
$(BUILDDIR)/villas-shmem: $(BUILDDIR)/src/shmem.o libvillas-ext
$(CC) $(SRC_LDFLAGS) $(BUILDDIR)/src/shmem.o $(filter-out -lvillas,$(SRC_LDLIBS)) -lvillas-ext -o $@
# Link target executables
$(TARGETS): | $(LIBS)
$(CC) $(SRC_LDFLAGS) $^ $(SRC_LDLIBS) -o $@
# Install
install-src: src
install -m 0755 -D -t $(DESTDIR)$(PREFIX)/bin $(TARGETS)
clean-src:
rm -rf $(BUILDDIR)/src $(TARGETS)
.PHONY: src src-tests src-tests

View file

@ -1,43 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
include tests/unit/Makefile.inc
ifdef COVERAGE
include tests/unit/Makefile.gcov.inc
endif
include tests/integration/Makefile.inc
tests: unit-tests integration-tests
run-tests: run-unit-tests run-integration-tests run-valgrind
VALGRIND = valgrind --leak-check=full --show-leak-kinds=all --suppressions=$(SRCDIR)/tests/valgrind.supp
run-valgrind: src
$(VALGRIND) $(BUILDDIR)/villas-node & sleep 2; kill %1
$(VALGRIND) $(BUILDDIR)/villas-pipe -t 2 $(SRCDIR)/etc/websocket-loopback.conf ws1
$(VALGRIND) $(BUILDDIR)/villas-signal mixed -v 4 -l 10
$(VALGRIND) $(BUILDDIR)/villas-hook stats < <($(BUILDDIR)/villas-signal mixed -l 5)
.PHONY: tests run-tests run-valgrind

View file

@ -1,26 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
integration-tests: src tools
run-integration-tests: integration-tests
@$(SRCDIR)/tools/integration-tests.sh

View file

@ -1,49 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
TEST_SRCS = $(wildcard tests/unit/*.c)
TEST_OBJS = $(patsubst %.c,$(BUILDDIR)/%.o,$(TEST_SRCS))
TEST_CFLAGS = $(CFLAGS)
TEST_LDFLAGS = $(LDFLAGS) -Wl,-rpath,'$$ORIGIN'
TEST_LDLIBS = $(LDLIBS) -lcriterion -lvillas -pthread -ljansson
unit-tests: $(BUILDDIR)/unit-tests
run-unit-tests: tests
$(BUILDDIR)/unit-tests $(CRITERION_OPTS)
# Compile
$(BUILDDIR)/tests/unit/%.o: tests/unit/%.c $(BUILDDIR)/include/villas/config.h | $$(dir $$@)
$(CC) $(TEST_CFLAGS) -c $< -o $@
# Link
$(BUILDDIR)/unit-tests: $(TEST_OBJS) $(LIB)
$(CC) $(TEST_LDFLAGS) $^ $(TEST_LDLIBS) -o $@
# Tests are not installed
install-tests:
clean-tests:
rm -rf $(BUILDDIR)/tests $(BUILDDIR)/testsuite
.PHONY: unit-tests install-unit-tests clean-unit-tests run-unit-tests

View file

@ -1,61 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
ifeq ($(WITH_CONFIG),1)
ifeq ($(shell $(PKGCONFIG) libconfig; echo $$?),0)
TOOLS += $(BUILDDIR)/conf2json
endif
endif
TOOLS_CFLAGS = $(CFLAGS)
TOOLS_LDLIBS = $(LDLIBS) -lconfig -ljansson -lvillas
TOOLS_LDFLAGS = $(LDFLAGS) -Wl,-rpath,'$$ORIGIN'
ifeq ($(shell $(PKGCONFIG) libzmq; echo $$?),0)
TOOLS += $(BUILDDIR)/zmq-keygen
TOOLS_CFLAGS += $(shell $(PKGCONFIG) --cflags libzmq)
TOOLS_LDLIBS += $(shell $(PKGCONFIG) --libs libzmq)
endif
ifeq ($(IS_LINUX),1)
TOOLS += $(BUILDDIR)/rmshm $(BUILDDIR)/rmsem
TOOLS_LDLIBS += -lrt -pthread
endif
# Compile executable objects
$(BUILDDIR)/tools/%.o: tools/%.c | $$(dir $$@)
$(CC) $(TOOLS_CFLAGS) -c $< -o $@
# Link target executables
$(TOOLS): $(BUILDDIR)/%: $(BUILDDIR)/tools/%.o | $(LIBS)
$(CC) $(TOOLS_LDFLAGS) $^ $(TOOLS_LDLIBS) -o $@
tools: $(TOOLS)
clean-tools:
rm -rf $(BUILDDIR)/tools $(TOOLS)
install-tools: $(TOOLS)
install -m 0755 tools/villas.sh $(DESTDIR)$(PREFIX)/bin/villas
install -m 0755 -D -t $(DESTDIR)$(PREFIX)/bin $(TOOLS)
.PHONY: tools clean-tools install-tools

View file

@ -1,29 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
# @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 <http://www.gnu.org/licenses/>.
###################################################################################
install-web:
mkdir -p $(DESTDIR)$(PREFIX)/share/villas/node/web/
cp -R $(SRCDIR)/web/socket/* $(DESTDIR)$(PREFIX)/share/villas/node/web/
clean-web:
.PHONY: web install-web clean-web