Add config option to use dlmalloc instead of mheap
[vpp.git] / src / examples / sample-plugin / Makefile.am
index a3a9a8d..2622f4e 100644 (file)
@@ -13,7 +13,7 @@
 
 AUTOMAKE_OPTIONS = foreign subdir-objects
 
-AM_CFLAGS = -Wall -I${top_srcdir} -I${top_builddir}
+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
@@ -31,15 +31,14 @@ vpppluginsdir = ${libdir}/vpp_plugins
 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)/api/plugins
 apiincludedir = ${includedir}/vpp_plugins