2017-04-27 13:08:17 +02:00
|
|
|
# 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/>.
|
|
|
|
###################################################################################
|
|
|
|
|
2017-06-13 02:51:11 +02:00
|
|
|
REQS_CMAKE = libxil libwebsockets criterion jansson nanomsg
|
|
|
|
REQS_AUTOCONF = libnl libconfig libcurl libzmq
|
2016-10-08 20:28:34 -04:00
|
|
|
|
2017-06-13 02:51:11 +02:00
|
|
|
REQS = $(REQS_CMAKE) $(REQS_AUTOCONF)
|
2016-10-08 20:28:34 -04:00
|
|
|
|
2017-04-03 08:58:49 +02:00
|
|
|
ifdef DEBUG
|
|
|
|
CMAKE_OPTS += -DCMAKE_BUILD_TYPE=DEBUG
|
|
|
|
|
|
|
|
AC_CPPFLAGS=-DDEBUG
|
|
|
|
AC_CFLAGS=-g -O0
|
|
|
|
AC_CXXFLAGS=-g -O0
|
|
|
|
endif
|
|
|
|
|
2017-05-22 20:06:31 +02:00
|
|
|
CONFIGURE_OPTS = --prefix=$(PREFIX)
|
|
|
|
|
2016-10-13 22:15:28 -04:00
|
|
|
thirdparty:
|
2016-10-08 20:28:34 -04:00
|
|
|
|
|
|
|
# Install & compile autotools based projects
|
2017-06-13 02:51:11 +02:00
|
|
|
$(REQS_AUTOCONF): CPPFLAGS=$(AC_CPPFLAGS) CFLAGS=$(AC_CFLAGS) CXXFLAGS=$(AC_CXXFLAGS)
|
|
|
|
$(REQS_AUTOCONF): | $(BUILDDIR)/thirdparty/$$@/
|
2016-10-08 20:28:34 -04:00
|
|
|
autoreconf -fi $(SRCDIR)/thirdparty/$@
|
2017-05-22 20:06:31 +02:00
|
|
|
cd $(BUILDDIR)/thirdparty/$@ && $(SRCDIR)/thirdparty/$@/configure $(CONFIGURE_OPTS) && make
|
2016-10-08 20:28:34 -04:00
|
|
|
|
|
|
|
# Install & compile CMake based projects
|
2017-06-13 02:51:11 +02:00
|
|
|
$(REQS_CMAKE): | $(BUILDDIR)/thirdparty/$$@/
|
2016-10-08 20:28:34 -04:00
|
|
|
cmake -DCMAKE_INSTALL_PREFIX:PATH=$(PREFIX) \
|
2017-05-08 00:07:28 +02:00
|
|
|
-DCMAKE_INSTALL_LIBDIR=$(PREFIX)/lib64 -DLIB_SUFFIX=64 \
|
2016-10-08 20:28:34 -04:00
|
|
|
-H$(SRCDIR)/thirdparty/$@ \
|
2017-03-12 16:53:14 -03:00
|
|
|
-B$(BUILDDIR)/thirdparty/$@ $(CMAKE_OPTS)
|
2016-10-13 22:15:28 -04:00
|
|
|
make -C$(BUILDDIR)/thirdparty/$@
|
|
|
|
|
2017-06-13 02:51:11 +02:00
|
|
|
$(addprefix install-,$(REQS)): install-%: %
|
2016-10-13 22:15:28 -04:00
|
|
|
make -C$(BUILDDIR)/thirdparty/$(@:install-%=%) install
|
|
|
|
ldconfig
|
|
|
|
|
2017-06-13 02:51:11 +02:00
|
|
|
$(addprefix clean-,$(REQS)):
|
|
|
|
if [ -d $(BUILDDIR)/thirdparty/$(@:clean-%=%) ]; then make -C$(BUILDDIR)/thirdparty/$(@:clean-%=%) clean; fi
|
2016-10-13 22:15:28 -04:00
|
|
|
|
2017-06-13 02:51:11 +02:00
|
|
|
install-thirdparty: $(addprefix install-,$(REQS))
|
2016-10-08 20:28:34 -04:00
|
|
|
|
2017-06-13 02:51:11 +02:00
|
|
|
clean-thirdparty: $(addprefix clean-,$(REQS))
|
2016-10-13 19:53:30 -04:00
|
|
|
|
2016-10-13 22:15:28 -04:00
|
|
|
# libconfig's build system is currently broken.
|
2016-10-13 22:12:44 -04:00
|
|
|
# This is a workaround for: https://github.com/hyperrealm/libconfig/issues/53
|
|
|
|
libconfig: | libconfig-fix
|
|
|
|
libconfig-fix:
|
2017-03-06 12:16:33 -04:00
|
|
|
rm -f $(SRCDIR)/thirdparty/libconfig/lib/scanner.[hc]
|
|
|
|
|
2017-04-03 08:58:49 +02:00
|
|
|
libwebsockets: CMAKE_OPTS += -DLWS_IPV6=1 -DLWS_WITH_STATIC=0 -DLWS_WITHOUT_TESTAPPS=1 -DLWS_WITH_HTTP2=1
|
2017-06-13 02:51:11 +02:00
|
|
|
libzmq: CONFIGURE_OPTS += --with-libsodium --with-pgm --enable-drafts
|
2017-03-12 16:53:14 -03:00
|
|
|
|
2017-06-13 02:51:11 +02:00
|
|
|
.PHONY: $(REQS) thirdparty clean-thirdparty install-thirdparty
|