Description: Adapt the example Makefiles to Debian
 This patch is Debian-specific as it adjusts the build infrastructure
 of the examples to the Debian paths and project files, which are much
 simpler to use than upstream's.
Author: Olivier Henley <olivier.henley@polymtl.ca>
Forwarded: not-needed
Reviewed-By: Ludovic Brenta <lbrenta@debian.org>
Last-Update: 2010-07-08


--- a/examples/composite_widget/composite_widget.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/composite_widget/composite_widget.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project CompositeWidget is
+	for Main use ("main.adb");
+end CompositeWidget;
--- a/examples/composite_widget/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/composite_widget/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,8 +1,9 @@
 all:
-	gnatmake -g -gnata -gnaty -gnatwu main `gtkada-config`
+	gnatmake -Pcomposite_widget
+
 run:
 	./main
 
 clean: 
-	${RM} main *.o *.ali
+	gnat clean -Pcomposite_widget
 
--- a/examples/display_switch/display_switch.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/display_switch/display_switch.gpr	2010-07-04 18:29:26.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project Display_Switch is
+	for Main use ("test_display_switch.adb");
+end Display_Switch;
--- a/examples/display_switch/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/display_switch/Makefile	2010-07-04 18:29:26.000000000 +0200
@@ -0,0 +1,8 @@
+all:
+	gnatmake -Pdisplay_switch
+
+run:
+	./test_display_switch
+
+clean:
+	gnat clean -Pdisplay_switch
--- a/examples/doublebuffer/anim2.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/doublebuffer/anim2.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project Anim2 is
+	for Main use ("anim2.adb");
+end Anim2;
--- a/examples/doublebuffer/anim.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/doublebuffer/anim.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project Anim is
+	for Main use ("anim.adb");
+end Anim;
--- a/examples/doublebuffer/main_full_test.adb	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/doublebuffer/main_full_test.adb	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,10 @@
+with Full_Test; use Full_Test;
+with Gtk.Main; use Gtk.Main;
+
+procedure Main_Full_Test is
+begin
+   Gtk.Main.Set_Locale;
+   Gtk.Main.Init;
+   Full_Test.Init;
+   Gtk.Main.Main;
+end Main_Full_Test;
--- a/examples/doublebuffer/main_full_test.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/doublebuffer/main_full_test.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project Main_Full_Test is
+	for Main use ("main_full_test.adb");
+end Main_Full_Test;
--- a/examples/doublebuffer/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/doublebuffer/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,16 +1,13 @@
-all: parameters anim anim2
-
-GNAT_FLAGS = -g -gnata -gnatwu
-
-parameters::
-	gnatmake $(GNAT_FLAGS) parameters `gtkada-config`
-
-anim::
-	gnatmake $(GNAT_FLAGS) anim `gtkada-config`
-
-anim2::
-	gnatmake $(GNAT_FLAGS) anim2 `gtkada-config`
-
+all:
+	gnatmake -Panim
+	gnatmake -Panim2
+	gnatmake -Pmain_full_test
+
+run:
+	./anim
+	./anim2
+	./main_full_test
 clean:
-	${RM} *.o *.ali anim parameters anim2
-
+	gnat clean -Panim
+	gnat clean -Panim2
+	gnat clean -Pmain_full_test
--- a/examples/dynamic_cast/dynamic_cast.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/dynamic_cast/dynamic_cast.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project Dynamic_Cast is
+	for Main use ("dynamic.adb");
+end Dynamic_Cast;
--- a/examples/dynamic_cast/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/dynamic_cast/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,6 +1,9 @@
 all:
-	gnatmake -g -gnata -gnatwu dynamic `gtkada-config`
+	gnatmake -Pdynamic_cast
+
+run:
+	./dynamic
 
 clean:
-	${RM} *.o *.ali b~* dynamic
+	gnat clean -Pdynamic_cast
 
--- a/examples/gtk_examples/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/gtk_examples/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,9 +1,9 @@
-EXAMPLES=scribble
+all:
+	gnatmake -Pscribble
 
-all: ${EXAMPLES}
+run:
+	./scribble
 
-scribble::
-	gnatmake -g -gnata -gnatwu $@ `gtkada-config`
-clean::
-	${RM} *.o *.ali scribble b~*
+clean:
+	gnat clean -Pscribble
 
--- a/examples/gtk_examples/scribble.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/gtk_examples/scribble.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project Scribble is
+	for Main use ("scribble.adb");
+end Scribble;
Les fichiers binaires a/examples/images/Ada_Lovelace1.jpg et b/examples/images/Ada_Lovelace1.jpg sont différents.
--- a/examples/images/README	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/images/README	2010-07-04 18:29:27.000000000 +0200
@@ -2,6 +2,3 @@
 them on the screen. It also reacts to mouse events to provide an
 interactive selection rectangle.
 
-How to build the demos:
-  >  gnatmake -Prect
-
--- a/examples/images/rect.adb	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/images/rect.adb	2010-07-04 18:29:26.000000000 +0200
@@ -278,7 +278,7 @@
    --  error code of course, and provide fallbacks.
    --  Note that at this point the image has not been drawn to the screen
 
-   Gdk_New_From_File (Pix, "../../testgtk/alps.png", Error);
+   Gdk_New_From_File (Pix, "Ada_Lovelace1.jpg", Error);
 
    --  Connect to the relevant signals
 
@@ -299,5 +299,5 @@
 
    --  Start the main loop
 
-   Main; 
+   Main;
 end Rect;
--- a/examples/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/Makefile	2010-07-04 18:29:26.000000000 +0200
@@ -1,4 +1,4 @@
-include ../src/Makefile.common
+#include ../src/Makefile.common
 
 examples=$(prefix)/share/b/examples/gtkada/
 
@@ -15,7 +15,6 @@
 export PATH:=${prefix}/bin:${PATH}
 
 DIRECTORIES=base_widget \
-  calendar_combo        \
   composite_widget      \
   doublebuffer          \
   documentation         \
Les fichiers binaires a/examples/powergnu/Ada_Lovelace1.jpg et b/examples/powergnu/Ada_Lovelace1.jpg sont différents.
Les fichiers binaires a/examples/powergnu/Ada_Lovelace2.jpg et b/examples/powergnu/Ada_Lovelace2.jpg sont différents.
--- a/examples/powergnu/file.tst	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/powergnu/file.tst	2010-07-04 18:29:27.000000000 +0200
@@ -1 +1,2 @@
-<enter image name in file.tst>
+Ada_Lovelace1.jpg
+Ada_Lovelace2.jpg
--- a/examples/powergnu/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/powergnu/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,13 +1,8 @@
-CFLAGS = -g -O2 -gnata
+all:
+	gnatmake -Ppowergnu
 
-EXEC = power
-
-all: $(EXEC)
-
-power: force
-	gnatmake -m -gnatwu $(CFLAGS) $(EXEC) `gtkada-config`
-
-force:
+run:
+	./power file.tst
 
 clean:
-	rm -f *.o *.ali *~ b~* $(EXEC)
+	gnat clean -Ppowergnu
--- a/examples/powergnu/makefile2	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/powergnu/makefile2	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,13 @@
+CFLAGS = -g -O2 -gnata
+
+EXEC = power
+
+all: $(EXEC)
+
+power: force
+	gnatmake -m -gnatwu $(CFLAGS) $(EXEC) `gtkada-config`
+
+force:
+
+clean:
+	rm -f *.o *.ali *~ b~* $(EXEC)
--- a/examples/powergnu/powergnu.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/powergnu/powergnu.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project PowerGnu is
+	for Main use ("power.adb");
+end PowerGnu;
Les fichiers binaires a/examples/testgtk.tar.gz et b/examples/testgtk.tar.gz sont différents.
--- a/examples/tooltips/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/tooltips/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,8 @@
+all:
+	gnatmake -Ptooltips
+
+run:
+	./tooltips
+	
+clean:
+	gnat clean -Ptooltips
--- a/examples/tooltips/tooltips.gpr	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/tooltips/tooltips.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -4,9 +4,9 @@
 
    for Main use ("tooltips.adb");
 
-   package Compiler is
-      for Default_Switches ("ada") use ("-gnat05");
-   end Compiler;
+   --package Compiler is
+     -- for Default_Switches ("ada") use ("-gnat05");
+   --end Compiler;
 
 end Tooltips;
 
--- a/examples/tutorial/gtkdial/gtkdial.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/tutorial/gtkdial/gtkdial.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,7 @@
+--  The following with clause is the only thing necessary to compile and link
+--  a GtkAda application
+
+with "gtkada";
+project GtkDial is
+   for Main use ("dial_test.adb");
+end GtkDial;
--- a/examples/tutorial/gtkdial/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/tutorial/gtkdial/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,5 +1,7 @@
-all: force
-	gnatmake -g -gnata -gnaty -gnatwu dial_test `gtkada-config`
+all:
+	gnatmake -Pgtkdial
+run:
+	./dial_test
 clean: 
-	rm -f *.o *~ *.ali dial_test
-force:
+	gnat clean -Pgtkdial
+
--- a/examples/tutorial/helloworld/helloworld.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/tutorial/helloworld/helloworld.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project HelloWorld is
+	for Main use ("hello.adb");
+end HelloWorld;
--- a/examples/tutorial/helloworld/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/tutorial/helloworld/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,5 +1,6 @@
-all: force
-	gnatmake -g -gnata -gnaty -gnatwu hello `gtkada-config`
+all:
+	gnatmake -Phelloworld
+run:
+	./hello
 clean: 
-	rm -f *.o *~ *.ali hello
-force:
+	gnat clean -Phelloworld
--- a/examples/tutorial/helloworld2/helloworld2.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/tutorial/helloworld2/helloworld2.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project HelloWorld2 is
+	for Main use ("hello2.adb");
+end HelloWorld2;
--- a/examples/tutorial/helloworld2/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/tutorial/helloworld2/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,5 +1,8 @@
-all: force
-	gnatmake -g -gnata -gnaty -gnatwu hello2 `gtkada-config`
+all:
+	gnatmake -Phelloworld2
+
+run:
+	./hello2
+
 clean: 
-	rm -f *.o *~ *.ali hello2
-force:
+	gnat clean -Phelloworld2
--- a/examples/tutorial/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/tutorial/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,4 +1,4 @@
-all: force
+all:
 	make -C gtkdial all
 	make -C helloworld all
 	make -C helloworld2 all
@@ -14,4 +14,3 @@
 	make -C simple clean
 	make -C table clean
 	make -C tictactoe clean
-force:
--- a/examples/tutorial/packbox/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/tutorial/packbox/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,9 +1,10 @@
-all: force
-	gnatmake -g -gnata -gnatwu packbox_test `gtkada-config`
-run: all
-	./packbox_text 1
-	./packbox_text 2
-	./packbox_text 3
+all:
+	gnatmake -Ppackbox
+
+run:
+	./packbox_test 1
+	./packbox_test 2
+	./packbox_test 3
 clean: 
-	rm -f *.o *~ *.ali packbox_test
-force:
+	gnat clean -Ppackbox
+
--- a/examples/tutorial/packbox/packbox.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/tutorial/packbox/packbox.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project PackBox is
+	for Main use ("packbox_test.adb");
+end PackBox;
--- a/examples/tutorial/simple/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/tutorial/simple/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,5 +1,8 @@
-all: force
-	gnatmake -g -gnata -gnaty -gnatwu simple `gtkada-config`
+all: 
+	gnatmake -Psimple
+
+run:
+	./simple
+
 clean: 
-	rm -f *.o *~ *.ali simple
-force:
+	gnat clean -Psimple
--- a/examples/tutorial/simple/simple.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/tutorial/simple/simple.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project Simple is
+	for Main use ("simple.adb");
+end Simple;
--- a/examples/tutorial/table/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/tutorial/table/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,5 +1,8 @@
-all: force
-	gnatmake -g -gnata -gnaty -gnatwu table_test `gtkada-config`
+all:
+	gnatmake -Ptable
+
+run:
+	./table_test
+
 clean: 
-	rm -f *.o *~ *.ali table_test
-force:
+	gnat clean -Ptable
--- a/examples/tutorial/table/table.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/tutorial/table/table.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project Table is
+	for Main use ("table_test.adb");
+end Table;
--- a/examples/tutorial/tictactoe/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/tutorial/tictactoe/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,5 +1,8 @@
-all: force
-	gnatmake -g -gnata -gnaty -gnatwu ttt_test `gtkada-config`
+all:
+	gnatmake -Ptictactoe
+
+run:
+	./ttt_test
+
 clean: 
-	rm -f *.o *~ *.ali ttt_test
-force:
+	gnat clean -Ptictactoe
--- a/examples/tutorial/tictactoe/tictactoe.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/tutorial/tictactoe/tictactoe.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,5 @@
+with "gtkada";
+project TicTacToe is
+	for Main use ("ttt_test.adb");
+end TicTacToe;
+
--- a/examples/user_data/Makefile	2009-12-25 12:28:31.000000000 +0100
+++ b/examples/user_data/Makefile	2010-07-04 18:29:27.000000000 +0200
@@ -1,5 +1,9 @@
 all:
-	gnatmake test_handlers `gtkada-config`
+	gnatmake -Puser_data
+
+run:
+	./test_handlers
+
 clean:
-	${RM} *.o *.ali b~* test_handlers
+	gnat clean -Puser_data
 
--- a/examples/user_data/user_data.gpr	1970-01-01 01:00:00.000000000 +0100
+++ b/examples/user_data/user_data.gpr	2010-07-04 18:29:27.000000000 +0200
@@ -0,0 +1,4 @@
+with "gtkada";
+project User_Data is
+	for Main use ("test_handlers.adb");
+end User_Data;
