##############################################################################
#
#           Copyright (c)2005 Geovariances, Avon, France.
#
#   In consideration  of payment of  the license fee,  which is a part of
#   the price you  paid for this  product, Geovariances (GV) as licensor,
#   grants you, the licensee, a non-exclusive right to use this copy of a
#   GV software product.
#   GV reserves all rights not  expressly granted to licensee. GV retains
#   titleship and ownership  of software.  This license is not  a sale of
#   the original  software or any  copy. GV also  retains  titleship  and
#   ownership of any modifications or  derivations of this software.  Any
#   modifications of this software  must be clearly marked as such.  This
#   copyright message must  appear in its entirety  in this software,  or
#   any modifications or derivations thereof.
#
#   Geovariances welcomes any comments, suggestions, bug reports, etc. At
#   the discretion  of Geovariances,  any customer  supplied  bug  fixes,
#   enhancements, or utility codes will be distributed in future software
#   releases (the contributor will of course be credited).
#
#           Geovariances
#           49bis, Avenue Franklin Roosevelt
#           77210 Avon, FRANCE
#
#            Phone: +33-(0)-160.749.100
#              Fax: +33-(0)-164.228.728
#           e-mail: support@geovariances.fr
#
#                       All Rights Reserved
#
##############################################################################

##############################################################################
# Makefile for GTXserver/client/CSharp samples
# $Id: Makefile 11501 2008-01-08 15:32:39Z foucher $
##############################################################################


## This Makefile must be used with GNU make.
## Under windows, sln/csproj files should be used instead
## or you can use Cygwin (www.cygwin.com) to get a win32 GNU make.


# Just type "make all" or "make debug" to compile the examples.

ARCH=winnt
SOURCES.cs = dump.cs browser.cs

GTX_CLIENT_LIB = ../../lib/$(ARCH)/shared/GTXClient.dll
GTX_CLIENT_LIB_DEBUG = ../../lib/$(ARCH)/shared/GTXClient_debug.dll
LIB_COPY = $(GTX_CLIENT_LIB:../../lib/$(ARCH)/shared/%=$(ARCH)/%)
LIB_COPY_DEBUG = $(GTX_CLIENT_LIB_DEBUG:../../lib/$(ARCH)/shared/%=$(ARCH)/%)

GTX_CLIENT_NET_LIB = ../../lib/$(ARCH)/shared/GTXClient.Net.dll
GTX_CLIENT_NET_LIB_DEBUG = ../../lib/$(ARCH)/shared/GTXClient_debug.Net.dll
LIB_NET_COPY = $(GTX_CLIENT_NET_LIB:../../lib/$(ARCH)/shared/%=$(ARCH)/%)
LIB_NET_COPY_DEBUG = $(GTX_CLIENT_NET_LIB_DEBUG:../../lib/$(ARCH)/shared/%=$(ARCH)/%)

CSC=$(subst \,/,$(WINDIR))/Microsoft.NET/Framework/v2.0.50727/csc.exe

      PROGS = $(SOURCES.cs:%.cs=$(ARCH)/%.exe)
PROGS_DEBUG = $(SOURCES.cs:%.cs=$(ARCH)/%_debug.exe)
      DSPS  = $(SOURCES.cs:%.cs=%.csproj)

# ---------------------------------------------------------------------------
# No modification needed after this line

all: $(ARCH) $(PROGS)

debug: $(ARCH) $(PROGS_DEBUG)

##
## Standard Console Programs
##
$(ARCH)/%.exe: %.cs infodump.cs $(GTX_CLIENT_NET_LIB) $(LIB_COPY) $(LIB_NET_COPY)
	@echo "Compiling $@ ..."
	$(CSC) /out:$@ $< infodump.cs /r:$(GTX_CLIENT_NET_LIB)

$(ARCH)/%_debug.exe: %.cs infodump.cs $(GTX_CLIENT_NET_LIB_DEBUG) $(LIB_COPY_DEBUG) $(LIB_NET_COPY_DEBUG)
	@echo "Compiling $@ ..."
	$(CSC) /debug /out:$@ infodump.cs $< /r:$(GTX_CLIENT_NET_LIB_DEBUG)

$(LIB_COPY): $(GTX_CLIENT_LIB)
	@cp $< $@

$(LIB_COPY_DEBUG): $(GTX_CLIENT_LIB_DEBUG)
	@cp $< $@

$(LIB_NET_COPY): $(GTX_CLIENT_NET_LIB)
	@cp $< $@

$(LIB_NET_COPY_DEBUG): $(GTX_CLIENT_NET_LIB_DEBUG)
	@cp $< $@

$(ARCH):
	@mkdir -p $(ARCH)
