diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2017-10-15 06:58:20 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2017-10-15 06:58:20 (GMT) |
commit | 823edbf0abc533041ff6a572705fbafd4cbe5cfd (patch) | |
tree | 6ce3757b1cb53d0f2ef9d71762f83df221f2ce26 | |
parent | 0c646bc3d1d73a89e9a196dec828b447f224535d (diff) | |
download | tcl-823edbf0abc533041ff6a572705fbafd4cbe5cfd.zip tcl-823edbf0abc533041ff6a572705fbafd4cbe5cfd.tar.gz tcl-823edbf0abc533041ff6a572705fbafd4cbe5cfd.tar.bz2 |
Permit application makefile to define RCFILE.
Change PROJECT_REQUIRES_TK to use value instead of ifdef.
Change MAKERESCMD macro not to specify included input files.
-rw-r--r-- | win/makefile.vc | 3 | ||||
-rw-r--r-- | win/rules.vc | 54 | ||||
-rw-r--r-- | win/targets.vc | 2 |
3 files changed, 38 insertions, 21 deletions
diff --git a/win/makefile.vc b/win/makefile.vc index 62e3fa7..09b0b9f 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -173,6 +173,9 @@ PROJECT = tcl # rules.vc file will set up "all" as the target.
DEFAULT_BUILD_TARGET = release
+# We want to use our own resource file, not the standard template one.
+RCFILE = tcl.rc
+
# The rules.vc file does most of the hard work in terms of defining
# the build configuration, macros, output directories etc.
!include "rules.vc"
diff --git a/win/rules.vc b/win/rules.vc index d970755..d9bb95d 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -32,6 +32,10 @@ DOING_TCL = 1 DOING_TK = 1
!endif
+!ifndef(PROJECT_REQUIRES_TK)
+PROJECT_REQUIRES_TK = 0
+!endif
+
################################################################
# Nmake is a pretty weak environment in syntax and capabilities
# so this file is necessarily verbose. It's broken down into
@@ -75,14 +79,6 @@ Visual C++ compiler environment not initialized. !error $(MSG)
!endif
-# Defaults for built-in internal settings defined in parent makefile
-!ifndef DISABLE_STANDARD_TARGETS
-DISABLE_STANDARD_TARGETS = 0
-!endif
-!ifndef DISABLE_CLEAN_TARGETS
-DISABLE_CLEAN_TARGETS = 0
-!endif
-
################################################################
# 1. Define external programs being used
@@ -167,6 +163,7 @@ WINDIR = $(ROOT)\win !ifndef RCDIR
RCDIR = $(WINDIR)\rc
!endif
+RCDIR = $(RCDIR:/=\)
# The target directory where the built packages and binaries will be installed.
# INSTALLDIR is the (optional) path specified by the user.
@@ -176,7 +173,7 @@ RCDIR = $(WINDIR)\rc _INSTALLDIR = $(INSTALLDIR:/=\)
!else
### Assume the normal default.
-_INSTALLDIR = C:\Program Files\Tcl
+_INSTALLDIR = $(HOMEDRIVE)\Tcl
!endif
!if $(DOING_TCL)
@@ -248,7 +245,7 @@ Failed to find tcl.h. The TCLDIR macro is set incorrectly or is not set and defa !endif
# Now do the same to locate Tk headers and libs if project requires Tk
-!ifdef PROJECT_REQUIRES_TK
+!if $(PROJECT_REQUIRES_TK)
!ifdef TKDIR
@@ -887,6 +884,7 @@ VERSION = $(DOTVERSION:.=) # PRJLIB - output path of generated project library
# PRJSTUBLIBNAME - name of the generated project stubs library
# PRJSTUBLIB - output path of the generated project stubs library
+# RESFILE - output resource file (only if not static build)
SUFX = tsgx
@@ -1003,7 +1001,7 @@ TCLSH_NATIVE = $(TCLSH) !endif
# Do the same for Tk and Tk extensions that require the Tk libraries
-!if $(DOING_TK) || defined(PROJECT_REQUIRES_TK)
+!if $(DOING_TK) || $(PROJECT_REQUIRES_TK)
WISHNAMEPREFIX = wish
WISHNAME = $(WISHNAMEPREFIX)$(TK_VERSION)$(SUFX).exe
TKLIBNAME = $(PROJECT)$(TK_VERSION)$(SUFX).$(EXT)
@@ -1032,7 +1030,7 @@ TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" !endif # TKINSTALL
!endif # $(DOING_TK)
-!endif # $(DOING_TK) || PROJECT_REQUIRES_TK
+!endif # $(DOING_TK) || $(PROJECT_REQUIRES_TK)
# Various output paths
PRJIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
@@ -1042,6 +1040,16 @@ PRJLIB = $(OUT_DIR)\$(PRJLIBNAME) PRJSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
PRJSTUBLIB = $(OUT_DIR)\$(PRJSTUBLIBNAME)
+# If extension parent makefile has not defined a resource definition file,
+# we will generate one from standard template.
+!if !$(DOING_TCL) && !$(DOING_TK) && !$(STATIC_BUILD)
+!ifdef RCFILE
+RESFILE = $(RCFILE:.rc=.res)
+!else
+RESFILE = $(TMP_DIR)\$(PROJECT).res
+!endif
+!endif
+
###################################################################
# 11. Construct the paths for the installation directories
# The following macros get defined in this section:
@@ -1124,7 +1132,7 @@ OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED # test targets in tk do not use stubs
!if ! $(DOING_TCL)
USE_STUBS_DEFS = -DUSE_TCL_STUBS -DUSE_TCLOO_STUBS
-!ifdef PROJECT_REQUIRES_TK
+!if $(PROJECT_REQUIRES_TK)
USE_STUBS_DEFS = $(USE_STUBS_DEFS) -DUSE_TK_STUBS
!endif
!endif
@@ -1328,9 +1336,7 @@ MAKERESCMD = $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" \ -DVERSION=\"$(VERSION)\" \
-DSUFX=\"$(SUFX)\" \
-DPROJECT=\"$(PROJECT)\" \
- -DPRJLIBNAME=\"$(PRJLIBNAME)\" \
- $<
-
+ -DPRJLIBNAME=\"$(PRJLIBNAME)\"
!ifndef DEFAULT_BUILD_TARGET
DEFAULT_BUILD_TARGET = $(PROJECT)
@@ -1390,7 +1396,10 @@ default-setup: @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
-default-rc: $(TMP_DIR)\$(PROJECT).rc
+!ifndef RCFILE
+# If parent makefile has not defined a resource definition file,
+# we will generate one from standard template.
+$(TMP_DIR)\$(PROJECT).res: $(TMP_DIR)\$(PROJECT).rc
$(TMP_DIR)\$(PROJECT).rc:
@$(COPY) << $(TMP_DIR)\$(PROJECT).rc
@@ -1428,8 +1437,13 @@ END <<
+!endif # ifndef RCFILE
!ifndef DISABLE_IMPLICIT_RULES
+DISABLE_IMPLICIT_RULES = 0
+!endif
+
+!if $(DISABLE_IMPLICIT_RULES)
# Implicit rule definitions - only for building library objects. For stubs and
# main application, the master makefile should define explicit rules.
@@ -1449,13 +1463,13 @@ $< <<
{$(RCDIR)}.rc{$(TMP_DIR)}.res:
- $(MAKERESCMD)
+ $(MAKERESCMD) $<
{$(WINDIR)}.rc{$(TMP_DIR)}.res:
- $(MAKERESCMD)
+ $(MAKERESCMD) $<
{$(TMP_DIR)}.rc{$(TMP_DIR)}.res:
- $(MAKERESCMD)
+ $(MAKERESCMD) $<
.SUFFIXES:
.SUFFIXES:.c .rc
diff --git a/win/targets.vc b/win/targets.vc index 6844045..84ce2a4 100644 --- a/win/targets.vc +++ b/win/targets.vc @@ -6,7 +6,7 @@ $(PROJECT): setup pkgindex $(PRJLIB) # MAKEBINCMD will do shared, static and debug links as appropriate # _VC_MANIFEST_EMBED_DLL embeds the manifest for shared libraries # and is a no-op for static libraries -$(PRJLIB): $(PRJ_OBJS) +$(PRJLIB): $(PRJ_OBJS) $(RESFILE) $(MAKEBINCMD) $** $(_VC_MANIFEST_EMBED_DLL) -@del $*.exp |