From a25ce9cfb95d834cb7d338cb2618b5fcd6eed489 Mon Sep 17 00:00:00 2001 From: "Ian A. Mason" Date: Thu, 31 Oct 2019 19:36:49 +0000 Subject: [PATCH] touch could be a useful test. --- examples/coreutils/Makefile | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 examples/coreutils/Makefile diff --git a/examples/coreutils/Makefile b/examples/coreutils/Makefile new file mode 100644 index 0000000..730fd7b --- /dev/null +++ b/examples/coreutils/Makefile @@ -0,0 +1,36 @@ +VERSION=8.31 +SRC=coreutils-${VERSION} +TAR=${SRC}.tar.xz +URL=https://ftp.gnu.org/gnu/coreutils/${TAR} + + +all: touch.bc + +${TAR}: + wget ${URL} + +${SRC}: ${TAR} + tar xvf ${TAR} + touch ${SRC} + + +${SRC}/Makefile: ${SRC} + cd ${SRC}; CC=gclang ./configure + +${SRC}/src/touch: ${SRC}/Makefile + cd ${SRC}; make + touch ${SRC}/src/touch + +touch.bc: ${SRC}/src/touch + get-bc -o touch.bc -m ${SRC}/src/touch + +touch_from_bitcode: touch.bc + clang++ touch.bc -o touch + +clean: + rm -rf touch touch.bc touch.bc.llvm.manifest + make -C ${SRC} + +spotless: + rm -rf ${SRC} ${TAR} +