blob: 310bd2321ebd17a22fb488ea361eb0d1b3782828 [file] [log] [blame]
Ole Troan6855f6c2016-04-09 03:16:30 +02001AUTOMAKE_OPTIONS = foreign
Marek Gradzkid85036f2016-04-26 12:09:05 +02002SUBDIRS = python java
Dave Barach557d1282016-11-10 14:22:49 -05003
4api_json_dir = $(abs_builddir)/vpp-api
5api_srcs:=$(shell find $(prefix)/../ -name '*.api')
6api_json:=$(patsubst %.api,$(api_json_dir)/%.api.json,$(notdir $(api_srcs)))
7
8define 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 $$@
13endef
14
15$(foreach directory,$(dir $(api_srcs)),$(eval $(call define_compile_rules,$(directory))))
16
17BUILT_SOURCES = $(api_json)