From 4499c71658a794dea442302083be37dddfc6a061 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Tue, 7 Nov 2017 16:53:32 +0000 Subject: Fix inclusion of custom resource files to match TIP spec --- win/makefile.vc | 4 ++++ win/rules.vc | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index d2df135..832b705 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -76,10 +76,14 @@ # The PROJECT macro is used by rules.vc for generating appropriate # macros and rules. PROJECT = tk + # Default target to build if no target is specified. If unspecified, the # rules.vc file will set up "all" as the target. DEFAULT_BUILD_TARGET = release +# We have a custom resource file +RCFILE = tk.rc + # The rules.vc file does much of the hard work in terms of defining # the build configuration, macros, output directories etc. !include "rules-ext.vc" diff --git a/win/rules.vc b/win/rules.vc index 1289aec..a1c30e0 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -196,6 +196,7 @@ DEMODIR = $(ROOT)\demos # TBD - This is a potentially dangerous conflict, rename WINDIR to # something else WINDIR = $(ROOT)\win + !ifndef RCDIR !if exist("$(WINDIR)\rc") RCDIR = $(WINDIR)\rc @@ -1105,8 +1106,8 @@ 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 PRJ_RCFILE -RESFILE = $(TMP_DIR)\$(PRJ_RCFILE:.rc=.res) +!ifdef RCFILE +RESFILE = $(TMP_DIR)\$(RCFILE:.rc=.res) !else RESFILE = $(TMP_DIR)\$(PROJECT).res !endif @@ -1498,10 +1499,13 @@ default-shell: default-setup $(PROJECT) $(DEBUGGER) $(TCLSH) # Generation of Windows version resource -!ifdef PRJ_RCFILE +!ifdef RCFILE +# Note: don't use $** in below rule because there may be other dependencies +# and only the "master" rc must be passed to the resource compiler $(TMP_DIR)\$(PROJECT).res: $(RCDIR)\$(PROJECT).rc - $(RESCMD) $** + $(RESCMD) $(RCDIR)\$(PROJECT).rc + !else # If parent makefile has not defined a resource definition file, @@ -1544,7 +1548,7 @@ END << -!endif # ifdef PRJ_RCFILE +!endif # ifdef RCFILE !ifndef DISABLE_IMPLICIT_RULES DISABLE_IMPLICIT_RULES = 0 -- cgit v0.12