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

.SILENT:

SDIR = ../$(BDIR)/../setup

setup_dir:
	-$(MKDIR) -p $(SDIR)/src
	-$(GPRBUILD) -p -XPRJ_BUILD=Debug -XLIBRARY_TYPE=static -Psetup

force: ;

setup: setup_dir $(SDIR)/src/aws-translator-conversion.adb \
	$(SDIR)/src/aws-os_lib.ads

$(SDIR)/src/aws-translator-conversion.adb: makefile force
	echo Setup conversion support
	$(SDIR)/test_uconv
	$(MV) aws-translator-conversion.adb $(SDIR)/src

$(SDIR)/src/aws-os_lib.ads: makefile src/check_config.c force
	echo Setup OS specific definitions
	$(SDIR)/check_config $(SDIR)/src/aws-os_lib.ads

install:
	$(CP) $(SDIR)/src/aws-translator-conversion.adb $(I_INC)
	$(CP) $(SDIR)/src/aws-os_lib.ads $(I_INC)
	$(CP) aws-net-std__* $(I_INC)
	$(CP) aws-net-ssl__* $(I_INC)
	$(CP) aws-net-ssl-certificate__* $(I_INC)
	$(CP) ssl-thin__* $(I_INC)
	$(CP) templates_parser-* $(I_INC)
	$(CP) projects/aws_components.gpr $(I_AGP)
	$(CP) projects/aws.gpr $(I_GPR)
	$(CP) projects/*_lib.gpr $(I_AGP)
	$(CP) projects/aws_shared.gpr $(I_AGP)
	$(CP) projects/aws_libz.gpr $(I_AGP)
	$(CP) projects/aws_ssl_support.gpr $(I_AGP)

check:
