summaryrefslogtreecommitdiffstats
path: root/generator/Makefile.am
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-09-11 13:20:59 +0100
committerRichard Jones <rjones@redhat.com>2010-09-11 13:42:00 +0100
commit67fd3a7d99f3001aaf90682e102eba6708d8337a (patch)
tree82a729eb21391bc70034629819273a25c3b5e685 /generator/Makefile.am
parent2fbac04b9de826fb49400a1fc7a97262b76d078e (diff)
downloadlibguestfs-67fd3a7d99f3001aaf90682e102eba6708d8337a.tar.gz
libguestfs-67fd3a7d99f3001aaf90682e102eba6708d8337a.tar.xz
libguestfs-67fd3a7d99f3001aaf90682e102eba6708d8337a.zip
generator: Provide no-op generator if no OCaml compiler.
Diffstat (limited to 'generator/Makefile.am')
-rw-r--r--generator/Makefile.am16
1 files changed, 16 insertions, 0 deletions
diff --git a/generator/Makefile.am b/generator/Makefile.am
index 919fb502..f6dfd6b7 100644
--- a/generator/Makefile.am
+++ b/generator/Makefile.am
@@ -56,6 +56,8 @@ OCAMLCLIBS = xml-light.cma unix.cma str.cma
noinst_PROGRAM = generator
+if HAVE_OCAML
+
generator: $(OBJECTS)
$(OCAMLC) -o generator $(OCAMLCFLAGS) $(OCAMLCLIBS) $(OBJECTS)
@@ -74,6 +76,20 @@ depend: .depend
include .depend
+else
+
+# No OCaml compiler. Just replace the generator with a script that
+# touches stamp-generator and prints a warning.
+
+generator: $(SOURCES)
+ rm -f $@ $@-t
+ echo 'echo Warning: Install OCaml compiler in order to rebuild the generated files.' >> $@-t
+ echo 'touch generator/stamp-generator' >> $@-t
+ chmod +x $@-t
+ mv $@-t $@
+
+endif
+
noinst_DATA = stamp-generator
# Run the generator.