summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2010-05-28 00:39:44 -0700
committerDavid Schleef <ds@schleef.org>2010-05-28 00:40:42 -0700
commit09d712f48d7fe1c3a34ce7d9eb6ad39dea90a358 (patch)
treeea40dc19c19cd5364d608228cf0b73f8faa09f99
parentfd7ca04c3d583586cb06b5323d0790e131804482 (diff)
Add a makefile fragment for Orc
Not updating all the modules, because it's only used on the Orc branch for now.
-rw-r--r--orc.mk58
1 files changed, 58 insertions, 0 deletions
diff --git a/orc.mk b/orc.mk
new file mode 100644
index 0000000..11176e8
--- /dev/null
+++ b/orc.mk
@@ -0,0 +1,58 @@
+#
+# This is a makefile.am fragment to build Orc code.
+#
+# Define ORC_BASE and then include this file, such as:
+#
+# ORC_BASE=adder
+# include $(top_srcdir)/common/orc.mk
+#
+# This fragment will create adderorc.c adderorc.h from adder.orc.
+#
+# When 'make dist' is run at the top level, or 'make orc-update'
+# in a directory including this fragment, the generated source
+# files will be copied to $(ORC_BASE)orc-dist.[ch]. These files
+# should be checked in to git, since they are used if Orc is
+# disabled.
+#
+#
+
+ORC_SOURCES = $(ORC_BASE)orc.c $(ORC_BASE)orc.h
+
+#EXTRA_DIST = $(ORC_BASE).orc $(ORC_BASE)orc.c $(ORC_BASE)orc.h
+
+BUILT_SOURCES = $(ORC_SOURCES)
+
+
+orc-update: $(ORC_BASE)orc.c $(ORC_BASE)orc.h
+ cp $(ORC_BASE)orc.c $(srcdir)/$(ORC_BASE)orc-dist.c
+ $(top_srcdir)/common/gst-indent $(srcdir)/$(ORC_BASE)orc-dist.c
+ cp $(ORC_BASE)orc.h $(srcdir)/$(ORC_BASE)orc-dist.h
+
+
+if HAVE_ORC
+$(ORC_BASE)orc.c: $(srcdir)/$(ORC_BASE).orc
+ $(ORCC) --implementation --include glib.h -o $(ORC_BASE)orc.c $(srcdir)/$(ORC_BASE).orc
+
+$(ORC_BASE)orc.h: $(srcdir)/$(ORC_BASE).orc
+ $(ORCC) --header --include glib.h -o $(ORC_BASE)orc.h $(srcdir)/$(ORC_BASE).orc
+else
+$(ORC_BASE)orc.c: $(srcdir)/$(ORC_BASE).orc
+ cp $(srcdir)/$(ORC_BASE)orc-dist.c $(ORC_BASE)orc.c
+
+$(ORC_BASE)orc.h: $(srcdir)/$(ORC_BASE).orc
+ cp $(srcdir)/$(ORC_BASE)orc-dist.h $(ORC_BASE)orc.h
+endif
+
+
+clean-local: clean-orc
+.PHONY: clean-orc
+clean-orc:
+ rm -f $(ORC_BASE)orc.c $(ORC_BASE)orc.h
+
+dist-hook: dist-hook-orc
+.PHONY: dist-hook-orc
+dist-hook-orc: $(ORC_BASE)orc.c $(ORC_BASE)orc.h
+ cp $(ORC_BASE)orc.c $(srcdir)/$(ORC_BASE)orc-dist.c
+ $(top_srcdir)/common/gst-indent $(srcdir)/$(ORC_BASE)orc-dist.c
+ cp $(ORC_BASE)orc.h $(srcdir)/$(ORC_BASE)orc-dist.h
+