about summary refs log tree commit diff
path: root/Makefile
blob: b1aa5d26c2ab5f23626ad6ab8a8559235234ae45 (plain) (blame)
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
GITVER := $(shell git rev-parse --short HEAD)
VERSION = 0.22
PREFIX ?= /usr/local
SBINDIR ?= $(PREFIX)/sbin
SHAREDIR ?= $(PREFIX)/share
DRACUTMODDIR ?= $(PREFIX)/lib/dracut/modules.d/01vmklive

SHIN    += $(shell find -type f -name '*.sh.in')
SCRIPTS += $(SHIN:.sh.in=.sh)

%.sh: %.sh.in
	 sed -e "s|@@MKLIVE_VERSION@@|$(VERSION) $(GITVER)|g" $^ > $@
	 chmod +x $@

all: $(SCRIPTS)

install: all
	install -d $(DESTDIR)$(SBINDIR)
	install -m755 mkimage.sh $(DESTDIR)$(SBINDIR)/void-mkimage
	install -m755 mklive.sh $(DESTDIR)$(SBINDIR)/void-mklive
	install -m755 mkrootfs.sh $(DESTDIR)$(SBINDIR)/void-mkrootfs
	install -m755 installer.sh $(DESTDIR)$(SBINDIR)/void-installer
	install -d $(DESTDIR)$(DRACUTMODDIR)
	install -m755 dracut/*.sh $(DESTDIR)$(DRACUTMODDIR)
	install -d $(DESTDIR)$(SHAREDIR)/void-mklive
	install -m644 grub/*.cfg* $(DESTDIR)$(SHAREDIR)/void-mklive
	install -m644 isolinux/*.cfg* $(DESTDIR)$(SHAREDIR)/void-mklive

clean:
	-rm -f *.sh

dist:
	@echo "Building distribution tarball for tag: v$(VERSION) ..."
	-@git archive --format=tar --prefix=void-mklive-$(VERSION)/ \
		v$(VERSION) | xz -9 > ~/void-mklive-$(VERSION).tar.xz

.PHONY: all clean install dist