X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fexamples%2Fsample-plugin%2FMakefile.am;h=2622f4e69f9565191ea2c3c272461df334ce0bf2;hb=6a5adc369591fcac2447e9809deaa22f56b53911;hp=e221f8c1aa934c40b67b806ff355182f8a8fbaad;hpb=cb034b9b374927c7552e36dcbc306d8456b2a0cb;p=vpp.git diff --git a/src/examples/sample-plugin/Makefile.am b/src/examples/sample-plugin/Makefile.am index e221f8c1aa9..2622f4e69f9 100644 --- a/src/examples/sample-plugin/Makefile.am +++ b/src/examples/sample-plugin/Makefile.am @@ -13,44 +13,46 @@ AUTOMAKE_OPTIONS = foreign subdir-objects -AM_CFLAGS = -Wall +AM_CFLAGS = -Wall -I${top_srcdir} -I${top_builddir} @DLMALLOC@ AM_LDFLAGS = -module -shared -avoid-version +AM_LIBTOOLFLAGS = --quiet +SUFFIXES = .api.h .api .api.json +API_FILES = +BUILT_SOURCES = +vppplugins_LTLIBRARIES = +vppapitestplugins_LTLIBRARIES = +noinst_HEADERS = +nobase_apiinclude_HEADERS = +ACLOCAL_AMFLAGS = -I m4 vppapitestpluginsdir = ${libdir}/vpp_api_test_plugins vpppluginsdir = ${libdir}/vpp_plugins -vppapitestplugins_LTLIBRARIES = sample_test_plugin.la -vppplugins_LTLIBRARIES = sample_plugin.la - -sample_plugin_la_SOURCES = sample/sample.c sample/node.c \ - sample/sample_plugin.api.h - -BUILT_SOURCES = sample/sample.api.h sample/sample.api.json - -SUFFIXES = .api.h .api +include sample.am %.api.h: %.api - mkdir -p `dirname $@` ; \ - $(CC) $(CPPFLAGS) -E -P -C -x c $^ \ - | vppapigen --input - --output $@ --show-name $@ + @echo " APIGEN " $@ ; \ + mkdir -p `dirname $@` ; \ + vppapigen --input $^ --output $@ %.api.json: %.api - @echo " JSON APIGEN " $@ ; \ - mkdir -p `dirname $@` ; \ - $(CC) $(CPPFLAGS) -E -P -C -x c $^ \ - | vppapigen --input - --json $@ + @echo " JSON APIGEN " $@ ; \ + mkdir -p `dirname $@` ; \ + vppapigen --input $^ JSON --output $@ -apidir = $(prefix)/sample/ -api_DATA = sample.api.json +apidir = $(prefix)/api/plugins +apiincludedir = ${includedir}/vpp_plugins -noinst_HEADERS = \ - sample/sample_all_api_h.h \ - sample/sample_msg_enum.h \ - sample/sample.api.h +api_DATA = \ + $(patsubst %.api,%.api.json,$(API_FILES)) + +BUILT_SOURCES += \ + $(patsubst %.api,%.api.h,$(API_FILES)) -sample_test_plugin_la_SOURCES = sample/sample_test.c sample/sample_plugin.api.h # Remove *.la files install-data-hook: @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES)) @(cd $(vppapitestpluginsdir) && $(RM) $(vppapitestplugins_LTLIBRARIES)) + +CLEANFILES = $(BUILT_SOURCES)