summaryrefslogtreecommitdiff
path: root/Makefile
blob: d45757c97052f590bd039e03ea9465e109073209 (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
PREFIX?=/usr/local
BINDIR?=$(PREFIX)/bin
DATADIR?=$(PREFIX)/share
MANDIR?=$(DATADIR)/man
MAN1DIR?=$(MANDIR)/man1
LIBDIR?=$(PREFIX)/lib
SYSDDIR?=$(LIBDIR)/systemd/system
USERSDIR?=$(LIBDIR)/sysusers.d

all: mirror

%: %.sh
	sed s/@VERSION@/`./version`/g <$< >$@
	chmod +x $@

clean:
	rm -f mirror

install: all
	install -m755 -Dt $(DESTDIR)$(BINDIR) mirror
	install -m644 -Dt $(DESTDIR)$(MAN1DIR) mirror.1
	install -m644 -Dt $(DESTDIR)$(SYSDDIR) mirror.{timer,service}
	install -m644 -Dt $(DESTDIR)$(USERSDIR) mirror.conf

uninstall:
	rm -f $(DESTDIR)$(BINDIR)/mirror
	rm -f $(DESTDIR)$(MAN1DIR)/mirror.1
	rm -f $(DESTDIR)$(SYSDDIR)/mirror.{timer,service}
	rm -f $(DESTDIR)$(USERSDIR)/mirror.conf

.PHONY: all clean install uninstall