############################################################################
#                              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.          #
#                                                                          #
############################################################################

AWSRES   = ../../../$(BDIR)/static/tools/awsres
WSDL2AWS = ../../../$(BDIR)/static/tools/wsdl2aws

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)

install:
	$(CP) *.thtml $(I_TPL)
	$(CP) wm_login.html $(I_TPL)
	$(CP) aws_*.png $(I_IMG)
ifeq ($(SOCKET),ssl)
	-$(CP) ../$(BDIR)/static/demos/agent${EXEEXT} $(I_SBN)
endif

check:
