summaryrefslogtreecommitdiff
blob: 05a8b7ed6a8c6e3fc2685e6bab33b1df1ce47e19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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