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 --- build.mk | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'build.mk') 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 $@ -- cgit v1.2.3