Files

198 lines
8.1 KiB
Makefile
Raw Permalink Normal View History

TCL_SUBDIR= @VENDOR_TCL_SUBDIR@
TCLX_SUBDIR= @VENDOR_TCLX_SUBDIR@
TCLLIB_SUBDIR= @VENDOR_TCLLIB_SUBDIR@
2025-02-05 02:19:27 +11:00
CRITCL_SUBDIR= critcl
2020-06-06 16:48:14 +02:00
SIGNIFY_SUBDIR= signify-osx
2024-08-28 00:24:25 +10:00
INSTALL_SUBDIR= install
2025-02-15 11:22:44 +11:00
DESTROOT= @abs_top_builddir@/@VENDOR_DESTROOT@
TCL_PREFIX= @TCL_PREFIX@
INSTALL= @INSTALL@
TCL_INSTALL_D_ARG= INSTALL_DATA_DIR="@abs_top_builddir@/vendor/tcl/unix/install-sh -d -m 755"
.PHONY: all clean distclean install destroot test
2025-02-14 04:12:54 +11:00
.PHONY: destroot-tcl destroot-critcl destroot-tclx destroot-tcllib destroot-tcllibc destroot-signify destroot-install
.PHONY: install-tcl install-tclx install-tcllib install-tcllibc install-signify install-install
2024-08-28 00:24:25 +10:00
.PHONY: %-tcl %-tclx %-tcllib %-signify %-install
# for make all, run destroot (where destroot will depend on all of each
# subpackage)
all: destroot
%-tcl:
@echo ===\> making $(@:%-tcl=%) in ${DIRPRFX}@VENDOR_TCL_SUBDIR@
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "@VENDOR_TCL_SUBDIR@" $(@:%-tcl=%)
%-tclx:
@echo ===\> making $(@:%-tclx=%) in ${DIRPRFX}@VENDOR_TCLX_SUBDIR@
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "@VENDOR_TCLX_SUBDIR@" $(@:%-tclx=%)
2014-05-16 22:41:36 +00:00
# tclx also links against libtclstub
all-tclx: all-tcl
%-tcllib:
@echo ===\> making $(@:%-tcllib=%) in ${DIRPRFX}@VENDOR_TCLLIB_SUBDIR@
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "@VENDOR_TCLLIB_SUBDIR@" TCLSH_PROG="@INTREE_TCLSH@" $(@:%-tcllib=%)
2020-06-06 16:48:14 +02:00
%-signify:
@echo ===\> making $(@:%-signify=%) in ${DIRPRFX}${SIGNIFY_SUBDIR}
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "${SIGNIFY_SUBDIR}" $(@:%-signify=%)
2020-06-06 16:48:14 +02:00
2024-08-28 00:24:25 +10:00
%-install:
@echo ===\> making $(@:%-install=%) in ${DIRPRFX}${INSTALL_SUBDIR}
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "${INSTALL_SUBDIR}" $(@:%-install=%)
2024-08-28 00:24:25 +10:00
2025-02-05 02:19:27 +11:00
DESTROOT_TARGETS= destroot-tcl destroot-tclx destroot-tcllib destroot-tcllibc
CLEAN_TARGETS= clean-tcl clean-tcllib clean-tclx clean-signify
DISTCLEAN_TARGETS= distclean-tcl distclean-tcllib distclean-tclx distclean-signify
2025-06-11 02:07:14 +10:00
CODESIGN_TARGETS= signify-osx/signify tcl/unix/libtcl[89]*.dylib tcl/unix/tclsh tclx/libtclx[89]*.dylib tcl/unix/pkgs/itcl*/libitcl*.dylib tcl/unix/pkgs/tdbc[0-9]*/libtdbc*.dylib tcl/unix/pkgs/tdbcpostgres*/libtdbcpostgres*.dylib tcl/unix/pkgs/thread*/libthread*.dylib tcl/unix/pkgs/tdbcmysql*/libtdbcmysql*.dylib tcl/unix/pkgs/tdbcodbc*/libtdbcodbc*.dylib tcl/unix/pkgs/sqlite3*/libsqlite3*.dylib $(DESTROOT)$(TCL_PREFIX)/lib/tcllibc*/macosx-macports/tcllibc.dylib
2024-07-03 20:01:01 +10:00
ifneq (@OS_PLATFORM@,linux)
DESTROOT_TARGETS+= destroot-signify
endif
2024-08-28 00:24:25 +10:00
ifeq (@HAVE_CLONEFILE@,yes)
2024-09-25 11:54:03 +10:00
ifeq (@HAVE_DECL_CLONE_NOOWNERCOPY@,yes)
2024-08-28 00:24:25 +10:00
DESTROOT_TARGETS+= destroot-install
CLEAN_TARGETS+= clean-install
DISTCLEAN_TARGETS+= distclean-install
2025-06-11 02:07:14 +10:00
CODESIGN_TARGETS+= install/build/install
TCL_INSTALL_D_ARG=
all-tcl: all-install
all-tclx: all-install
destroot-signify: all-install
2024-08-28 00:24:25 +10:00
endif
2024-09-25 11:54:03 +10:00
endif
2025-02-05 02:19:27 +11:00
ifeq (@OS_PLATFORM@,darwin)
CRITCL_TARGET= -target macosx-macports
endif
2024-07-03 20:01:01 +10:00
destroot: $(DESTROOT_TARGETS)
destroot-tcl: all-tcl
@echo ===\> staging to destroot in ${DIRPRFX}@VENDOR_TCL_SUBDIR@
@umask 0022; "$(MAKE)" -C "@VENDOR_TCL_SUBDIR@" "DESTDIR=$(DESTROOT)" "INSTALL=$(INSTALL)" $(TCL_INSTALL_D_ARG) @VENDOR_TCL_INSTALL@
2025-02-15 11:22:44 +11:00
[ "@OS_PLATFORM@" != darwin ] || install_name_tool -change "$(TCL_PREFIX)/lib/libtcl@TCL_VERSION@.dylib" \
2025-02-15 10:32:50 +11:00
"@executable_path/../lib/libtcl@TCL_VERSION@.dylib" \
2025-02-15 11:22:44 +11:00
"$(DESTROOT)$(TCL_PREFIX)/bin/tclsh@TCL_VERSION@"
destroot-tclx: all-tclx
@echo ===\> staging to destroot in ${DIRPRFX}@VENDOR_TCLX_SUBDIR@
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "@VENDOR_TCLX_SUBDIR@" "DESTDIR=${DESTROOT}" @VENDOR_TCLX_INSTALL@
2025-01-31 11:02:51 +11:00
# tcllib requires a working tclsh
2025-02-15 06:01:45 +11:00
destroot-tcllib: destroot-tcl
@echo ===\> staging to destroot in ${DIRPRFX}@VENDOR_TCLLIB_SUBDIR@
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "@VENDOR_TCLLIB_SUBDIR@" "DESTDIR=${DESTROOT}" TCLSH_PROG="@INTREE_TCLSH@" @VENDOR_TCLLIB_INSTALL@
2025-02-15 11:22:44 +11:00
@chmod -R ugo+rX $(DESTROOT)$(TCL_PREFIX)/lib/tcllib*
# The unusual values for --prefix and --dest-dir are because critcl's
# build system internally normalizes the prefix, which means the
# directory structure in the destroot would be different and prevent us
# from finding its files in other steps unless we also normalized,
# which is difficult on older macOS versions.
2025-02-15 06:01:45 +11:00
.stamp-critcl: $(CRITCL_SUBDIR)/lib/critcl/critcl.tcl | destroot-tcl
2025-02-05 02:19:27 +11:00
@echo ===\> staging to destroot in ${DIRPRFX}${CRITCL_SUBDIR}
@umask 0022; cd "$(CRITCL_SUBDIR)" && /usr/bin/env "HOME=@abs_top_builddir@/vendor" "@INTREE_TCLSH@" ./build.tcl install --prefix / --dest-dir "$(DESTROOT)$(TCL_PREFIX)" $(CRITCL_TARGET)
2025-02-15 11:22:44 +11:00
@chmod -R ugo+rX $(DESTROOT)$(TCL_PREFIX)/lib/critcl*
@touch .stamp-critcl
2025-02-05 02:19:27 +11:00
destroot-critcl: .stamp-critcl
2025-02-15 06:01:45 +11:00
.stamp-tcllibc: $(TCLLIB_SUBDIR)/support/installation/version.tcl .stamp-critcl
2025-02-05 02:19:27 +11:00
@echo ===\> staging tcllibc to destroot in ${DIRPRFX}@VENDOR_TCLLIB_SUBDIR@
2025-06-12 07:27:50 +10:00
@umask 0022; /usr/bin/env "PATH=$(DESTROOT)$(TCL_PREFIX)/bin:$$PATH" "$(MAKE)" -C "@VENDOR_TCLLIB_SUBDIR@" "DESTDIR=$(DESTROOT)" "CRITCL_TARGET=$(CRITCL_TARGET)" TCLSH_PROG="@INTREE_TCLSH@" install-binaries
2025-02-15 11:22:44 +11:00
@chmod -R ugo+rX $(DESTROOT)$(TCL_PREFIX)/lib/tcllib*
@touch .stamp-tcllibc
destroot-tcllibc: .stamp-tcllibc
2025-02-05 02:19:27 +11:00
2020-06-06 16:48:14 +02:00
destroot-signify:
@echo ===\> staging to destroot in ${DIRPRFX}${SIGNIFY_SUBDIR}
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "$(SIGNIFY_SUBDIR)" install "PREFIX=$(DESTROOT)$(TCL_PREFIX)"
2024-08-28 00:24:25 +10:00
destroot-install: all-install
2024-08-28 00:24:25 +10:00
@echo ===\> staging to destroot in ${DIRPRFX}${INSTALL_SUBDIR}
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "${INSTALL_SUBDIR}" install "DESTDIR=${DESTROOT}"
2020-06-06 16:48:14 +02:00
2025-02-05 02:19:27 +11:00
INSTALL_TARGETS= install-tcl install-tclx install-tcllib install-tcllibc
2024-07-03 20:01:01 +10:00
ifneq (@OS_PLATFORM@,linux)
INSTALL_TARGETS+= install-signify
endif
2024-08-28 00:24:25 +10:00
ifeq (@HAVE_CLONEFILE@,yes)
2024-09-25 11:54:03 +10:00
ifeq (@HAVE_DECL_CLONE_NOOWNERCOPY@,yes)
2024-08-28 00:24:25 +10:00
INSTALL_TARGETS+= install-install
endif
2024-09-25 11:54:03 +10:00
endif
2024-07-03 20:01:01 +10:00
install: $(INSTALL_TARGETS)
2017-01-08 22:30:47 +11:00
TCL_PACKAGE_PATH=@TCL_PACKAGE_PATH@
2026-04-12 09:57:26 +10:00
OLD_TCL_FILES= $(DESTDIR)$(TCL_PACKAGE_PATH)/tcl8 \
$(DESTDIR)$(TCL_PACKAGE_PATH)/tcl8.{5,6} \
2026-07-01 16:33:16 +10:00
$(DESTDIR)$(TCL_PACKAGE_PATH)/tcl9/9.0/{http-2.10.1,tcltest-2.5.10}.tm \
2026-04-12 09:57:26 +10:00
$(DESTDIR)$(TCL_PREFIX)/bin/tclsh8.{5,6} \
$(DESTDIR)$(TCL_PREFIX)/lib/libtcl8.{5,6}@SHLIB_SUFFIX@ \
$(DESTDIR)$(TCL_PREFIX)/lib/libtclstub8.{5,6}.a \
2022-11-25 08:14:41 +11:00
$(DESTDIR)$(TCL_PACKAGE_PATH)/thread2.7.{0,2,3} \
2026-04-12 09:57:26 +10:00
$(DESTDIR)$(TCL_PACKAGE_PATH)/thread2.8.{7,8,9,10,11,12} \
2026-07-01 16:33:16 +10:00
$(DESTDIR)$(TCL_PACKAGE_PATH)/thread3.0.4 \
2024-10-05 23:09:25 +10:00
$(DESTDIR)$(TCL_PACKAGE_PATH)/itcl4.2.{2,3,4} \
2026-07-01 16:33:16 +10:00
$(DESTDIR)$(TCL_PACKAGE_PATH)/itcl4.3.{0,2,4,5} \
$(DESTDIR)$(TCL_PACKAGE_PATH)/sqlite3.{36,40,51}.0 \
$(DESTDIR)$(TCL_PACKAGE_PATH)/sqlite3.{44,47}.2 \
2025-01-06 02:08:38 +11:00
$(DESTDIR)$(TCL_PACKAGE_PATH)/sqlite3.45.3 \
2026-04-12 09:57:26 +10:00
$(DESTDIR)$(TCL_PACKAGE_PATH)/sqlite3.50.4 \
2026-04-14 08:19:15 +10:00
$(DESTDIR)$(TCL_PACKAGE_PATH)/tdbc1.1.{3,5,7,9,10,12} \
$(DESTDIR)$(TCL_PACKAGE_PATH)/tdbc{mysql,odbc,postgres}*
2021-04-23 02:58:37 +02:00
install-tcl:
2017-01-08 22:30:47 +11:00
rm -rf $(OLD_TCL_FILES)
@echo ===\> making $(@:%-tcl=%) in ${DIRPRFX}@VENDOR_TCL_SUBDIR@
@umask 0022; "$(MAKE)" -C "@VENDOR_TCL_SUBDIR@" "INSTALL=$(INSTALL)" @VENDOR_TCL_INSTALL@
install-tclx:
2026-04-12 09:57:26 +10:00
rm -rf "$(DESTDIR)$(TCL_PACKAGE_PATH)/tclx8.4" "$(DESTDIR)$(TCL_PACKAGE_PATH)/tclx8.6"
@echo ===\> making $(@:%-tclx=%) in ${DIRPRFX}@VENDOR_TCLX_SUBDIR@
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "@VENDOR_TCLX_SUBDIR@" @VENDOR_TCLX_INSTALL@
install-tcllib:
2025-01-31 11:02:51 +11:00
rm -rf $(DESTDIR)$(TCL_PACKAGE_PATH)/tcllib1.*
@echo ===\> making $(@:%-tcllib=%) in ${DIRPRFX}@VENDOR_TCLLIB_SUBDIR@
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "@VENDOR_TCLLIB_SUBDIR@" TCLSH_PROG="@INTREE_TCLSH@" @VENDOR_TCLLIB_INSTALL@
2025-02-15 11:22:44 +11:00
@chmod -R ugo+rX $(DESTDIR)$(TCL_PREFIX)/lib/tcllib*
2025-02-15 06:01:45 +11:00
install-tcllibc:
@echo ===\> making $(@:%-tcllibc=%)
2025-02-15 11:22:44 +11:00
@umask 0022; cd "$(DESTROOT)$(TCL_PREFIX)/lib"; \
2025-02-15 06:01:45 +11:00
for d in $$(find tcllibc* -type d); do \
2025-02-15 11:22:44 +11:00
mkdir -p "$(DESTDIR)$(TCL_PREFIX)/lib/$$d"; \
done; \
2025-02-15 06:01:45 +11:00
for f in $$(find tcllibc* -type f); do \
$(INSTALL) -m 0444 "$$f" "$(DESTDIR)$(TCL_PREFIX)/lib/$$f"; \
done
2025-02-15 11:22:44 +11:00
@chmod -R ugo+rX $(DESTDIR)$(TCL_PREFIX)/lib/tcllibc*
2025-02-05 02:19:27 +11:00
2020-06-06 16:48:14 +02:00
install-signify:
@echo ===\> making $(@:%-signify=%) in ${DIRPRFX}${SIGNIFY_SUBDIR}
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "$(SIGNIFY_SUBDIR)" install "PREFIX=$(DESTDIR)$(TCL_PREFIX)"
2020-06-06 16:48:14 +02:00
2024-08-28 00:24:25 +10:00
install-install:
@echo ===\> making $(@:%-install=%) in ${DIRPRFX}${INSTALL_SUBDIR}
2025-06-12 07:27:50 +10:00
@umask 0022; "$(MAKE)" -C "${INSTALL_SUBDIR}" install
2024-08-28 00:24:25 +10:00
test:
clean: $(CLEAN_TARGETS)
2014-03-28 00:12:20 +00:00
rm -rf vendor-destroot
rm -f .stamp-*
2025-02-15 06:01:45 +11:00
rm -rf .critcl
2025-02-15 06:01:45 +11:00
distclean: $(DISTCLEAN_TARGETS)
rm -rf vendor-destroot
rm -f .stamp-*
rm -rf .critcl
rm -f Makefile
2017-01-18 14:54:41 -08:00
rm -f tclsh
2019-09-07 12:41:06 +10:00
2025-06-11 02:07:14 +10:00
codesign:: $(CODESIGN_TARGETS)
2019-09-07 12:41:06 +10:00
../src/codesign.sh $?
2021-04-23 02:58:37 +02:00