# select the appropriate one
!if "x_$(BUILD)" == "x_Release"
CFG    = Release
!else 
CFG    = Debug
!endif

SUBDIRS	      = xlib winio tcl73 tk36 wish

# where you want the executables and dlls, add this to your normal path
INSTALLDIR = d:\usr\tools\tknt_test
 
# command to use to copy files for install
COPY  = copy /b /v
 
# a special version of the path while we are making
PATH =  $(PATH);\
	$(MAKEDIR)\wish\$(CFG);\
	$(MAKEDIR)\tcl73\$(CFG);\
	$(MAKEDIR)\tk36\$(CFG);\
	$(MAKEDIR)\xlib\$(CFG);\
	$(MAKEDIR)\dp32\$(CFG);

LIB =	$(LIB);\
	$(MAKEDIR)\tcl73\$(CFG);\
	$(MAKEDIR)\tk36\$(CFG);\
	$(MAKEDIR)\xlib\$(CFG);\
	$(MAKEDIR)\dp32\$(CFG);\
	$(MAKEDIR)\blt17\src\$(CFG)

# so these get propogated
# the defintion of CPP is a hack to avoid changing project makefiles
MF = $(MAKEFLAGS) -nologo "CFG=$(CFG)" "lib=$(LIB)" "PATH=$(PATH)" "CPP=cl.exe"

all:    
	@echo building in tcl73 ... & cd tcl73 & nmake @<<
$(MF)
<<
	@echo building in xlib ... & cd xlib & nmake @<<
$(MF)
<<
	@echo building in tk36 ... & cd tk36 & nmake @<<
$(MF)
<<
	@echo building in dp32 ... & cd dp32 & nmake @<<
$(MF)
<<
	@echo building in blt17\src ... & cd blt17\src & nmake @<<
$(MF)
<<
	@echo building in bldpwish ... & cd bldpwish & nmake @<<
$(MF)
<<
	@echo building in wish ... & cd wish & nmake @<<
$(MF)
<<

most:
	@echo building in tcl73 ... & cd tcl73 & nmake @<<
$(MF)
<<
	@echo building in xlib ... & cd xlib & nmake @<<
$(MF)
<<
	@echo building in tk36 ... & cd tk36 & nmake @<<
$(MF)
<<
	@echo building in dp32 ... & cd dp32 & nmake @<<
$(MF)
<<
	@echo building in wish ... & cd wish & nmake @<<
$(MF)
<<
	 
test:
	@echo PATH: $(PATH)
	@echo LIB: $(LIB)
 
install: all
	@echo "installing into $(INSTALLDIR) ..."
	@if not exist $(INSTALLDIR) mkdir $(INSTALLDIR)
	@$(COPY) tcl73\$(CFG)\tcl73.dll $(INSTALLDIR)
	@$(COPY) tk36\$(CFG)\tk36.dll $(INSTALLDIR)
	@$(COPY) dp32\$(CFG)\dp32.dll $(INSTALLDIR)
	@$(COPY) dplite\$(CFG)\dplite.dll $(INSTALLDIR)
	@$(COPY) xlib\$(CFG)\lxlib.dll $(INSTALLDIR)
	@$(COPY) wish\$(CFG)\tclsh.exe $(INSTALLDIR)
	@$(COPY) wish\$(CFG)\wish.exe $(INSTALLDIR)
	@$(COPY) wish\$(CFG)\dpsh.exe $(INSTALLDIR)
	@$(COPY) wish\$(CFG)\dpwish.exe $(INSTALLDIR)
	@$(COPY) wish\$(CFG)\tclspawn.exe $(INSTALLDIR)
