summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2002-03-28 02:42:40 (GMT)
committerdavygrvy <davygrvy@pobox.com>2002-03-28 02:42:40 (GMT)
commit369191c32d21d0a7ae82205e8e274154d0f76d00 (patch)
tree66e30c06ec1803f3c2838ccf56f40ebbe14c695d
parent0e6b520d2c873ab9b8e129ed8b82ecd5b9275a8f (diff)
downloadtcl-369191c32d21d0a7ae82205e8e274154d0f76d00.zip
tcl-369191c32d21d0a7ae82205e8e274154d0f76d00.tar.gz
tcl-369191c32d21d0a7ae82205e8e274154d0f76d00.tar.bz2
* tools/man2help.tcl:
* win/makefile.vc: winhelp target now copies all needed files from tools/ to a workarea under $(OUT_DIR) and builds it from there. No build cruft is left in tools/ anymore. All paths used in man2help.tcl are now relative to where the script is. [Bug 527941]
-rw-r--r--tools/man2help.tcl16
-rw-r--r--win/makefile.vc62
2 files changed, 43 insertions, 35 deletions
diff --git a/tools/man2help.tcl b/tools/man2help.tcl
index 2422468..0d9bb02 100644
--- a/tools/man2help.tcl
+++ b/tools/man2help.tcl
@@ -6,13 +6,15 @@
#
# Copyright (c) 1996 by Sun Microsystems, Inc.
#
-# RCS: @(#) $Id: man2help.tcl,v 1.8 2001/11/10 02:34:57 hobbs Exp $
+# RCS: @(#) $Id: man2help.tcl,v 1.9 2002/03/28 02:42:40 davygrvy Exp $
#
#
# PASS 1
#
+set man2tclprog [file join [file dirname [info script]] man2tcl.exe]
+
proc generateContents {basename version files} {
global curID topics
set curID 0
@@ -21,7 +23,7 @@ proc generateContents {basename version files} {
flush stdout
doFile $f
}
- set fd [open "$basename$version.cnt" w]
+ set fd [open [file join [file dirname [info script]] $basename$version.cnt] w]
fconfigure $fd -translation crlf
puts $fd ":Base $basename$version.hlp"
foreach package [getPackages] {
@@ -55,7 +57,7 @@ proc generateHelp {basename files} {
}
}
- set file [open "$basename.rtf" w]
+ set file [open [file join [file dirname [info script]] $basename.rtf] w]
fconfigure $file -translation crlf
puts $file "\{\\rtf1\\ansi \\deff0\\deflang1033\{\\fonttbl\{\\f0\\froman\\fcharset0\\fprq2 Times New Roman\;\}\}"
foreach f $files {
@@ -78,8 +80,8 @@ proc generateHelp {basename files} {
# file - Name of file to translate.
proc doFile {file} {
- if {[catch {eval [exec man2tcl [glob $file]]} msg] &&
- [catch {eval [exec ./man2tcl [glob $file]]} msg]} {
+ global man2tclprog
+ if {[catch {eval [exec $man2tclprog [glob $file]]} msg]} {
global errorInfo
puts stderr $msg
puts "in"
@@ -124,7 +126,7 @@ foreach i [lrange $argv 2 end] {
}
}
-source [file join [file dir $argv0] index.tcl]
+source [file join [file dirname [info script]] index.tcl]
generateContents $baseName $version $files
-source [file join [file dir $argv0] man2help2.tcl]
+source [file join [file dirname [info script]] man2help2.tcl]
generateHelp $baseName $files
diff --git a/win/makefile.vc b/win/makefile.vc
index 459b924..d8f5f00 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -12,7 +12,7 @@
# Copyright (c) 2001-2002 David Gravereaux.
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: makefile.vc,v 1.85 2002/03/27 22:57:57 davygrvy Exp $
+# RCS: @(#) $Id: makefile.vc,v 1.86 2002/03/28 02:42:51 davygrvy Exp $
#------------------------------------------------------------------------------
!if "$(MSVCDIR)" == ""
@@ -185,10 +185,6 @@ TCLREGLIB = $(OUT_DIR)\$(TCLREGLIBNAME)
TCLDDELIBNAME = $(PROJECT)dde$(DDEVERSION)$(SUFX:t=).$(EXT)
TCLDDELIB = $(OUT_DIR)\$(TCLDDELIBNAME)
-TCLHLPBASE = $(PROJECT)$(VERSION)
-TCLHLP = $(OUT_DIR)\$(TCLHLPBASE).hlp
-TCLHLPCNT = $(OUT_DIR)\$(TCLHLPBASE).cnt
-
TCLTEST = $(OUT_DIR)\$(PROJECT)test.exe
CAT32 = $(OUT_DIR)\cat32.exe
@@ -410,7 +406,7 @@ shell: setup $(TCLSH)
dlls: setup $(TCLPIPEDLL) $(TCLREGLIB) $(TCLDDELIB)
all: setup $(TCLSH) $(TCLSTUBLIB) dlls $(CAT32)
tcltest: setup $(TCLTEST) dlls $(CAT32)
-install: install-binaries install-libraries
+install: install-binaries install-libraries install-docs
test: setup $(TCLTEST) dlls $(CAT32)
@@ -518,21 +514,33 @@ $(TCLOBJS)
# Build the windows help file.
#---------------------------------------------------------------------
-MAN2TCL = $(TOOLSDIR)\man2tcl
-TCLRTF = $(TOOLSDIR)\$(PROJECT).rtf
-MAN2HELP = $(TOOLSDIR)\man2help.tcl
+TCLHLPBASE = $(PROJECT)$(VERSION)
+HELPFILE = $(OUT_DIR)\$(TCLHLPBASE).hlp
+HELPCNT = $(OUT_DIR)\$(TCLHLPBASE).cnt
+DOCTMP_DIR = $(OUT_DIR)\$(PROJECT)_docs
+HELPRTF = $(DOCTMP_DIR)\$(PROJECT).rtf
+MAN2HELP = $(DOCTMP_DIR)\man2help.tcl
+MAN2HELP2 = $(DOCTMP_DIR)\man2help2.tcl
+INDEX = $(DOCTMP_DIR)\index.tcl
+MAN2TCL = $(DOCTMP_DIR)\man2tcl.exe
+
+winhelp: docsetup $(HELPFILE)
+
+docsetup:
+ @if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR)
-winhelp: $(TCLHLP)
+$(MAN2HELP) $(MAN2HELP2) $(INDEX): $(TOOLSDIR)\$$(@F)
+ copy $(TOOLSDIR)\$(@F) $(@D)
-$(TCLHLP): $(TCLRTF)
- cd $(TOOLSDIR)
+$(HELPFILE): $(HELPRTF)
+ cd $(DOCTMP_DIR)
start /wait hcrtf.exe -x <<$(PROJECT).hpj
[OPTIONS]
COMPRESS=12 Hall Zeck
LCID=0x409 0x0 0x0 ; English (United States)
TITLE=Tcl/Tk Reference Manual
-CNT=$(TCLHLPBASE).cnt
-HLP=$(TCLHLPBASE).hlp
+CNT=$(@B).cnt
+HLP=$(@B).hlp
[FILES]
$(PROJECT).rtf
@@ -547,18 +555,20 @@ CreateButton(2, "Sourceforge", ExecFile("http://sf.net/projects/tcl"))
CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk"))
<<
cd $(MAKEDIR)
- copy $(TOOLSDIR)\$(TCLHLPBASE).hlp $(OUT_DIR)
- copy $(TOOLSDIR)\$(TCLHLPBASE).cnt $(OUT_DIR)
+ copy "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)"
+ copy "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)"
-$(MAN2TCL).exe:
- cd $(TOOLSDIR)
- $(cc32) -nologo -G4 -ML -O2 $(MAN2TCL).c
- cd $(MAKEDIR)
+$(MAN2TCL):
+ $(cc32) -nologo -G4 -ML -O2 $(TOOLSDIR)\man2tcl.c -link -out:$@
-$(TCLRTF): $(MAN2TCL).exe $(TCLSH)
- cd $(TOOLSDIR)
- ..\win\$(TCLSH) $(MAN2HELP) $(PROJECT) $(VERSION) $(ROOT)/doc
- cd $(MAKEDIR)
+$(HELPRTF): $(TCLSH) $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX)
+ $(TCLSH) $(MAN2HELP) $(PROJECT) $(VERSION) $(ROOT)/doc
+
+install-docs:
+!if exist($(HELPFILE))
+ @xcopy /i /y "$(HELPFILE)" "$(DOC_INSTALL_DIR)\"
+ @xcopy /i /y "$(HELPCNT)" "$(DOC_INSTALL_DIR)\"
+!endif
#---------------------------------------------------------------------
@@ -703,10 +713,6 @@ install-binaries:
!endif
@echo installing $(TCLSTUBLIBNAME)
@xcopy /i /y "$(TCLSTUBLIB)" "$(LIB_INSTALL_DIR)\"
-!if exist($(TCLHLP))
- @xcopy /i /y "$(TCLHLP)" "$(DOC_INSTALL_DIR)\"
- @xcopy /i /y "$(TCLHLPCNT)" "$(DOC_INSTALL_DIR)\"
-!endif
install-libraries:
@echo installing http1.0