Fix issues reported by coverity
[vpp.git] / vpp-api / Makefile.am
1 AUTOMAKE_OPTIONS = foreign
2 SUBDIRS = python java
3
4 api_json_dir = $(abs_builddir)/vpp-api
5 api_srcs:=$(shell find $(prefix)/../ -name '*.api')
6 api_json:=$(patsubst %.api,$(api_json_dir)/%.api.json,$(notdir $(api_srcs)))
7
8 define define_compile_rules
9 $(api_json_dir)/%.api.json: $(1)%.api
10         @echo " + Generating '$$<'"
11         @mkdir -p $$(@D)
12         $(CC) $$(CPPFLAGS) -E -P -C -x c $$< | vppapigen --input - --json $$@
13 endef
14
15 $(foreach directory,$(dir $(api_srcs)),$(eval $(call define_compile_rules,$(directory))))
16
17 BUILT_SOURCES = $(api_json)