diff options
Diffstat (limited to 'cpp/gen')
-rw-r--r-- | cpp/gen/Makefile.am | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/cpp/gen/Makefile.am b/cpp/gen/Makefile.am index eea08c9570..55f55821a6 100644 --- a/cpp/gen/Makefile.am +++ b/cpp/gen/Makefile.am @@ -1,38 +1,41 @@ include gen-src.mk BUILT_SOURCES = $(generated_sources) +pkginclude_HEADERS=$(generated_headers) # Distribute the generated sources, at least for now, since # the generator code is in java. EXTRA_DIST = $(BUILT_SOURCES) MAINTAINERCLEANFILES = $(BUILT_SOURCES) +# Don't attempt to run the code generator unless configure has set +# CAN_GENERATE_CODE, indicating that the amqp.xml and tools needed +# to run the code generator are available. +# +if CAN_GENERATE_CODE + gentools_dir = $(srcdir)/../../gentools spec_dir = $(srcdir)/../../specs spec = $(spec_dir)/amqp-8.0.xml gentools_srcdir = $(gentools_dir)/src/org/apache/qpid/gentools timestamp: $(spec) $(java_sources) $(cxx_templates) -if BUILD_IN_MESSAGE_TREE rm -f $(generated_sources) cd $(gentools_srcdir) && rm -f *.class && $(JAVAC) *.java $(JAVA) -cp $(gentools_dir)/src org.apache.qpid.gentools.Main \ -c -o . -t $(gentools_dir)/templ.cpp $(spec) -else - echo "warning: failed to regenerate gen/*.{cpp,h}" 1>&2 -endif touch timestamp -EXTRA_DIST += timestamp $(generated_sources): timestamp DISTCLEANFILES = gen-src.mk gen-src.mk: timestamp - ( echo 'generated_sources = '\\ \ - && ls *.cpp *.h | sort -u | sed 's/.*/ & \\/;$$s/ \\//' \ + ( echo 'generated_sources = '\\ \ + && ls *.cpp | sort -u | sed 's/.*/ & \\/;$$s/ \\//'; \ + echo 'generated_headers = '\\ \ + && ls *.h | sort -u | sed 's/.*/ & \\/;$$s/ \\//'; \ ) > $@-t -if BUILD_IN_MESSAGE_TREE - ( echo if BUILD_IN_MESSAGE_TREE; \ + ( echo if CAN_GENERATE_CODE; \ echo 'java_sources = '\\ \ && find $(gentools_srcdir) -name '*.java' \ | sort -u | sed 's/.*/ & \\/;$$s/ \\//'; \ @@ -41,5 +44,5 @@ if BUILD_IN_MESSAGE_TREE | sort -u | sed 's/.*/ & \\/;$$s/ \\//'; \ echo endif \ ) >> $@-t -endif mv $@-t $@ +endif |