summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile47
1 files changed, 47 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..05a8b7e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DESTDIR =
+prefix = /usr
+bindir = $(prefix)/bin
+libdirname = lib
+datadir = $(prefix)/share
+patchdir = $(datadir)/elt-patches
+
+all: eltpatch
+install: install-bin install-patch
+distclean: clean
+
+eltpatch: eltpatch.in
+ rm -f $@ $@.tmp
+ sed -e 's^@ELT_patchdir@^$(patchdir)^' \
+ -e 's^@ELT_libdir@^$(libdirname)^' \
+ $< > $@.tmp
+ chmod +x $@.tmp
+ mv $@.tmp $@
+
+clean:
+ rm -f eltpatch
+
+install-bin: eltpatch
+ install -d $(DESTDIR)$(bindir)
+ install -m0755 $< $(DESTDIR)$(bindir)
+
+install-patch:
+ install -d $(DESTDIR)$(patchdir)
+ cd patches && \
+ for dir in */; do \
+ install -d $(DESTDIR)$(patchdir)/$${dir} || exit 1; \
+ for file in $${dir}/*; do \
+ install -m0644 $${file} $(DESTDIR)$(patchdir)/$${dir} \
+ || exit 1; \
+ done; \
+ done
+
+dist:
+ rm -f elt-patches-$$(date +%Y%m%d).tar.xz elt-patches-$$(date +%Y%m%d).tar
+ git archive -o elt-patches-$$(date +%Y%m%d).tar \
+ --prefix=elt-patches-$$(date +%Y%m%d)/ \
+ --format=tar \
+ HEAD
+ xz -9 elt-patches-$$(date +%Y%m%d).tar