codegen: Internally generated delegates don't require a typedef
[vala-gnome.git] / vapigen / Makefile.vapigen
blob03fb2e4c688219abc9b65601b80686d4b4f2fba8
1 # Makefile for Vala API Generator (vapigen)
2 # Written by Evan Nemerson
4 # The author disclaims copyright to this source code.  In place of
5 # a legal notice, here is a blessing:
7 #    May you do good and not evil.
8 #    May you find forgiveness for yourself and forgive others.
9 #    May you share freely, never taking more than you give.
11 # See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
13 # Variables:
15 #   VAPIGEN_FILES
17 #     VAPIs to create
19 #   *_DEPS / VAPIGEN_DEPS
21 #       The dependencies. Generally the pkg-config names.
23 #   *_METADATADIRS / VAPIGEN_METADATADIRS
25 #       Directory containing the metadata.
27 #   *_VAPIDIRS / VAPIGEN_VAPIDIRS
29 #       Additional location(s) to search for VAPI dependencies.
31 #   *_GIRDIRS / VAPIGEN_GIRDIRS
33 #       Additional location(s) to search for GIR dependencies.
35 #   *_FILES
37 #       The files which should be used to generate the VAPI.
39 _vapigen_silent_prefix = $(_vapigen_silent_prefix_$(V))
40 _vapigen_silent_prefix_ = $(_vapigen_silent_prefix_$(AM_DEFAULT_VERBOSITY))
41 _vapigen_silent_prefix_0 = @echo " VAPIGEN $(1)";
42 _vapigen_silent_opts = $(_vapigen_silent_opts_$(V))
43 _vapigen_silent_opts_ = $(_vapigen_silent_opts_$(AM_DEFAULT_VERBOSITY))
44 _vapigen_silent_opts_0 = --quiet
46 $(if $(VAPIGEN),,$(error You must define VAPIGEN))
48 _vapi_name = $(subst /,_,$(subst -,_,$(subst .,_,$(1))))
50 define vapigen
51 $(1): $$($(_vapi_name)_GIR)
52         $(_vapigen_silent_prefix) $(VAPIGEN) $(_vapigen_silent_opts) \
53           --library $(1:.vapi=) \
54           $(foreach _vapi_metadatadir_name,$(if $($(_vapi_name)_METADATADIRS),$($(_vapi_name)_METADATADIRS),$(VAPIGEN_METADATADIRS)),--metadatadir $(_vapi_metadatadir_name)) \
55           $(foreach _vapi_dir_name,$(if $($(_vapi_name)_VAPIDIRS),$($(_vapi_name)_VAPIDIRS),$(VAPIGEN_VAPIDIRS)),--vapidir $(_vapi_dir_name)) \
56           $(foreach _gir_dir_name,$(if $($(_vapi_name)_GIRDIRS),$($(_vapi_name)_GIRDIRS),$(VAPIGEN_GIRDIRS)),--girdir $(_gir_dir_name)) \
57           $(foreach _vapi_dep_name,$(if $($(_vapi_name)_DEPS),$($(_vapi_name)_DEPS),$(VAPIGEN_DEPS)),--pkg $(_vapi_dep_name)) \
58           $$($(_vapi_name)_FILES)
59 endef
61 $(foreach vapi,$(VAPIGEN_VAPIS),$(eval $(call vapigen,$(vapi))))