diff --git a/Makefile.am b/Makefile.am index 080206855e..96d4a34409 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 837a4f2252..45a571b4c1 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 5856eac253..e63d1e2dee 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 0000000000..07e093b0f5 --- /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 690e9a12c6..0f68e58d62 100755 --- a/vtysh/extract.pl.in +++ b/vtysh/extract.pl.in @@ -29,7 +29,7 @@ print <; close (FH); diff --git a/vtysh/Makefile.am b/vtysh/subdir.am similarity index 84% rename from vtysh/Makefile.am rename to vtysh/subdir.am index b8e4e3987c..ca288ea9e4 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 +if VTYSH +bin_PROGRAMS += vtysh/vtysh +dist_examples_DATA += vtysh/vtysh.conf.sample +endif -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)/\" +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 -LIBS = @LIBS@ @CURSES@ @LIBPAM@ +noinst_HEADERS += \ + vtysh/vtysh.h \ + vtysh/vtysh_user.h \ + # end -bin_PROGRAMS = vtysh +vtysh_vtysh_LDADD = lib/libfrr.la @LIBCAP@ @LIBREADLINE@ @LIBS@ @CURSES@ @LIBPAM@ -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@ - -examplesdir = $(exampledir) -dist_examples_DATA = vtysh.conf.sample - -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