40
40
# Lists of qualified file names relative to the current directory.
41
41
binding_relfiles_m4 = $(addprefix $(codegen_m4_srcdir)/,$(files_codegen_m4))
42
42
binding_relfiles_hg = $(addprefix $(srcdir)/,$(files_hg))
43
binding_stampfiles = $(files_hg:%.hg=$(binding_stampdir)/%.stamp)
43
binding_stampfiles = $(patsubst %.hg,$(binding_stampdir)/%.stamp,$(files_hg))
45
45
# Distributed code generation source files.
46
46
dist_noinst_DATA = $(files_defs) $(files_hg) $(files_ccg)
57
57
gen_wrap_init ?= $(PERL) -- "$(GMMPROC_DIR)/generate_wrap_init.pl"
58
58
gmmproc_flags ?= -I $(codegen_m4_srcdir) --defs $(srcdir)
60
# Automatically created output directories.
61
binding_mkdirs = $(binding_stampdir) $(binding_outputdir)/private
63
# Show names of generated files in silent rules output.
64
mm_0_gen = @echo ' GEN $(binding_outputdir)/{$*.cc,$*.h,private/$*_p.h}';
65
mm_v_gen = $(if $(filter 0,$(or $(V),$(AM_DEFAULT_VERBOSITY))),$(mm_0_gen))
60
67
# Declare the built sources main targets.
61
68
all-local: $(binding_stampfiles) $(other_built_sources)
63
# Create the .stamps/ subdirectory if it does not exist already.
70
# Create the output directories if they do not exist already.
72
$(AM_V_at)$(MKDIR_P) $@
67
74
# Generate the wrap_init.cc file using generate_wrap_init.pl.
68
$(binding_outputdir)/wrap_init.cc: $(binding_relfiles_hg)
69
$(gen_wrap_init) $(wrap_init_flags) $(binding_relfiles_hg) >$@
75
$(binding_outputdir)/wrap_init.cc: $(binding_relfiles_hg) $(srcdir)/Makefile.in
76
$(AM_V_GEN)$(gen_wrap_init) $(wrap_init_flags) $(binding_relfiles_hg) >$@
71
78
# Run the gmmproc code generator to produce the C++ binding code.
72
$(binding_stampdir)/%.stamp: %.hg %.ccg $(gmmproc_dependencies) | $(binding_stampdir)
79
$(binding_stampdir)/%.stamp: %.hg %.ccg $(gmmproc_dependencies) | $(binding_mkdirs)
74
$(gmmproc) $(gmmproc_flags) $(notdir $*) $(srcdir) $(binding_outputdir)
81
$(mm_v_gen)$(gmmproc) $(gmmproc_flags) $* $(srcdir) $(binding_outputdir)
76
83
# Instruct GNU make to delete the targets of a rule after it failed, in
77
84
# order to avoid the complication of handling that situation manually.