Ole Troan | 6855f6c | 2016-04-09 03:16:30 +0200 | [diff] [blame] | 1 | AUTOMAKE_OPTIONS = foreign |
Marek Gradzki | d85036f | 2016-04-26 12:09:05 +0200 | [diff] [blame] | 2 | SUBDIRS = python java |
Dave Barach | 557d128 | 2016-11-10 14:22:49 -0500 | [diff] [blame^] | 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) |