2 # This is a makefile.am fragment to build Orc code.
4 # Define ORC_SOURCE and then include this file, such as:
6 # ORC_SOURCE=gstadderorc
7 # include $(top_srcdir)/common/orc.mak
9 # This fragment will create tmp-orc.c and gstadderorc.h from
12 # When 'make dist' is run at the top level, or 'make orc-update'
13 # in a directory including this fragment, the generated source
14 # files will be copied to $(ORC_SOURCE)-dist.[ch]. These files
15 # should be checked in to git, since they are used if Orc is
18 # Note that this file defines BUILT_SOURCES, so any later usage
19 # of BUILT_SOURCES in the Makefile.am that includes this file
24 EXTRA_DIST = $(ORC_SOURCE).orc
26 ORC_NODIST_SOURCES = tmp-orc.c $(ORC_SOURCE).h
27 BUILT_SOURCES = tmp-orc.c $(ORC_SOURCE).h
30 orc-update: tmp-orc.c $(ORC_SOURCE).h
31 $(top_srcdir)/common/gst-indent tmp-orc.c
32 cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c
33 cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h
37 tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc
38 $(ORCC) --implementation --include glib.h -o tmp-orc.c $(srcdir)/$(ORC_SOURCE).orc
40 $(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc
41 $(ORCC) --header --include glib.h -o $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE).orc
43 tmp-orc.c: $(srcdir)/$(ORC_SOURCE).orc
44 cp $(srcdir)/$(ORC_SOURCE)-dist.c tmp-orc.c
46 $(ORC_SOURCE).h: $(srcdir)/$(ORC_SOURCE).orc
47 cp $(srcdir)/$(ORC_SOURCE)-dist.h $(ORC_SOURCE).h
51 clean-local: clean-orc
54 rm -f tmp-orc.c $(ORC_SOURCE).h
56 dist-hook: dist-hook-orc
58 dist-hook-orc: tmp-orc.c $(ORC_SOURCE).h
59 $(top_srcdir)/common/gst-indent tmp-orc.c
61 cmp -s tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c || \
62 cp tmp-orc.c $(srcdir)/$(ORC_SOURCE)-dist.c
63 cmp -s $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h || \
64 cp $(ORC_SOURCE).h $(srcdir)/$(ORC_SOURCE)-dist.h
65 cp -p $(srcdir)/$(ORC_SOURCE)-dist.c $(distdir)/
66 cp -p $(srcdir)/$(ORC_SOURCE)-dist.h $(distdir)/