--- a/demos/demos.gpr
+++ b/demos/demos.gpr
@@ -1,33 +1,27 @@
-------------------------------------------------------------------------------
---                              Ada Web Server                              --
---                                                                          --
---                     Copyright (C) 2003-2009, AdaCore                     --
---                                                                          --
---  This library is free software; you can redistribute it and/or modify    --
---  it under the terms of the GNU General Public License as published by    --
---  the Free Software Foundation; either version 2 of the License, or (at   --
---  your option) any later version.                                         --
---                                                                          --
---  This library is distributed in the hope that it will be useful, but     --
---  WITHOUT ANY WARRANTY; without even the implied warranty of              --
---  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       --
---  General Public License for more details.                                --
---                                                                          --
---  You should have received a copy of the GNU General Public License       --
---  along with this library; if not, write to the Free Software Foundation, --
---  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.          --
---                                                                          --
-------------------------------------------------------------------------------
-
-with "../shared";
-with "../include/include";
-with "../src/src";
-with "demos_shared";
+-- Ada Web server - project file to build the examples
+-- Copyright (c) 2004, 2009 Ludovic Brenta <lbrenta@debian.org>
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 2 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-- GNU General Public License in file /usr/share/common-licenses/GPL for
+-- more details.
+--
+-- You should normally copy the examples directory to a user-writable
+-- directory before trying to compile.
+with "aws.gpr";
+with "xmlada.gpr";
 
 project Demos is
 
-   for Languages use ("Ada", "Project file");
    for Source_Dirs use (".", "../.build/common/demos");
+   for Object_Dir use "obj";
+   for Exec_Dir use ".";
 
    Mains := ("hello_world.adb", "com_1.adb", "com_2.adb", "main.adb",
              "hotplug.adb", "dispatch.adb", "wps.adb", "ws.adb",
@@ -56,77 +50,9 @@
               "web_elements_containers.ads", "web_elements_containers.adb",
               "rdemo-adains_png.ads", "rdemo-page3_html.ads", "demos.gpr");
 
-   for Main use Mains;
-
-   case Shared.XMLAda is
-      when "Installed" =>
-         for Main use project'Main & Mains_XMLAda;
-         for Source_Files use
-           project'Source_Files
-             & Mains_XMLADA
-             & ("hello_demo.ads",
-	        "hello_demo-client.ads", "hello_demo-client.adb",
-                "hello_demo-server.ads", "hello_demo-server.adb",
-		"hello_demo-types.ads",
-                "wsdl_demo_server_cb.ads", "wsdl_demo_server_cb.adb",
-		"interoplab.ads",
-                "interoplab-client.ads", "interoplab-client.adb",
-		"interoplab-types.ads",
-                "soap_server_cb.ads", "soap_server_cb.adb",
-		"soap_server_disp_cb.ads", "soap_server_disp_cb.adb",
-                "soap_svs_cb.ads", "soap_svs_cb.adb",
-                "soapinterop-org-xsd-arrayoffloat_type_pkg.ads",
-                "soapinterop-org-xsd-arrayofint_type_pkg.ads",
-                "soapinterop-org-xsd-arrayofsoapstruct_type_pkg.ads",
-                "soapinterop-org-xsd-arrayofstring_type_pkg.ads",
-                "soapinterop-org-xsd-soapstruct_type_pkg.adb",
-                "soapinterop-org-xsd-soapstruct_type_pkg.ads",
-                "soapinterop-org-xsd.ads",
-                "soapinterop-org.ads", "soapinterop.ads");
-      when "Disabled" =>
-         null;
-   end case;
-
-   case Shared.LDAP is
-      when "Installed" =>
-         for Main use project'Main & ("test_ldap.adb");
-         for Source_Files use
-           project'Source_Files & ("test_ldap.adb");
-      when others =>
-         null;
-   end case;
-
-   for Object_Dir use "../" & Shared'Object_Dir & "/demos";
-   for Exec_Dir use "../" & Shared'Exec_Dir & "/demos";
-
-   ---------
-   -- Ide --
-   ---------
-
-   package Ide renames Shared.Ide;
-
-   ------------
-   -- Binder --
-   ------------
-
-   package Binder renames Shared.Binder;
-
-   -------------
-   -- Builder --
-   -------------
-
-   package Builder renames Shared.Builder;
-
-   --------------
-   -- Compiler --
-   --------------
-
-   package Compiler renames Demos_Shared.Compiler;
-
-   ------------
-   -- Linker --
-   ------------
-
-   package Linker renames Demos_Shared.Linker;
+   package Compiler is
+      for Default_Switches ("Ada")
+        use ("-g", "-gnatafnoy", "-gnatVa", "-gnatwa");
+   end Compiler;
 
 end Demos;
--- a/demos/makefile
+++ b/demos/makefile
@@ -24,26 +24,26 @@
 
 SRCDIR	= ../$(BDIR)/../common/demos
 
-build_res:
-	echo Generate resources for res_demo
-	(cd $(SRCDIR) && \
-	 $(AWSRES) -q -r rdemo ../../../demos/adains.png \
-		../../../demos/page3.html)
-
-build_wsdl:
-	echo Generate stub/skel from WSDL documents
-	(cd $(SRCDIR) && \
-	$(WSDL2AWS) -q -f -doc -timeouts 1,2,2 ../../../demos/hello.wsdl && \
-	$(WSDL2AWS) -q -f -doc -noskel ../../../demos/interoplab_main.wsdl)
-
-ifeq (${PRJ_XMLADA}, Installed)
-BUILD_EXT = build_wsdl
-endif
-
-setup:
-	$(MKDIR) $(SRCDIR)
-
-after-build: build_res $(BUILD_EXT)
+# This Makefile builds all the Ada Web Server examples, using the
+# Debian way of organising files.  In particular, it uses project
+# files to do most of the work, instead of specifying dependencies
+# explicitly.
+
+.SUFFIXES:
+
+all: obj rdemo.ads hello_demo.ads interoplab.ads
+	gnatmake -Pdemos
+
+rdemo.ads: adains.png page3.html
+	awsres -q -r rdemo $<
+
+hello_demo.ads: hello.wsdl
+	wsdl2aws -q -f -doc $<
+
+interoplab.ads: interoplab_main.wsdl
+	wsdl2aws -q -f -doc -noskel $<
+obj:
+	mkdir -p obj
 
 install:
 	$(CP) *.thtml $(I_TPL)
@@ -54,3 +54,6 @@
 endif
 
 check:
+
+clean:
+	rm -rf obj rdemo.ads hello_demo* interoplab-* interoplab.ads
\ No newline at end of file
