summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--build.mk16
-rw-r--r--vftool/Makefile8
3 files changed, 22 insertions, 3 deletions
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