elementary: add make rule to generate screenshots of the examples.
[framework/uifw/elementary.git] / src / examples / Makefile.am
1 MAINTAINERCLEANFILES = Makefile.in
2
3 .PHONY: screenshots
4
5 pkglibdir = $(datadir)/$(PACKAGE)/examples
6
7 AM_CPPFLAGS = \
8 -I. \
9 -I$(top_srcdir)/src/lib \
10 -I$(top_builddir)/src/lib \
11 -DPACKAGE_DATA_DIR="\"$(datadir)/elementary\"" \
12 @ELEMENTARY_EDBUS_CFLAGS@ \
13 @ELEMENTARY_EFREET_CFLAGS@ \
14 @ELEMENTARY_ETHUMB_CFLAGS@ \
15 @ELEMENTARY_CFLAGS@
16
17 LDADD = \
18         @ELEMENTARY_LIBS@ \
19         $(top_builddir)/src/lib/libelementary.la
20
21 SRCS = \
22         actionslider_example_01.c \
23         bg_example_01.c \
24         bg_example_02.c \
25         bg_example_03.c
26
27 pkglib_PROGRAMS =
28
29 if EFL_INSTALL_EXAMPLES
30 filesdir = $(datadir)/$(PACKAGE)/examples
31 files_DATA = $(SRCS)
32 endif
33
34 if EFL_BUILD_EXAMPLES
35 pkglib_PROGRAMS += \
36         actionslider_example_01 \
37         bg_example_01 \
38         bg_example_02 \
39         bg_example_03
40
41 # This variable will hold the list of screenshots that will be made
42 # by "make screenshots". Each item in the list is of the form:
43 # <example executable>:<screenshot filename>:<delay in seconds>
44 SCREENSHOTS = \
45         actionslider_example_01:actionslider_01.png:0.0 \
46         bg_example_02:bg_01.png:0.0
47
48 screenshots: all
49         @mkdir -p $(top_srcdir)/doc/img/screenshots
50         @for ss in $(SCREENSHOTS); do \
51                 SS_ENTRY=($${ss//:/ }) ; \
52                 EXAMPLE=$${SS_ENTRY[0]} ; \
53                 SS_FILE=$${SS_ENTRY[1]} ; \
54                 SS_DELAY=$${SS_ENTRY[2]} ; \
55                 ELM_ENGINE="shot:delay=$${SS_DELAY}:file=$(top_srcdir)/doc/img/screenshots/$${SS_FILE}" ./$${EXAMPLE} ; \
56         done
57
58 else
59
60 screenshots:
61         @echo "Examples are not built. Run \"./configure --enable-build-examples\" first."
62
63 endif