summaryrefslogtreecommitdiff
path: root/build.mk
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2021-02-21 10:18:33 +0100
committerMarc Vertes <mvertes@free.fr>2021-02-21 10:18:33 +0100
commit68017f46742241cd6842422b7c009e59d65f73a4 (patch)
tree6f0348082225b37a8683f9f19b6df33b168596ac /build.mk
creation
Diffstat (limited to 'build.mk')
-rw-r--r--build.mk46
1 files changed, 46 insertions, 0 deletions
diff --git a/build.mk b/build.mk
new file mode 100644
index 0000000..8a18571
--- /dev/null
+++ b/build.mk
@@ -0,0 +1,46 @@
+# Rules to fetch, build and install external source packages.
+#
+# TODO:
+# - default commands
+# - rules for pre-req dependencies
+# - rules to build and maintain patches
+#
+ARC ?= $(notdir $(URL))
+DIR ?= $(basename $(basename $(ARC)))
+
+clean:
+ rm -rf .install .build .configure .fetch .extract $(DIR)
+
+debug:
+ @echo arc: $(ARC)
+ @echo dir: $(DIR)
+
+install: .install
+build: .build
+configure: .configure
+extract: .extract
+fetch: .fetch
+
+uninstall: .install
+ cd $(DIR) && sudo make uninstall
+ rm .install
+
+.install: .build
+ cd $(DIR) && sudo make install
+ touch $@
+
+.build: .configure
+ cd $(DIR) && make
+ touch $@
+
+.configure: .extract
+ cd $(DIR) && ./configure $(CONFIGURE_FLAGS)
+ @touch $@
+
+.extract: .fetch
+ gunzip < $(ARC) | tar xf -
+ @touch $@
+
+.fetch:
+ curl -L $(URL) -o $(ARC)
+ @touch $@