summaryrefslogtreecommitdiff
path: root/build.mk
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2021-02-21 16:22:11 +0100
committerMarc Vertes <mvertes@free.fr>2021-02-21 16:22:11 +0100
commit5bcac09370adfb26c25bdf98d371bbcc730f86c3 (patch)
tree6a07f46b25e974aa5c2c39fa1bcb8f7c425312ec /build.mk
parent68017f46742241cd6842422b7c009e59d65f73a4 (diff)
update
Diffstat (limited to 'build.mk')
-rw-r--r--build.mk39
1 files changed, 22 insertions, 17 deletions
diff --git a/build.mk b/build.mk
index 8a18571..085c9f4 100644
--- a/build.mk
+++ b/build.mk
@@ -1,19 +1,28 @@
# Rules to fetch, build and install external source packages.
#
# TODO:
-# - default commands
# - rules for pre-req dependencies
# - rules to build and maintain patches
+# - rules to run tests before installing
+# - build and run in chroot
#
-ARC ?= $(notdir $(URL))
-DIR ?= $(basename $(basename $(ARC)))
+arc ?= $(notdir $(url))
+dir ?= $(basename $(basename $(arc)))
+configure_cmd ?= ./configure
+build_cmd ?= make
+install_cmd ?= sudo make install
+uninstall_cmd ?= sudo make uninstall
clean:
- rm -rf .install .build .configure .fetch .extract $(DIR)
+ rm -rf .install .build .configure .extract .fetch $(dir)
debug:
- @echo arc: $(ARC)
- @echo dir: $(DIR)
+ @echo arc = $(arc)
+ @echo dir = $(dir)
+
+uninstall: .install
+ cd $(dir) && $(uninstall_cmd)
+ rm .install
install: .install
build: .build
@@ -21,26 +30,22 @@ configure: .configure
extract: .extract
fetch: .fetch
-uninstall: .install
- cd $(DIR) && sudo make uninstall
- rm .install
-
.install: .build
- cd $(DIR) && sudo make install
- touch $@
+ cd $(dir) && $(install_cmd)
+ @touch $@
.build: .configure
- cd $(DIR) && make
- touch $@
+ cd $(dir) && $(build_cmd)
+ @touch $@
.configure: .extract
- cd $(DIR) && ./configure $(CONFIGURE_FLAGS)
+ cd $(dir) && $(configure_cmd) $(configure_flags)
@touch $@
.extract: .fetch
- gunzip < $(ARC) | tar xf -
+ gunzip < $(arc) | tar xf -
@touch $@
.fetch:
- curl -L $(URL) -o $(ARC)
+ curl -L $(url) -o $(arc)
@touch $@