summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am8
-rwxr-xr-xconfigure.ac2
-rw-r--r--vtysh/.gitignore2
-rw-r--r--vtysh/Makefile10
-rwxr-xr-xvtysh/extract.pl.in4
-rw-r--r--vtysh/subdir.am (renamed from vtysh/Makefile.am)51
6 files changed, 47 insertions, 30 deletions
diff --git a/Makefile.am b/Makefile.am
index 080206855..96d4a3440 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -125,12 +125,13 @@ include pbrd/subdir.am
include staticd/subdir.am
include bfdd/subdir.am
+include vtysh/subdir.am
+
SUBDIRS = . \
- @VTYSH@ \
tests
DIST_SUBDIRS = . \
- vtysh tests \
+ tests \
# end
if PKGSRC
@@ -169,9 +170,6 @@ EXTRA_DIST += \
snapcraft/helpers \
snapcraft/snap \
\
- vtysh/Makefile.am \
- vtysh/Makefile.in \
- \
doc/Makefile \
doc/developer/Makefile \
doc/manpages/Makefile \
diff --git a/configure.ac b/configure.ac
index 837a4f225..45a571b4c 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1455,7 +1455,6 @@ fi
AM_CONDITIONAL([ENABLE_BGP_VNC], [test x${enable_bgp_vnc} != xno])
AC_SUBST(SOLARIS)
-AC_SUBST(VTYSH)
AC_SUBST(CURSES)
AC_CHECK_LIB(crypt, crypt, [],
[AC_CHECK_LIB(crypto, DES_crypt)])
@@ -2009,7 +2008,6 @@ AC_MSG_RESULT($ac_cv_htonl_works)
AC_CONFIG_FILES([Makefile],[sed -e 's/^#AUTODERP# //' -i Makefile])
AC_CONFIG_FILES([
- vtysh/Makefile
tests/Makefile
redhat/frr.spec
solaris/Makefile
diff --git a/vtysh/.gitignore b/vtysh/.gitignore
index 5856eac25..e63d1e2de 100644
--- a/vtysh/.gitignore
+++ b/vtysh/.gitignore
@@ -1,4 +1,4 @@
-Makefile
+!Makefile
Makefile.in
*.o
vtysh
diff --git a/vtysh/Makefile b/vtysh/Makefile
new file mode 100644
index 000000000..07e093b0f
--- /dev/null
+++ b/vtysh/Makefile
@@ -0,0 +1,10 @@
+all: ALWAYS
+ @$(MAKE) -s -C .. vtysh/vtysh
+%: ALWAYS
+ @$(MAKE) -s -C .. vtysh/$@
+
+Makefile:
+ #nothing
+ALWAYS:
+.PHONY: ALWAYS makefiles
+.SUFFIXES:
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in
index 690e9a12c..0f68e58d6 100755
--- a/vtysh/extract.pl.in
+++ b/vtysh/extract.pl.in
@@ -29,7 +29,7 @@ print <<EOF;
#include "command.h"
#include "linklist.h"
-#include "vtysh.h"
+#include "vtysh/vtysh.h"
EOF
@@ -40,7 +40,7 @@ sub scan_file {
$cppadd = $fabricd ? "-DFABRICD=1" : "";
- open (FH, "@CPP@ -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -I@top_builddir@ -I@srcdir@/ -I@srcdir@/.. -I@top_srcdir@/lib -I@top_builddir@/lib -I@top_srcdir@/bgpd -I@top_srcdir@/@LIBRFP@ -I@top_srcdir@/bgpd/rfapi @CPPFLAGS@ $cppadd $file |");
+ open (FH, "@CPP@ -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -Ivtysh/@top_builddir@ -Ivtysh/@top_srcdir@ -Ivtysh/@top_srcdir@/lib -Ivtysh/@top_builddir@/lib -Ivtysh/@top_srcdir@/bgpd -Ivtysh/@top_srcdir@/bgpd/rfapi @CPPFLAGS@ $cppadd $file |");
local $/; undef $/;
$line = <FH>;
close (FH);
diff --git a/vtysh/Makefile.am b/vtysh/subdir.am
index b8e4e3987..ca288ea9e 100644
--- a/vtysh/Makefile.am
+++ b/vtysh/subdir.am
@@ -1,25 +1,31 @@
-## Process this file with Automake to create Makefile.in
+#
+# vtysh
+#
-include ../common.am
-
-AM_CPPFLAGS += -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib \
- $(BGP_VNC_RFAPI_INCDIR) $(BGP_VNC_RFP_INCDIR)
-DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
-
-LIBS = @LIBS@ @CURSES@ @LIBPAM@
+if VTYSH
+bin_PROGRAMS += vtysh/vtysh
+dist_examples_DATA += vtysh/vtysh.conf.sample
+endif
-bin_PROGRAMS = vtysh
+vtysh_vtysh_SOURCES = \
+ vtysh/vtysh_main.c \
+ vtysh/vtysh.c \
+ vtysh/vtysh_user.c \
+ vtysh/vtysh_config.c \
+ # end
+nodist_vtysh_vtysh_SOURCES = \
+ vtysh/vtysh_cmd.c \
+ # end
+CLEANFILES += vtysh/vtysh_cmd.c
-vtysh_SOURCES = vtysh_main.c vtysh.c vtysh_user.c vtysh_config.c
-nodist_vtysh_SOURCES = vtysh_cmd.c
-CLEANFILES = vtysh_cmd.c
-noinst_HEADERS = vtysh.h vtysh_user.h
-vtysh_LDADD = ../lib/libfrr.la @LIBCAP@ @LIBREADLINE@
+noinst_HEADERS += \
+ vtysh/vtysh.h \
+ vtysh/vtysh_user.h \
+ # end
-examplesdir = $(exampledir)
-dist_examples_DATA = vtysh.conf.sample
+vtysh_vtysh_LDADD = lib/libfrr.la @LIBCAP@ @LIBREADLINE@ @LIBS@ @CURSES@ @LIBPAM@
-EXTRA_DIST = extract.pl
+EXTRA_DIST += vtysh/extract.pl
vtysh_scan =
@@ -147,7 +153,7 @@ if BFDD
vtysh_scan += $(top_srcdir)/bfdd/bfdd_vty.c
endif
-vtysh_cmd_FILES = $(vtysh_scan) \
+vtysh_vtysh_cmd_FILES = $(vtysh_scan) \
$(top_srcdir)/lib/keychain.c $(top_srcdir)/lib/routemap.c \
$(top_srcdir)/lib/filter.c $(top_srcdir)/lib/plist.c \
$(top_srcdir)/lib/distribute.c $(top_srcdir)/lib/if_rmap.c \
@@ -167,5 +173,10 @@ vtysh_cmd_FILES = $(vtysh_scan) \
$(top_srcdir)/watchfrr/watchfrr_vty.c \
# end
-vtysh_cmd.c: $(vtysh_cmd_FILES) extract.pl
- ./extract.pl $(vtysh_cmd_FILES) > vtysh_cmd.c
+AM_V_EXTRACT = $(am__v_EXTRACT_$(V))
+am__v_EXTRACT_ = $(am__v_EXTRACT_$(AM_DEFAULT_VERBOSITY))
+am__v_EXTRACT_0 = @echo " EXTRACT " $@;
+am__v_EXTRACT_1 =
+
+vtysh/vtysh_cmd.c: $(vtysh_vtysh_cmd_FILES) vtysh/extract.pl
+ $(AM_V_EXTRACT) vtysh/extract.pl $(vtysh_vtysh_cmd_FILES) > vtysh/vtysh_cmd.c