From 27aa16e615bbd1e9fd358bb7f894d0fbbad00938 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Sun, 28 Feb 2021 20:50:48 +0100 Subject: handle git urls, add vftool --- .gitignore | 1 + build.mk | 16 +++++++++++++--- vftool/Makefile | 8 ++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 vftool/Makefile diff --git a/.gitignore b/.gitignore index 64dc328..4cf3bdf 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .fetch .install */*-* +*/*/ diff --git a/build.mk b/build.mk index 085c9f4..fe7da00 100644 --- a/build.mk +++ b/build.mk @@ -6,13 +6,23 @@ # - rules to run tests before installing # - build and run in chroot # + arc ?= $(notdir $(url)) -dir ?= $(basename $(basename $(arc))) configure_cmd ?= ./configure build_cmd ?= make install_cmd ?= sudo make install uninstall_cmd ?= sudo make uninstall +ifdef git_url + fetch_cmd = git clone --depth=1 $(git_url) + extract_cmd = : + dir ?= $(notdir $(git_url)) +else + fetch_cmd = curl -L $(url) -o $(arc) + extract_cmd = gunzip < $(arc) | tar xf - + dir ?= $(basename $(basename $(arc))) +endif + clean: rm -rf .install .build .configure .extract .fetch $(dir) @@ -43,9 +53,9 @@ fetch: .fetch @touch $@ .extract: .fetch - gunzip < $(arc) | tar xf - + $(extract_cmd) @touch $@ .fetch: - curl -L $(url) -o $(arc) + $(fetch_cmd) @touch $@ diff --git a/vftool/Makefile b/vftool/Makefile new file mode 100644 index 0000000..957e430 --- /dev/null +++ b/vftool/Makefile @@ -0,0 +1,8 @@ +# vftool is a CLI to run virtual machines on MacOS 11 only + +git_url = https://github.com/evansm7/vftool +configure_cmd = : +install_cmd = sudo cp build/vftool /usr/local/bin +uninstall_cmd = sudo rm /usr/local/bin/vftool + +include ../build.mk -- cgit v1.2.3