📄 makefile.vc
字号:
#---------------------------------------------------------------------
# Project specific targets
#---------------------------------------------------------------------
release: setup $(TCLSH) $(TCLSTUBLIB) dlls
core: setup $(TCLLIB) $(TCLSTUBLIB)
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-docs
test: setup $(TCLTEST) dlls $(CAT32)
set TCL_LIBRARY=$(ROOT)/library
!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE"
$(TCLTEST) $(ROOT)/tests/all.tcl $(TESTFLAGS)
!else
$(TCLTEST) $(ROOT)/tests/all.tcl $(TESTFLAGS) > tests.log
type tests.log | more
!endif
runtest: setup $(TCLTEST) dlls $(CAT32)
set TCL_LIBRARY=$(ROOT)/library
$(TCLTEST)
setup:
@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
!if !$(STATIC_BUILD)
$(TCLIMPLIB): $(TCLLIB)
!endif
$(TCLLIB): $(TCLOBJS)
!if $(STATIC_BUILD)
$(lib32) -nologo -out:$@ @<<
$**
<<
!else
$(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tcl -out:$@ \
$(baselibs) @<<
$**
<<
-@del $*.exp
!endif
$(TCLSTUBLIB): $(TCLSTUBOBJS)
$(lib32) -nologo -out:$@ $(TCLSTUBOBJS)
$(TCLSH): $(TCLSHOBJS) $(TCLIMPLIB)
$(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $**
$(TCLTEST): $(TCLTESTOBJS) $(TCLIMPLIB)
$(link32) $(conlflags) -stack:2300000 -out:$@ $(baselibs) $**
$(TCLPIPEDLL): $(WINDIR)\stub16.c
$(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $(WINDIR)\stub16.c
$(link32) $(conlflags) -out:$@ $(TMP_DIR)\stub16.obj $(baselibs)
!if $(STATIC_BUILD)
$(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj
$(lib32) -nologo -out:$@ $(TMP_DIR)\tclWinDde.obj
!else
$(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj $(TCLSTUBLIB)
$(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tcldde -out:$@ \
$** $(baselibs)
-@del $*.exp
-@del $*.lib
!endif
!if $(STATIC_BUILD)
$(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj
$(lib32) -nologo -out:$@ $(TMP_DIR)\tclWinReg.obj
!else
$(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj $(TCLSTUBLIB)
$(link32) $(dlllflags) -base:@$(WINDIR)\coffbase.txt,tclreg -out:$@ \
$** $(baselibs)
-@del $*.exp
-@del $*.lib
!endif
$(CAT32): $(WINDIR)\cat.c
$(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $?
$(link32) $(conlflags) -out:$@ -stack:16384 $(TMP_DIR)\cat.obj \
$(baselibs)
#---------------------------------------------------------------------
# Regenerate the stubs files. [Development use only]
#---------------------------------------------------------------------
genstubs:
!if !exist($(TCLSH))
@echo Build tclsh first!
!else
$(TCLSH) $(TOOLSDIR:\=/)\genStubs.tcl $(GENERICDIR:\=/) \
$(GENERICDIR:\=/)/tcl.decls $(GENERICDIR:\=/)/tclInt.decls
!endif
#---------------------------------------------------------------------
# Generate the makefile depedancies.
#---------------------------------------------------------------------
depend:
!if !exist($(TCLSH))
@echo Build tclsh first!
!else
$(TCLSH) $(TOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
-passthru:"-DBUILD_tcl $(TCL_INCLUDES:"="")" $(GENERICDIR) \
$(COMPATDIR) $(WINDIR) @<<
$(TCLOBJS)
<<
!endif
#---------------------------------------------------------------------
# Build the windows help file.
#---------------------------------------------------------------------
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
BMP = $(DOCTMP_DIR)\feather.bmp
BMP_NOPATH = feather.bmp
MAN2TCL = $(DOCTMP_DIR)\man2tcl.exe
winhelp: docsetup $(HELPFILE)
docsetup:
@if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR)
$(MAN2HELP) $(MAN2HELP2) $(INDEX) $(BMP): $(TOOLSDIR)\$$(@F)
copy $(TOOLSDIR)\$(@F) $(@D)
$(HELPFILE): $(HELPRTF) $(BMP)
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
BMROOT=.
CNT=$(@B).cnt
HLP=$(@B).hlp
[FILES]
$(PROJECT).rtf
[WINDOWS]
main="Tcl/Tk Reference Manual",,27648,(r15263976),(r65535)
[CONFIG]
BrowseButtons()
CreateButton(1, "Web", ExecFile("http://www.tcl.tk"))
CreateButton(2, "SF", ExecFile("http://sf.net/projects/tcl"))
CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk"))
CreateButton(4, "FAQ", ExecFile("http://www.purl.org/NET/Tcl-FAQ/"))
<<
cd $(MAKEDIR)
copy "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)"
copy "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)"
$(MAN2TCL): $(TOOLSDIR)\$$(@B).c
$(cc32) -nologo -G4 -ML -O2 -Fo$(@D)\ $(TOOLSDIR)\$(@B).c -link -out:$@
$(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX) $(DOCDIR)\*
$(TCLSH) $(MAN2HELP:\=/) -bitmap $(BMP_NOPATH) $(PROJECT) $(VERSION) $(DOCDIR:\=/)
install-docs:
!if exist($(HELPFILE))
@xcopy /i /y "$(HELPFILE)" "$(DOC_INSTALL_DIR)\"
@xcopy /i /y "$(HELPCNT)" "$(DOC_INSTALL_DIR)\"
!endif
#---------------------------------------------------------------------
# Special case object file targets
#---------------------------------------------------------------------
$(TMP_DIR)\testMain.obj: $(WINDIR)\tclAppInit.c
!if $(TCL_LINKWITHEXTENSIONS)
$(cc32) $(TCL_CFLAGS) -DTCL_TEST -DTCL_LINKWITHEXTENSIONS -Fo$@ $?
!else
$(cc32) $(TCL_CFLAGS) -DTCL_TEST -Fo$@ $?
!endif
$(TMP_DIR)\tclTest.obj: $(GENERICDIR)\tclTest.c
$(cc32) $(TCL_CFLAGS) -Fo$@ $?
$(TMP_DIR)\tclTestObj.obj: $(GENERICDIR)\tclTestObj.c
$(cc32) $(TCL_CFLAGS) -Fo$@ $?
$(TMP_DIR)\tclWinTest.obj: $(WINDIR)\tclWinTest.c
$(cc32) $(TCL_CFLAGS) -Fo$@ $?
$(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
!if $(TCL_LINKWITHEXTENSIONS)
$(cc32) $(TCL_CFLAGS) -DTCL_LINKWITHEXTENSIONS -Fo$@ $?
!else
$(cc32) $(TCL_CFLAGS) -Fo$@ $?
!endif
### The following objects should be built using the stub interfaces
$(TMP_DIR)\tclWinReg.obj: $(WINDIR)\tclWinReg.c
!if $(STATIC_BUILD)
$(cc32) $(BASE_CLFAGS) -DTCL_THREADS=1 -DSTATIC_BUILD -Fo$@ $?
!else
$(cc32) $(BASE_CLFAGS) -DTCL_THREADS=1 -DUSE_TCL_STUBS -Fo$@ $?
!endif
$(TMP_DIR)\tclWinDde.obj: $(WINDIR)\tclWinDde.c
!if $(STATIC_BUILD)
$(cc32) $(BASE_CLFAGS) -DTCL_THREADS=1 -DSTATIC_BUILD -Fo$@ $?
!else
$(cc32) $(BASE_CLFAGS) -DTCL_THREADS=1 -DUSE_TCL_STUBS -Fo$@ $?
!endif
### The following objects are part of the stub library and should not
### be built as DLL objects but none of the symbols should be exported
$(TMP_DIR)\tclStubLib.obj: $(GENERICDIR)\tclStubLib.c
$(cc32) $(cdebug) $(cflags) -Zl -DSTATIC_BUILD $(TCL_INCLUDES) -Fo$@ $?
#---------------------------------------------------------------------
# Dedependency rules
#---------------------------------------------------------------------
$(GENERICDIR)\regcomp.c: \
$(GENERICDIR)\regguts.h \
$(GENERICDIR)\regc_lex.c \
$(GENERICDIR)\regc_color.c \
$(GENERICDIR)\regc_nfa.c \
$(GENERICDIR)\regc_cvec.c \
$(GENERICDIR)\regc_locale.c
$(GENERICDIR)\regcustom.h: \
$(GENERICDIR)\tclInt.h \
$(GENERICDIR)\tclPort.h \
$(GENERICDIR)\regex.h
$(GENERICDIR)\regexec.c: \
$(GENERICDIR)\rege_dfa.c \
$(GENERICDIR)\regguts.h
$(GENERICDIR)\regerror.c: $(GENERICDIR)\regguts.h
$(GENERICDIR)\regfree.c: $(GENERICDIR)\regguts.h
$(GENERICDIR)\regfronts.c: $(GENERICDIR)\regguts.h
$(GENERICDIR)\regguts.h: $(GENERICDIR)\regcustom.h
!if exist("$(OUT_DIR)\depend.mk")
!include "$(OUT_DIR)\depend.mk"
!message *** Dependency rules in effect.
!else
!message *** Dependency rules are not being used.
!endif
### add a spacer in the output
!message
#---------------------------------------------------------------------
# Implicit rules
#---------------------------------------------------------------------
{$(WINDIR)}.c{$(TMP_DIR)}.obj::
$(cc32) $(TCL_CFLAGS) -DBUILD_tcl -Fo$(TMP_DIR)\ @<<
$<
<<
{$(GENERICDIR)}.c{$(TMP_DIR)}.obj::
$(cc32) $(TCL_CFLAGS) -DBUILD_tcl -Fo$(TMP_DIR)\ @<<
$<
<<
{$(COMPATDIR)}.c{$(TMP_DIR)}.obj::
$(cc32) $(TCL_CFLAGS) -DBUILD_tcl -Fo$(TMP_DIR)\ @<<
$<
<<
{$(WINDIR)}.rc{$(TMP_DIR)}.res:
$(rc32) -fo $@ -r -i "$(GENERICDIR)" -D__WIN32__ \
!if $(DEBUG)
-d DEBUG \
!endif
!if $(TCL_THREADS)
-d TCL_THREADS \
!endif
!if $(STATIC_BUILD)
-d STATIC_BUILD \
!endif
$<
.SUFFIXES:
.SUFFIXES:.c .rc
#---------------------------------------------------------------------
# Installation.
#---------------------------------------------------------------------
install-binaries:
@echo installing $(TCLLIBNAME)
!if "$(TCLLIB)" != "$(TCLIMPLIB)"
@xcopy /i /y "$(TCLLIB)" "$(BIN_INSTALL_DIR)\"
!endif
@xcopy /i /y "$(TCLIMPLIB)" "$(LIB_INSTALL_DIR)\"
!if exist($(TCLSH))
@echo installing $(TCLSHNAME)
@xcopy /i /y "$(TCLSH)" "$(BIN_INSTALL_DIR)\"
!endif
!if exist($(TCLPIPEDLL))
@echo installing $(TCLPIPEDLLNAME)
@xcopy /i /y "$(TCLPIPEDLL)" "$(BIN_INSTALL_DIR)\"
!endif
@echo installing $(TCLSTUBLIBNAME)
@xcopy /i /y "$(TCLSTUBLIB)" "$(LIB_INSTALL_DIR)\"
install-libraries:
@echo installing http1.0
@xcopy /i /y "$(ROOT)\library\http1.0\*.tcl" \
"$(SCRIPT_INSTALL_DIR)\http1.0\"
@echo installing http2.4
@xcopy /i /y "$(ROOT)\library\http\*.tcl" \
"$(SCRIPT_INSTALL_DIR)\http2.4\"
@echo installing opt0.4
@xcopy /i /y "$(ROOT)\library\opt\*.tcl" \
"$(SCRIPT_INSTALL_DIR)\opt0.4\"
@echo installing msgcat1.3
@xcopy /i /y "$(ROOT)\library\msgcat\*.tcl" \
"$(SCRIPT_INSTALL_DIR)\msgcat1.3\"
@echo installing tcltest2.2
@xcopy /i /y "$(ROOT)\library\tcltest\*.tcl" \
"$(SCRIPT_INSTALL_DIR)\tcltest2.2\"
@echo installing $(TCLDDELIBNAME)
!if $(STATIC_BUILD)
@xcopy /i /y "$(TCLDDELIB)" "$(LIB_INSTALL_DIR)\"
!else
@xcopy /i /y "$(TCLDDELIB)" "$(LIB_INSTALL_DIR)\dde$(DDEDOTVERSION)\"
@xcopy /i /y "$(ROOT)\library\dde\pkgIndex.tcl" \
"$(LIB_INSTALL_DIR)\dde$(DDEDOTVERSION)\"
!endif
@echo installing $(TCLREGLIBNAME)
!if $(STATIC_BUILD)
@xcopy /i /y "$(TCLREGLIB)" "$(LIB_INSTALL_DIR)\"
!else
@xcopy /i /y "$(TCLREGLIB)" "$(LIB_INSTALL_DIR)\reg$(REGDOTVERSION)\"
@xcopy /i /y "$(ROOT)\library\reg\pkgIndex.tcl" \
"$(LIB_INSTALL_DIR)\reg$(REGDOTVERSION)\"
!endif
@echo installing encoding files
@xcopy /i /y "$(ROOT)\library\encoding\*.enc" \
"$(SCRIPT_INSTALL_DIR)\encoding\"
@echo installing library files
@xcopy /i /y "$(GENERICDIR)\tcl.h" "$(INCLUDE_INSTALL_DIR)\"
@xcopy /i /y "$(GENERICDIR)\tclDecls.h" "$(INCLUDE_INSTALL_DIR)\"
@xcopy /i /y "$(GENERICDIR)\tclPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\"
@xcopy /i /y "$(ROOT)\library\history.tcl" "$(SCRIPT_INSTALL_DIR)\"
@xcopy /i /y "$(ROOT)\library\init.tcl" "$(SCRIPT_INSTALL_DIR)\"
@xcopy /i /y "$(ROOT)\library\ldAout.tcl" "$(SCRIPT_INSTALL_DIR)\"
@xcopy /i /y "$(ROOT)\library\parray.tcl" "$(SCRIPT_INSTALL_DIR)\"
@xcopy /i /y "$(ROOT)\library\safe.tcl" "$(SCRIPT_INSTALL_DIR)\"
@xcopy /i /y "$(ROOT)\library\tclIndex" "$(SCRIPT_INSTALL_DIR)\"
@xcopy /i /y "$(ROOT)\library\package.tcl" "$(SCRIPT_INSTALL_DIR)\"
@xcopy /i /y "$(ROOT)\library\word.tcl" "$(SCRIPT_INSTALL_DIR)\"
@xcopy /i /y "$(ROOT)\library\auto.tcl" "$(SCRIPT_INSTALL_DIR)\"
#---------------------------------------------------------------------
# Clean up
#---------------------------------------------------------------------
!if "$(OS)" == "Windows_NT"
RMDIR = rmdir /S /Q
!else
RMDIR = deltree /Y
!endif
tidy:
if exist $(TCLLIB) del $(TCLLIB)
if exist $(TCLSH) del $(TCLSH)
if exist $(TCLTEST) del $(TCLTEST)
if exist $(TCLDDELIB) del $(TCLDDELIB)
if exist $(TCLREGLIB) del $(TCLREGLIB)
clean:
if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR)
hose:
if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -