Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions hello/src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,21 @@ CPPFLAGS = @CPPFLAGS@ -fPIC
YANG_INSTALLDIR = $(datadir)/clixon/$(APPNAME)

# Local yang files to install
YANGSPECS = clixon-hello@2019-04-17.yang
YANGSPECS = clixon-hello@2024-05-25.yang

.PHONY: all clean depend install

all:
# Example backend plugin
# There may also be restconf/cli/netconf plugins which are not covered here, see
# eg clixon main example
PLUGIN = $(APPNAME)_backend_plugin.so
PLUGIN_SRC = $(APPNAME)_backend_plugin.c
PLUGIN_OBJ = $(PLUGIN_SRC:%.c=%.o)

all: $(PLUGIN)

$(PLUGIN): $(PLUGIN_OBJ)
$(CC) -Wall -shared $(LDFLAGS) -o $@ -lc $< -lclixon -lclixon_backend

.SUFFIXES: .c .o

Expand All @@ -70,23 +80,26 @@ all:
CLISPECS = $(APPNAME)_cli.cli

clean:
rm -f $(PLUGIN) $(PLUGIN_OBJ)

distclean: clean
rm -f Makefile *~ .depend

install: $(CLISPECS) $(APPNAME).xml autocli.xml
install: $(CLISPECS) $(APPNAME).xml autocli.xml $(PLUGIN)
install -d -m 0755 $(DESTDIR)$(sysconfdir)/clixon
install -d -m 0755 $(DESTDIR)$(sysconfdir)/clixon/$(APPNAME)
install -m 0644 $(APPNAME).xml $(DESTDIR)$(sysconfdir)/clixon
install -m 0644 autocli.xml $(DESTDIR)$(sysconfdir)/clixon/$(APPNAME)
install -d -m 0755 $(DESTDIR)$(libdir)/$(APPNAME)
install -d -m 0755 $(DESTDIR)$(libdir)/$(APPNAME)/clispec
install -d -m 0755 $(DESTDIR)$(libdir)/$(APPNAME)/backend
install -m 0644 $(CLISPECS) $(DESTDIR)$(libdir)/$(APPNAME)/clispec
install -d -m 0755 $(DESTDIR)$(localstatedir)
install -d -m 0755 $(DESTDIR)$(localstatedir)/$(APPNAME)
install -m 0644 startup_db $(DESTDIR)$(localstatedir)/$(APPNAME)/
install -d -m 0755 $(DESTDIR)$(YANG_INSTALLDIR)
install -m 0644 $(YANGSPECS) $(DESTDIR)$(YANG_INSTALLDIR)
install -m 0644 $(INSTALLFLAGS) $(PLUGIN) $(DESTDIR)$(libdir)/$(APPNAME)/backend

uninstall:
rm -f $(DESTDIR)$(sysconfdir)/clixon/$(APPNAME).xml
Expand Down
14 changes: 0 additions & 14 deletions hello/src/clixon-hello@2019-04-17.yang

This file was deleted.

24 changes: 24 additions & 0 deletions hello/src/clixon-hello@2024-05-25.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module clixon-hello {
yang-version 1.1;
namespace "urn:example:hello";
prefix he;
revision 2024-05-25 {
description
"Converted to an enumeration";
}
revision 2019-04-17 {
description
"Clixon hello world example";
}
container hello {
leaf to {
type enumeration {
enum city;
enum state;
enum country;
enum world;
}
description "To whom are we saying hello?";
}
}
}
1 change: 1 addition & 0 deletions hello/src/hello.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<CLICON_YANG_MODULE_MAIN>clixon-hello</CLICON_YANG_MODULE_MAIN>
<CLICON_CLI_MODE>hello</CLICON_CLI_MODE>
<CLICON_CLISPEC_DIR>@LIBDIR@/hello/clispec</CLICON_CLISPEC_DIR>
<CLICON_BACKEND_DIR>@LIBDIR@/hello/backend</CLICON_BACKEND_DIR>
<CLICON_SOCK>@LOCALSTATEDIR@/hello/hello.sock</CLICON_SOCK>
<CLICON_BACKEND_PIDFILE>@LOCALSTATEDIR@/hello/hello.pidfile</CLICON_BACKEND_PIDFILE>
<!-- true here means restconf config is in datastore -->
Expand Down
Loading