summaryrefslogtreecommitdiffstats
path: root/orc.mak
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2010-10-19 09:59:45 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2011-02-01 11:51:46 +0530
commita9d824925d55191f2599dd85f21ee278b09eb02a (patch)
tree7d64833478c97e0e305764fa709cedbbb75cb423 /orc.mak
parent548e1026e37d594fd71da405d37b7a058bf49c89 (diff)
build: Simplify Orc-related make rules
This greatly simplifies the Orc-related make rules. The old system of distributing generated files is gone, which means that anyone who wants to build with Orc support enabled needs to have the orcc compiler installed (presumably the orc 'devel' package in most distros).
Diffstat (limited to 'orc.mak')
-rw-r--r--orc.mak74
1 files changed, 24 insertions, 50 deletions
diff --git a/orc.mak b/orc.mak
index 90d403a5..5a6ff96b 100644
--- a/orc.mak
+++ b/orc.mak
@@ -1,35 +1,33 @@
#
-# This is a makefile.am fragment to build Orc code.
+# This is a Makefile.am fragment to build Orc code. It is based
+# on the orc.mak file distributed in the GStreamer common
+# repository.
#
-# Define ORC_SOURCE and then include this file, such as:
+# Include this file like this:
#
-# ORC_SOURCE=gstadderorc
-# include $(top_srcdir)/common/orc.mak
+# include $(top_srcdir)/orc.mak
#
-# This fragment will create tmp-orc.c and gstadderorc.h from
-# gstadderorc.orc.
+# For each Orc source file, append its name (without the extension)
+# to ORC_SOURCE:
#
-# 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_SOURCE)-dist.[ch]. These files
-# should be checked in to git, since they are used if Orc is
-# disabled.
+# ORC_SOURCE += gstadderorc
#
-# Note that this file defines BUILT_SOURCES, so any later usage
-# of BUILT_SOURCES in the Makefile.am that includes this file
-# must use '+='.
+# This will create gstadder-orc-gen.c and gstadder-orc-gen.h, which
+# you need to add to your nodist_module_SOURCES.
+#
+# Note that this file appends to BUILT_SOURCES and CLEANFILES, so
+# define them before including this file.
#
-EXTRA_DIST += $(ORC_SOURCE).orc
+EXTRA_DIST += $(addsuffix .orc,$(ORC_SOURCE))
-ORC_NODIST_SOURCES = tmp-orc.c $(ORC_SOURCE).h
-BUILT_SOURCES += tmp-orc.c $(ORC_SOURCE).h
+ORC_BUILT_SOURCE = $(addsuffix -orc-gen.c,$(ORC_SOURCE))
+ORC_BUILT_HEADER = $(addsuffix -orc-gen.h,$(ORC_SOURCE))
+BUILT_SOURCES += $(ORC_BUILT_SOURCE) $(ORC_BUILT_HEADER)
+CLEANFILES += $(BUILT_SOURCES)
-orc-update: tmp-orc.c $(ORC_SOURCE).h
- cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c
- cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h
orcc_v_gen = $(orcc_v_gen_$(V))
orcc_v_gen_ = $(orcc_v_gen_$(AM_DEFAULT_VERBOSITY))
@@ -39,34 +37,10 @@ cp_v_gen = $(cp_v_gen_$(V))
cp_v_gen_ = $(cp_v_gen_$(AM_DEFAULT_VERBOSITY))
cp_v_gen_0 = @echo " CP $@";
-if HAVE_ORC
-tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc
- $(orcc_v_gen)$(ORCC) --implementation -o $(builddir)/tmp-orc.c $(srcdir)/$(ORC_SOURCE).orc
-
-$(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc
- mkdir -p $$(dirname $(builddir)/$(ORC_SOURCE).h)
- $(orcc_v_gen)$(ORCC) --header -o $(builddir)/$(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE).orc
-else
-tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc
- $(cp_v_gen)cp $(srcdir)/$(ORC_SOURCE)-dist.c tmp-orc.c
-
-$(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc
- $(cp_v_gen)cp $(srcdir)/$(ORC_SOURCE)-dist.h $(ORC_SOURCE).h
-endif
-
-clean-local: clean-orc
-.PHONY: clean-orc
-clean-orc:
- rm -f tmp-orc.c $(ORC_SOURCE).h
+%-orc-gen.c: %.orc
+ @mkdir -p $(@D)
+ $(orcc_v_gen)$(ORCC) --implementation -o $@ $<
-dist-hook: dist-hook-orc
-.PHONY: dist-hook-orc
-dist-hook-orc: tmp-orc.c $(ORC_SOURCE).h
- rm -f tmp-orc.c~
- cmp -s tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c || \
- cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c
- cmp -s $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h || \
- cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h
- mkdir -p $$(dirname $(ORC_SOURCE))
- cp -p $(srcdir)/$(ORC_SOURCE)-dist.c $(distdir)/$$(dirname $(ORC_SOURCE))
- cp -p $(srcdir)/$(ORC_SOURCE)-dist.h $(distdir)/$$(dirname $(ORC_SOURCE))
+%-orc-gen.h: %.orc
+ @mkdir -p $(@D)
+ $(orcc_v_gen)$(ORCC) --header -o $@ $<