|
| 1 | +From bf55f8558b8ca6603f6539c6421391f26ab6139a Mon Sep 17 00:00:00 2001 |
| 2 | +From: dpasukhi <dpasukhi@opencascade.com> |
| 3 | +Date: Sun, 22 Jun 2025 15:20:03 +0100 |
| 4 | +Subject: [PATCH] Add Tk build and install automation to Makefile; include |
| 5 | + clean and distclean targets |
| 6 | + |
| 7 | +--- |
| 8 | + win/Makefile.in | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ |
| 9 | + 1 file changed, 68 insertions(+) |
| 10 | + |
| 11 | +diff --git a/win/Makefile.in b/win/Makefile.in |
| 12 | +index 8dd107670f..f0cf267329 100644 |
| 13 | +--- a/win/Makefile.in |
| 14 | ++++ b/win/Makefile.in |
| 15 | +@@ -129,6 +129,11 @@ ROOT_DIR_WIN_NATIVE = $(shell cd '$(ROOT_DIR)' ; pwd -W 2>/dev/null || pwd -P) |
| 16 | + ZLIB_DIR_NATIVE = $(shell $(CYGPATH) '$(ZLIB_DIR)') |
| 17 | + TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)') |
| 18 | + |
| 19 | ++# Tk-related directories (TKDIR can be set by user) |
| 20 | ++TK_SRC_DIR = $(TKDIR) |
| 21 | ++TK_BUILD_TOP = $(TKDIR)/win |
| 22 | ++CONFIG_INSTALL_DIR = $(LIB_INSTALL_DIR) |
| 23 | ++ |
| 24 | + # Fully qualify library path so that `make test` |
| 25 | + # does not depend on the current directory. |
| 26 | + LIBRARY_DIR1 = $(shell cd '$(ROOT_DIR_NATIVE)/library' ; pwd -P) |
| 27 | +@@ -432,6 +437,34 @@ TCL_OBJS = ${GENERIC_OBJS} ${WIN_OBJS} @ZLIB_OBJS@ $(TOMMATH_OBJS) |
| 28 | + TCL_DOCS = "$(ROOT_DIR_NATIVE)"/doc/*.[13n] |
| 29 | + |
| 30 | + all: binaries libraries doc packages |
| 31 | ++ @if test -n "$(TKDIR)" && test -d "$(TKDIR)"; then \ |
| 32 | ++ echo "TKDIR detected - automatically building Tk..."; \ |
| 33 | ++ echo "========== TK BUILD PARAMETERS =========="; \ |
| 34 | ++ echo "TKDIR=$(TKDIR)"; \ |
| 35 | ++ echo "TCLDIR=$(TOP_DIR)"; \ |
| 36 | ++ echo "prefix=$(prefix)"; \ |
| 37 | ++ echo "exec_prefix=$(exec_prefix)"; \ |
| 38 | ++ echo "TCL_TCLSH=$(BIN_INSTALL_DIR)/tclsh$(VER)${EXESUFFIX}"; \ |
| 39 | ++ echo "=========================================="; \ |
| 40 | ++ if test -f "$(TK_BUILD_TOP)/Makefile"; then \ |
| 41 | ++ echo "Building Tk using existing Makefile..."; \ |
| 42 | ++ (cd "$(TK_BUILD_TOP)" && $(MAKE)) || exit $$?; \ |
| 43 | ++ elif test -f "$(TK_SRC_DIR)/win/configure"; then \ |
| 44 | ++ echo "Configuring and building Tk..."; \ |
| 45 | ++ mkdir -p "$(TK_BUILD_TOP)"; \ |
| 46 | ++ (cd "$(TK_BUILD_TOP)" && \ |
| 47 | ++ "$(TK_SRC_DIR)/win/configure" \ |
| 48 | ++ --prefix="$(prefix)" \ |
| 49 | ++ --exec-prefix="$(exec_prefix)" \ |
| 50 | ++ --with-tcl="$(CONFIG_INSTALL_DIR)" && \ |
| 51 | ++ $(MAKE)) || exit $$?; \ |
| 52 | ++ else \ |
| 53 | ++ echo "ERROR: Tk configure script not found at $(TK_SRC_DIR)/win/configure"; \ |
| 54 | ++ exit 1; \ |
| 55 | ++ fi; \ |
| 56 | ++ else \ |
| 57 | ++ echo "TKDIR not set or directory does not exist - skipping Tk build"; \ |
| 58 | ++ fi |
| 59 | + |
| 60 | + # Test-suite helper (can be used to test Tcl from build directory with all expected modules). |
| 61 | + # To start from windows shell use: |
| 62 | +@@ -648,6 +681,27 @@ gentommath_h: |
| 63 | + > "$(GENERIC_DIR_NATIVE)/tclTomMath.h" |
| 64 | + |
| 65 | + install: all install-binaries install-libraries install-doc install-packages |
| 66 | ++ @if test -n "$(TKDIR)" && test -d "$(TKDIR)"; then \ |
| 67 | ++ echo "TKDIR detected - automatically installing Tk..."; \ |
| 68 | ++ echo "========== TK INSTALL PARAMETERS =========="; \ |
| 69 | ++ echo "TKDIR=$(TKDIR)"; \ |
| 70 | ++ echo "TCLDIR=$(TOP_DIR)"; \ |
| 71 | ++ echo "prefix=$(prefix)"; \ |
| 72 | ++ echo "exec_prefix=$(exec_prefix)"; \ |
| 73 | ++ echo "DESTDIR=$(INSTALL_ROOT)"; \ |
| 74 | ++ echo "TCL_TCLSH=$(BIN_INSTALL_DIR)/tclsh$(VER)${EXESUFFIX}"; \ |
| 75 | ++ echo "==========================================="; \ |
| 76 | ++ if test -f "$(TK_BUILD_TOP)/Makefile"; then \ |
| 77 | ++ echo "Installing Tk..."; \ |
| 78 | ++ (cd "$(TK_BUILD_TOP)" && $(MAKE) install DESTDIR="$(INSTALL_ROOT)") || exit $$?; \ |
| 79 | ++ else \ |
| 80 | ++ echo "ERROR: Tk Makefile not found at $(TK_BUILD_TOP)/Makefile"; \ |
| 81 | ++ echo "Please run 'make all' first to build Tk"; \ |
| 82 | ++ exit 1; \ |
| 83 | ++ fi; \ |
| 84 | ++ else \ |
| 85 | ++ echo "TKDIR not set or directory does not exist - skipping Tk install"; \ |
| 86 | ++ fi |
| 87 | + |
| 88 | + install-binaries: binaries |
| 89 | + @for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)"; \ |
| 90 | +@@ -848,10 +902,24 @@ clean: cleanhelp clean-packages |
| 91 | + $(RM) $(TCLSH) $(CAT32) $(TEST_EXE_FILE) $(TEST_DLL_FILE) tcltest.cmd tcltest.sh |
| 92 | + $(RM) *.pch *.ilk *.pdb *.zip |
| 93 | + $(RMDIR) *.vfs |
| 94 | ++ @if test -n "$(TKDIR)" && test -d "$(TKDIR)" && test -f "$(TK_BUILD_TOP)/Makefile"; then \ |
| 95 | ++ echo "TKDIR detected - automatically cleaning Tk..."; \ |
| 96 | ++ echo "Cleaning Tk build..."; \ |
| 97 | ++ (cd "$(TK_BUILD_TOP)" && $(MAKE) clean) || exit $$?; \ |
| 98 | ++ else \ |
| 99 | ++ echo "TKDIR not set, directory does not exist, or no Tk build to clean"; \ |
| 100 | ++ fi |
| 101 | + |
| 102 | + distclean: distclean-packages clean |
| 103 | + $(RM) Makefile config.status config.cache config.log tclConfig.sh \ |
| 104 | + tcl.hpj config.status.lineno tclsh.exe.manifest tclUuid.h |
| 105 | ++ @if test -n "$(TKDIR)" && test -d "$(TKDIR)" && test -f "$(TK_BUILD_TOP)/Makefile"; then \ |
| 106 | ++ echo "TKDIR detected - automatically distcleaning Tk..."; \ |
| 107 | ++ echo "Distcleaning Tk build..."; \ |
| 108 | ++ (cd "$(TK_BUILD_TOP)" && $(MAKE) distclean) || exit $$?; \ |
| 109 | ++ else \ |
| 110 | ++ echo "TKDIR not set, directory does not exist, or no Tk build to distclean"; \ |
| 111 | ++ fi |
| 112 | + |
| 113 | + # |
| 114 | + # Bundled package targets |
| 115 | +-- |
| 116 | +2.47.1.windows.2 |
| 117 | + |
0 commit comments