diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2017-10-20 15:32:22 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2017-10-20 15:32:22 (GMT) |
commit | 6f23316c4abdd3a5605d3aa6b558639095d75650 (patch) | |
tree | 3f00de829f5174761651f027a8ddcefba30bfd77 | |
parent | fa7141288f0899b531d7dc94763423094be8608d (diff) | |
download | tcl-6f23316c4abdd3a5605d3aa6b558639095d75650.zip tcl-6f23316c4abdd3a5605d3aa6b558639095d75650.tar.gz tcl-6f23316c4abdd3a5605d3aa6b558639095d75650.tar.bz2 |
Added test and shell targets.
-rw-r--r-- | win/makefile.vc | 9 | ||||
-rw-r--r-- | win/rules.vc | 36 | ||||
-rw-r--r-- | win/targets.vc | 20 |
3 files changed, 52 insertions, 13 deletions
diff --git a/win/makefile.vc b/win/makefile.vc index 675d8fc..d09b187 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -485,19 +485,10 @@ setup: default-setup test: test-core test-pkgs
test-core: setup $(TCLTEST) dlls $(CAT32)
set TCL_LIBRARY=$(ROOT:\=/)/library
-!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE"
$(DEBUGGER) $(TCLTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) -loadfile <<
package ifneeded dde 1.4.0 [list load "$(TCLDDELIB:\=/)" dde]
package ifneeded registry 1.3.2 [list load "$(TCLREGLIB:\=/)" registry]
<<
-!else
- @echo Please wait while the tests are collected...
- $(TCLTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) -loadfile << > tests.log
- package ifneeded dde 1.4.0 "$(TCLDDELIB:\=/)" dde]
- package ifneeded registry 1.3.2 "$(TCLREGLIB:\=/)" registry]
-<<
- type tests.log | more
-!endif
runtest: setup $(TCLTEST) dlls $(CAT32)
set TCL_LIBRARY=$(ROOT:\=/)/library
diff --git a/win/rules.vc b/win/rules.vc index 852b1eb..88b90e0 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -112,6 +112,7 @@ MKDIR = mkdir # DOCDIR - source directory containing documentation files
# GENERICDIR - platform-independent source directory
# WINDIR - Windows-specific source directory
+# TESTDIR - directory containing test files
# TOOLSDIR - directory containing build tools
# _TCLDIR - root of the Tcl installation OR the Tcl sources. Not set
# when building Tcl itself.
@@ -146,8 +147,15 @@ GENERICDIR = $(ROOT)\generic !ifndef TOOLSDIR
TOOLSDIR = $(ROOT)\tools
!endif
+!ifndef TESTDIR
+TESTDIR = $(ROOT)\tests
+!endif
!ifndef LIBDIR
+!if exist("$(ROOT)\library")
LIBDIR = $(ROOT)\library
+!else
+LIBDIR = $(ROOT)\lib
+!endif
!endif
!ifndef DEMODIR
!if exist("$(LIBDIR)\demos")
@@ -1265,7 +1273,9 @@ pkgcflags_nostubs = $(appcflags_nostubs) $(PKGNAMEFLAGS) -DBUILD_$(PROJECT) #
# TBD - tclvfs has a comment that stubs libs should not be compiled with -GL
# without stating why. Tcl itself compiled stubs libs with this flag.
-# so we do not remove it from cflags.
+# so we do not remove it from cflags. -GL may prevent extensions
+# compiled with one VC version to fail to link against stubs library
+# compiled with another VC version. Check for this and fix accordingly.
stubscflags = $(cflags) $(PRJ_DEFINES) $(OPTDEFINES) -Zl -DSTATIC_BUILD $(INCLUDES)
# Link flags
@@ -1387,12 +1397,12 @@ default-install-libraries: $(OUT_DIR)\pkgIndex.tcl @echo Installing package index in '$(SCRIPT_INSTALL_DIR)'
@$(CPY) $(OUT_DIR)\pkgIndex.tcl $(SCRIPT_INSTALL_DIR)
-default-install-html:
+default-install-docs-html:
@echo Installing documentation files to '$(DOC_INSTALL_DIR)'
@if not exist "$(DOC_INSTALL_DIR)" mkdir "$(DOC_INSTALL_DIR)"
@if exist $(DOCDIR) for %f in ("$(DOCDIR)\*.html" "$(DOCDIR)\*.css") do @$(COPY) %f "$(DOC_INSTALL_DIR)"
-default-install-man:
+default-install-docs-n:
@echo Installing documentation files to '$(DOC_INSTALL_DIR)'
@if not exist "$(DOC_INSTALL_DIR)" mkdir "$(DOC_INSTALL_DIR)"
@if exist $(DOCDIR) for %f in ("$(DOCDIR)\*.n") do @$(COPY) %f "$(DOC_INSTALL_DIR)"
@@ -1429,6 +1439,21 @@ default-setup: @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
+!if "$(TESTPAT)" != ""
+TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
+!endif
+
+default-test: default-setup $(PROJECT)
+ @set TCLLIBPATH=$(OUT_DIR:\=/)
+ @if exist $(LIBDIR) for %f in ("$(LIBDIR)\*.tcl") do @$(COPY) %f "$(OUT_DIR)"
+ cd "$(TESTDIR)" && $(DEBUGGER) $(TCLSH) all.tcl $(TESTFLAGS)
+
+default-shell: default-setup $(PROJECT)
+ @set TCLLIBPATH=$(OUT_DIR:\=/)
+ @if exist $(LIBDIR) for %f in ("$(LIBDIR)\*.tcl") do @$(COPY) %f "$(OUT_DIR)"
+ $(DEBUGGER) $(TCLSH)
+
+# Generation of Windows version resource
!ifdef PRJ_RCFILE
$(TMP_DIR)\$(PROJECT).res: $(RCDIR)\$(PROJECT).rc
@@ -1485,6 +1510,11 @@ DISABLE_IMPLICIT_RULES = 0 # Implicit rule definitions - only for building library objects. For stubs and
# main application, the master makefile should define explicit rules.
+{$(ROOT)}.c{$(TMP_DIR)}.obj::
+ $(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<<
+$<
+<<
+
{$(WINDIR)}.c{$(TMP_DIR)}.obj::
$(cc32) $(pkgcflags) -Fo$(TMP_DIR)\ @<<
$<
diff --git a/win/targets.vc b/win/targets.vc index 56b6427..dbe4b82 100644 --- a/win/targets.vc +++ b/win/targets.vc @@ -1,6 +1,16 @@ #------------------------------------------------------------- -*- makefile -*- $(PROJECT): setup pkgindex $(PRJLIB) + +!ifdef PRJ_STUBOBJS +$(PROJECT): $(PRJSTUBLIB) +$(PRJSTUBLIB): $(PRJ_STUBOBJS) + $(MAKELIBCMD) $** + +$(PRJ_STUBOBJS): + $(cc32) $(stubscflags) -Fo$(TMP_DIR)\ %s +!endif + !ifdef PRJ_MANIFEST $(PROJECT): $(PRJLIB).manifest $(PRJLIB).manifest: $(PRJ_MANIFEST) @@ -9,6 +19,7 @@ $(PRJLIB).manifest: $(PRJ_MANIFEST) << !endif + !if "$(PROJECT)" != "tcl" && "$(PROJECT)" != "tk" # MAKEBINCMD will do shared, static and debug links as appropriate # _VC_MANIFEST_EMBED_DLL embeds the manifest for shared libraries @@ -19,10 +30,17 @@ $(PRJLIB): $(PRJ_OBJS) $(RESFILE) -@del $*.exp !endif +!ifndef DISABLE_STANDARD_TARGETS +DISABLE_STANDARD_TARGETS = 0 +!endif + +!if !$(DISABLE_STANDARD_TARGETS) setup: default-setup install: default-install clean: default-clean realclean: hose hose: default-hose distclean: realclean default-distclean - +test: default-test +shell: default-shell +!endif |