Files
Joshua Root 3da9cd2a0d Use clonefile(2) in more places
A lot of file copies that we create are not subsequently modified,
especially in the destroot phase. This makes cloning a more efficient
alternative.

* Modified xinstall and 'file copy' Tcl commands to try cloning.
* Created a vendored copy of install(1) that tries cloning.
* Created a thin wrapper around cp(1) that adds the -c flag.
* If the build directory is on a filesystem that supports cloning, the
  configure.install option defaults to our install(1), and the
  directory containing our install and cp commands is added to the
  front of PATH, currently only during the destroot phase.

The code for all of the above is not built on systems that lack
clonefile(2). If cloning fails, everything will fall back to creating
a copy as previously done.
2024-08-28 00:24:25 +10:00

39 lines
686 B
Makefile

srcdir = @srcdir@
VPATH = @srcdir@
include ../../Mk/macports.autoconf.mk
SRCS = xinstall.c
OBJS = xinstall.o
PROGRAM = build/install
.PHONY: xinstall mkdirs
all: xinstall
xinstall: mkdirs ${PROGRAM}
${PROGRAM}: ${OBJS}
${CC} ${CFLAGS} -o ${PROGRAM} ${LIBS} ${OBJS}
mkdirs:
mkdir -p build
clean:
rm -Rf build ${PROGRAM} ${OBJS}
distclean: clean
rm -f Makefile
install: xinstall
${INSTALL} -d -m 755 "${DESTDIR}${TCL_PREFIX}/clonebin"
${INSTALL} -m 555 "${PROGRAM}" "${DESTDIR}${TCL_PREFIX}/clonebin"
test: xinstall
if which -s kyua > /dev/null ; then \
cd tests && env "PATH=../build:$$PATH" kyua test ; \
fi
codesign:: ${PROGRAM}
../../codesign.sh $?