summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.mk39
-rw-r--r--graphviz/Makefile4
-rw-r--r--hello/Makefile4
3 files changed, 28 insertions, 19 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 $@
diff --git a/graphviz/Makefile b/graphviz/Makefile
index 633d9ed..57fbe5b 100644
--- a/graphviz/Makefile
+++ b/graphviz/Makefile
@@ -1,4 +1,4 @@
-URL = https://gitlab.com/graphviz/graphviz/-/package_files/7097035/download
-ARC = graphviz-2.46.1.tar.gz
+url = https://gitlab.com/graphviz/graphviz/-/package_files/7097035/download
+arc = graphviz-2.46.1.tar.gz
include ../build.mk
diff --git a/hello/Makefile b/hello/Makefile
new file mode 100644
index 0000000..f6c3fa6
--- /dev/null
+++ b/hello/Makefile
@@ -0,0 +1,4 @@
+url = http://mvertes.free.fr/download/hello-0.1.tar.gz
+configure_cmd = :
+
+include ../build.mk