1include ../src/Makefile.common
2
3examples=$(prefix)/share/examples/gtkada/
4
5ifeq (${OS},Windows_NT)
6DIRSEP=;
7else
8DIRSEP=:
9endif
10
11# Some examples are build with project files, others with gtkada-config, so
12# we modify the following two environment variables so that the GtkAda version
13# we just installed can be used to compile the examples
14export ADA_PROJECT_PATH:=${libdir}/gnat${DIRSEP}${ADA_PROJECT_PATH}
15export PATH:=${bindir}:${PATH}
16
17DIRECTORIES=base_widget \
18  calendar_combo        \
19  composite_widget      \
20  display_switch        \
21  doublebuffer          \
22  documentation         \
23  dynamic_cast          \
24  gtk_examples          \
25  tutorial              \
26  handlers		         \
27  powergnu	          	\
28  images                \
29  cursors               \
30  user_data
31
32TUTORIAL_DIRS=tutorial/gtkdial \
33  tutorial/helloworld  \
34  tutorial/helloworld2 \
35  tutorial/packbox     \
36  tutorial/simple      \
37  tutorial/table       \
38  tutorial/tictactoe
39
40SHELL=sh
41
42all: ${DIRECTORIES}
43	@for file in ${DIRECTORIES}; do \
44	  make -C $${file} all || exit 1; \
45	done
46
47install:
48	mkdir -p "${DESTDIR}$(examples)"
49	-for dir in ${DIRECTORIES} ${TUTORIAL_DIRS}; do \
50	  mkdir -p "${DESTDIR}$(examples)/$${dir}"; \
51	  rm -f $${dir}/b~*; \
52	  cp -p $${dir}/*.ad? $${dir}/*.gpr "${DESTDIR}$(examples)/$${dir}" 2>/dev/null; \
53	  cp -p $${dir}/*.xmp $${dir}/*.png $${dir}/*.tst "${DESTDIR}$(examples)/$${dir}" 2>/dev/null; \
54	  cp -p $${dir}/Makefile "${DESTDIR}$(examples)/$${dir}" 2>/dev/null; \
55	  cp -p $${dir}/README "${DESTDIR}$(examples)/$${dir}" 2>/dev/null; \
56	done
57
58clean::
59	@for file in ${DIRECTORIES}; do \
60	  make -C $${file} clean; \
61	done
62
63