#
#  Copyright(c) 1998 FRIDU a Free Software Company [fridu@fridu.com]
#
# Projet    :   Jos/jWrap
# Module    :   Test/Tornado
# Auteur    :   Philippe Le Foll [phillf@fridu.com]
#
# Last
#      Author      : $Author: phillf $
#      Date        : $Date: 1999/03/11 12:49:31 $
#      Revision    : $Revision: 1.3.0.1 $
#      Source      : $Source: /Master/jWrap/tornado/zDemo/msg/NMakefile,v $
#
# Modification History
# --------------------
# 01a,28feb98,phillf,written

## ---------------------------------------------------------------
#  Visual C++ 2.x and 4.0 makefile
#
#  This Makefile is only operation in binary distribution in
#  source tree user should use Fridu Common tools.
# ---------------------------------------------------------------

# MSVC location
WIN32_HOME    =c:\pMaster\msvc-4.2
CC            = $(WIN32_HOME)\bin\cl.exe /nologo 
LINK          = $(WIN32_HOME)\bin\link.exe /nologo 

# jWrap home
JWRAP_HOME    = c:\pMaster\Fridu\Jos-4.00
JWRAP_BIN     = $(JWRAP_HOME)\bin\jWrap
JWRAP_LIB     = $(JWRAP_HOME)\lib\libRuntimeJwrap.lib
JWRAP_INCL    = -I$(JWRAP_HOME)\include -I$(JWRAP_HOME)\include\WinDos

# TCL home
TCL_HOME      = c:\pMaster\tcl-8.0
TCL_INCL      = -I$(TCL_HOME)\include
TCL_LIB       = $(TCL_HOME)\lib\tcl80vc.lib

# Tornado location
#TORNADO_HOME  = $(WIND_BASE)
TORNADO_HOME  = c:\pMaster\tornado-1.0
TORNADO_HOST  = x86-win32
TORNADO_INCL  = -I$(TORNADO_HOME)\host\$(TORNADO_HOST)\include -I$(TORNADO_HOME)\host\include
TORNADO_DEF   = -DHOST=$(TORNADO_HOST) -DEASYC_PROTO_ONLY
TORNADO_LIB   = $(JWRAP_HOME)\lib\libRuntimeTornado.lib $(TORNADO_HOME)\host\$(TORNADO_HOST)\bin\wtxapidll.lib \

# used WIN32 libraries
WIN32_INCL    = -I$(WIN32_HOME)/include 
WIN32_LIB     = /LIBPATH:$(WIN32_HOME)/lib libc.lib kernel32.lib advapi32.lib user32.lib

# Definition of the C++ library to wrap. This are read-only files
HEADERS       = cmdDemoMsg.h
LIB_OBJS      = cmdDemoMsg_wpr.obj 
BIN_OBJS      = mainDemoMsg.obj

all : 
	-@echo WARNING: this Makefile assume Fridu jWrap is in:
	-@echo ----------------------------------------------------------
	-@echo .  jWrap   home = $(JWRAP_HOME)
	-@echo .  tcl80   home = $(TCL_HOME)
	-@echo .  msvc4   home = $(WIN32_HOME)
	-@echo .  tornado home = $(TORNADO_HOME) host = $(TORNADO_HOST)
	-@echo ----------------------------------------------------------
	-@echo . avaliable options:
	-@echo .
	-@echo .  "make static"  Build a custom tclsh named DemoMsgSh
	-@echo .  "make shared"  Build a shared library (Not avaliable with nmake)
	-@echo .  "make clean"   Clean up all tempry files
	-@echo ----------------------------------------------------------

clean : 
	-@erase "cmdDemoMsg_wpr.obj"
	-@erase "mainDemoMsg.obj"
	-@erase "DemoMsgSh.exe"


shared:
	-@echo ----------------------------------------------------------
	-@echo Sorry DLL have not been ported to nmake
	-@echo Check for FRIDU common skeleton and gnu make for WIN32
	-@echo ----------------------------------------------------------

static: DemoMsgSh.exe

.c.obj:
   $(CC) -c $(WIN32_INCL) $(TCL_INCL) $(TORNADO_INCL) $(TORNADO_DEF) $(JWRAP_INCL) $<  

cmdDemoMsg_wpr.c: $(HEADERS)
	$(JWRAP_BIN) --verbose --cc2wpr $(HEADERS)

DemoMsgSh.exe: $(LIB_OBJS) $(BIN_OBJS)
	$(LINK) /out:DemoMsgSh.exe $(LIB_OBJS) $(BIN_OBJS) $(TORNADO_LIB) $(JWRAP_LIB) \
		$(TCL_LIB) $(WIN32_LIB)
	-@echo -------------------------------------------------------------------------
	-@echo . 1) start your custom tclsh "./DemoMsgSh"
	-@echo . 2) check jWrap componant is activated "jWrap info"
	-@echo . 3) source demo "source scriptDemoMsg.jTcl"
	-@echo . 3)source demo "source scriptDemoMsg.jTcl" 
	-@echo -------------------------------------------------------------------------
