# Shared suffix rules
# Please do not set "SUFFIXES = .api.h .api" here
+VPPAPIGEN = $(top_srcdir)/tools/vppapigen/vppapigen
%.api.h: %.api
- @echo " APIGEN " $@ ; \
- mkdir -p `dirname $@` ; \
- $(CC) $(CPPFLAGS) -E -P -C -x c $^ \
- | vppapigen --input - --output $@ --show-name $@
+ @echo " APIGEN " $@ ; \
+ mkdir -p `dirname $@` ; \
+ $(VPPAPIGEN) --includedir $(top_srcdir) --input $< --output $@
%.api.json: %.api
- @echo " JSON APIGEN " $@ ; \
- mkdir -p `dirname $@` ; \
- $(CC) $(CPPFLAGS) -E -P -C -x c $^ \
- | vppapigen --input - --json $@
+ @echo " JSON API" $@ ; \
+ mkdir -p `dirname $@` ; \
+ $(VPPAPIGEN) --includedir $(top_srcdir) --input $< JSON --output $@