* Builds and installs a new restconf library: libclixon_restconf.so and clixon_restconf.h * The restconf library can be included by a restconf plugin. * Example code in example/Makefile.in and example/restconf_lib.c * Authorization * Example extended with authorization * Test added with http basic authorization (test/test_auth.sh) * Documentation in FAQ.md * README.md extended with new yang, netconf, restconf, datastore, and auth sections.
140 lines
4.6 KiB
Makefile
140 lines
4.6 KiB
Makefile
#
|
|
# ***** BEGIN LICENSE BLOCK *****
|
|
#
|
|
# Copyright (C) 2009-2018 Olof Hagsand and Benny Holmgren
|
|
#
|
|
# This file is part of CLIXON
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
# Alternatively, the contents of this file may be used under the terms of
|
|
# the GNU General Public License Version 3 or later (the "GPL"),
|
|
# in which case the provisions of the GPL are applicable instead
|
|
# of those above. If you wish to allow use of your version of this file only
|
|
# under the terms of the GPL, and not to allow others to
|
|
# use your version of this file under the terms of Apache License version 2,
|
|
# indicate your decision by deleting the provisions above and replace them with
|
|
# the notice and other provisions required by the GPL. If you do not delete
|
|
# the provisions above, a recipient may use your version of this file under
|
|
# the terms of any one of the Apache License version 2 or the GPL.
|
|
#
|
|
# ***** END LICENSE BLOCK *****
|
|
#
|
|
VPATH = @srcdir@
|
|
srcdir = @srcdir@
|
|
top_srcdir = @top_srcdir@
|
|
prefix = @prefix@
|
|
bindir = @bindir@
|
|
includedir = @includedir@
|
|
datarootdir = @datarootdir@
|
|
|
|
APPNAME = routing
|
|
CC = @CC@
|
|
CFLAGS = @CFLAGS@ -rdynamic -fPIC
|
|
|
|
INCLUDES = -I$(includedir) @INCLUDES@
|
|
|
|
BE_PLUGIN = $(APPNAME)_backend.so
|
|
CLI_PLUGIN = $(APPNAME)_cli.so
|
|
NETCONF_PLUGIN = $(APPNAME)_netconf.so
|
|
RESTCONF_PLUGIN = $(APPNAME)_restconf.so
|
|
|
|
PLUGINS = $(BE_PLUGIN) $(CLI_PLUGIN) $(NETCONF_PLUGIN) $(RESTCONF_PLUGIN)
|
|
|
|
all: $(PLUGINS)
|
|
|
|
# Note: clixon.mk has a rule for:
|
|
# $(APPNAME.conf)
|
|
-include $(DESTDIR)$(datarootdir)/clixon/clixon.mk
|
|
|
|
CLISPECS = routing_cli.cli
|
|
|
|
#YANGSPECS = $(APPNAME).yang
|
|
YANGSPECS += ietf-yang-types@2013-07-15.yang
|
|
YANGSPECS += ietf-inet-types@2013-07-15.yang
|
|
YANGSPECS += ietf-interfaces@2014-05-08.yang
|
|
YANGSPECS += ietf-ip@2014-06-16.yang
|
|
YANGSPECS += ietf-routing@2014-10-26.yang
|
|
YANGSPECS += ietf-ipv4-unicast-routing@2014-10-26.yang
|
|
YANGSPECS += ietf-ipv6-unicast-routing@2014-10-26.yang
|
|
YANGSPECS += ietf-ipsec@2016-03-09.yang
|
|
YANGSPECS += example.yang
|
|
|
|
# Backend plugin
|
|
BE_SRC = routing_backend.c
|
|
BE_OBJ = $(BE_SRC:%.c=%.o)
|
|
$(BE_PLUGIN): $(BE_OBJ)
|
|
$(CC) -Wall -shared -o $@ -lc $<
|
|
|
|
# CLI frontend plugin
|
|
CLI_SRC = routing_cli.c
|
|
CLI_OBJ = $(CLI_SRC:%.c=%.o)
|
|
$(CLI_PLUGIN): $(CLI_OBJ)
|
|
$(CC) -Wall -shared -o $@ -lc $^
|
|
|
|
# NETCONF frontend plugin
|
|
NETCONF_SRC = routing_netconf.c
|
|
NETCONF_OBJ = $(NETCONF_SRC:%.c=%.o)
|
|
$(NETCONF_PLUGIN): $(NETCONF_OBJ)
|
|
$(CC) -Wall -shared -o $@ -lc $^
|
|
|
|
# RESTCONF frontend plugin
|
|
RESTCONF_SRC = routing_restconf.c
|
|
RESTCONF_OBJ = $(RESTCONF_SRC:%.c=%.o)
|
|
$(RESTCONF_PLUGIN): $(RESTCONF_OBJ)
|
|
$(CC) -Wall -shared -o $@ -lc $^
|
|
|
|
SRC = $(BE_SRC) $(CLI_SRC) $(NETCONF_SRC) $(RESTCONF_SRC)
|
|
OBJS = $(BE_OBJ) $(CLI_OBJ) $(NETCONF_OBJ) $(RESTCONF_OBJ)
|
|
|
|
clean:
|
|
rm -f $(PLUGINS) $(OBJS)
|
|
(cd docker && $(MAKE) $(MFLAGS) $@)
|
|
|
|
distclean: clean
|
|
rm -f Makefile *~ .depend
|
|
(cd docker && $(MAKE) $(MFLAGS) $@)
|
|
|
|
install: $(YANGSPECS) $(CLISPECS) $(BE_PLUGIN) $(CLI_PLUGIN) $(NETCONF_PLUGIN) $(RESTCONF_PLUGIN) $(APPNAME).xml
|
|
install -d $(DESTDIR)$(clixon_SYSCONFDIR)
|
|
install $(APPNAME).xml $(DESTDIR)$(clixon_SYSCONFDIR)
|
|
install -d $(DESTDIR)$(clixon_DBSPECDIR)/yang
|
|
install $(YANGSPECS) $(DESTDIR)$(clixon_DBSPECDIR)/yang
|
|
install -d $(DESTDIR)$(clixon_LIBDIR)/cli
|
|
install $(CLI_PLUGIN) $(DESTDIR)$(clixon_LIBDIR)/cli;
|
|
install -d $(DESTDIR)$(clixon_LIBDIR)/backend
|
|
install $(BE_PLUGIN) $(DESTDIR)$(clixon_LIBDIR)/backend;
|
|
install -d $(DESTDIR)$(clixon_LIBDIR)/netconf
|
|
install $(NETCONF_PLUGIN) $(DESTDIR)$(clixon_LIBDIR)/netconf;
|
|
install -d $(DESTDIR)$(clixon_LIBDIR)/restconf
|
|
install $(RESTCONF_PLUGIN) $(DESTDIR)$(clixon_LIBDIR)/restconf;
|
|
install -d $(DESTDIR)$(clixon_LIBDIR)/clispec
|
|
install $(CLISPECS) $(DESTDIR)$(clixon_LIBDIR)/clispec;
|
|
install -d $(DESTDIR)$(clixon_LOCALSTATEDIR)
|
|
(cd docker && $(MAKE) $(MFLAGS) $@)
|
|
|
|
uninstall:
|
|
rm -rf $(DESTDIR)$(clixon_SYSCONFDIR)/$(APPNAME).xml
|
|
rm -rf $(DESTDIR)$(clixon_DBSPECDIR)
|
|
rm -rf $(DESTDIR)$(clixon_LOCALSTATEDIR)
|
|
rm -rf $(DESTDIR)$(clixon_LIBDIR)
|
|
(cd docker && $(MAKE) $(MFLAGS) $@)
|
|
|
|
install-include:
|
|
|
|
depend:
|
|
$(CC) $(DEPENDFLAGS) $(INCLUDES) $(CFLAGS) -MM $(SRC) > .depend
|
|
(cd docker && $(MAKE) $(MFLAGS) $@)
|
|
|
|
#include .depend
|
|
|