# # Copyright (C) 2009-2016 Olof Hagsand and Benny Holmgren # # This file is part of CLIXON. # # CLIXON 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 # (at your option) any later version. # # CLIXON 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 CLIXON; see the file LICENSE. If not, see # . # 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 PLUGINS = $(BE_PLUGIN) $(CLI_PLUGIN) $(NETCONF_PLUGIN) all: $(PLUGINS) $(APPNAME).conf # 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 # Backend plugin BE_SRC = routing_backend.c BE_OBJ = $(BE_SRC:%.c=%.o) $(BE_PLUGIN): $(BE_OBJ) $(CC) -shared -o $@ -lc $< # CLI frontend plugin CLI_SRC = routing_cli.c CLI_OBJ = $(CLI_SRC:%.c=%.o) $(CLI_PLUGIN): $(CLI_OBJ) $(CC) -shared -o $@ -lc $^ # NETCONF frontend plugin NETCONF_SRC = routing_netconf.c NETCONF_OBJ = $(NETCONF_SRC:%.c=%.o) $(NETCONF_PLUGIN): $(NETCONF_OBJ) $(CC) -shared -o $@ -lc $^ SRC = $(BE_SRC) $(CLI_SRC) $(NETCONF_SRC) OBJS = $(BE_OBJ) $(CLI_OBJ) $(NETCONF_OBJ) clean: rm -f $(PLUGINS) $(OBJS) $(APPNAME).conf (cd docker && $(MAKE) $(MFLAGS) $@) distclean: clean rm -f Makefile *~ .depend (cd docker && $(MAKE) $(MFLAGS) $@) install: $(YANGSPECS) $(CLISPECS) $(BE_PLUGIN) $(CLI_PLUGIN) $(NETCONF_PLUGIN) $(APPNAME).conf install -d $(DESTDIR)$(clixon_SYSCONFDIR) install $(APPNAME).conf $(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)/clispec install $(CLISPECS) $(DESTDIR)$(clixon_LIBDIR)/clispec; install -d $(DESTDIR)$(clixon_LOCALSTATEDIR) (cd docker && $(MAKE) $(MFLAGS) $@) uninstall: rm -rf $(DESTDIR)$(clixon_SYSCONFDIR)/$(APPNAME).conf 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