1 # when making release, make sure you do it as RELEASE document describes
3 VERSION := $(shell test -d .git && git describe --tags || echo git)
4 MODS := ide luks multipath dmraid lvm md blkid udev tuxonice suspend fbsplash condecor bootsplash uvesafb nfs sata scsi usbkbd
5 FILES_MODS := $(MODS:%=mod-%.sh)
6 FILES_ADDON := extract-ikconfig
7 FILES_UDEV := 01-ignore.rules 59-persistent-storage.rules 61-persistent-storage.rules 11-dm.rules
8 FILES := Makefile $(NAME).sysconfig $(NAME) functions $(FILES_MODS) $(FILES_ADDON) $(NAME).8 $(NAME).8.xml ChangeLog
10 mandir := $(prefix)/share/man
12 libdir := /lib/geninitrd
13 udevdir := $(libdir)/udev-rules
14 sysconfigdir := /etc/sysconfig
19 install -d $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8 $(DESTDIR)$(libdir) $(DESTDIR)$(sysconfigdir) $(DESTDIR)$(udevdir)
20 install -p $(NAME) $(DESTDIR)$(sbindir)/$(NAME)
21 install -p -m644 $(NAME).8 $(DESTDIR)$(mandir)/man8/$(NAME).8
22 install -p -m644 functions $(DESTDIR)$(libdir)/functions
23 install -p -m644 $(FILES_MODS) $(DESTDIR)$(libdir)
24 install -p -m755 $(FILES_ADDON) $(DESTDIR)$(libdir)
25 install -p -m644 $(NAME).sysconfig $(DESTDIR)$(sysconfigdir)/$(NAME)
26 for file in ${FILES_UDEV}; do \
27 install -p -m644 udev-rules/$${file} $(DESTDIR)$(udevdir); \
30 refentry2man := /usr/bin/refentry2man
31 $(NAME).8: $(NAME).8.xml $(refentry2man)
32 $(refentry2man) < $< > $@.tmp && mv $@.tmp $@ || { rm -f $@.tmp; exit 1; }
34 dist: clean $(NAME)-$(VERSION).tar.gz
36 @echo "Do not forget to tag the release"
44 rm -f $(NAME)-*.tar $(NAME)-*.tar.gz
50 $(NAME)-$(VERSION).tar.gz: $(NAME)-$(VERSION).tar
53 $(NAME)-$(VERSION).tar: $(NAME).8 ChangeLog
54 rm -rf $(NAME)-$(VERSION)
55 install -d $(NAME)-$(VERSION)
56 git archive HEAD --prefix $(NAME)-$(VERSION)/ -o $@
57 cp -p $? $(NAME)-$(VERSION)
58 tar -rvf $@ --owner=root --group=root $(NAME)-$(VERSION)/*