PL=rebootin SH_FILES=detectloader installkernel installkernel.sysconfig kernel_remove_initrd SH=$(SH_FILES) MAN=rebootin.8 detectloader.8 ARCH=$(shell uname -m) UTILS = bootloader-utils.spec Makefile FILES = $(PL) $(SH_FILES) $(MAN) $(UTILS) PACKAGE=bootloader-utils VERSION=1.16 TAG = $(VERSION) all: check check: @for i in $(SH);do /bin/bash -n $$i || exit 1;echo $$i syntax OK;done @for i in $(PL);do perl -c $$i ||exit 1;done install: check install -d $(ROOT)/usr/share/man/man8/ install -d $(ROOT)/{,usr}/sbin install -d $(ROOT)/etc/sysconfig install -d $(ROOT)/etc/rc.d/init.d install -m644 $(MAN) $(ROOT)/usr/share/man/man8/ install -m755 installkernel $(ROOT)/sbin/ install -m755 kernel_remove_initrd $(ROOT)/sbin/ install -m644 installkernel.sysconfig $(ROOT)/etc/sysconfig/installkernel install -m755 rebootin detectloader $(ROOT)/usr/sbin/ clean: rm -f *~ $(PACKAGE)-*.tar.bz2 # rules to build a test dist localdist: cleandist dir localcopy tar cleandist: rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.bz2 dir: mkdir $(PACKAGE)-$(VERSION) localcopy: tar c $(FILES) | tar x -C $(PACKAGE)-$(VERSION) # rules to build a distributable dist dist: cleandist @git archive --prefix=$(PACKAGE)-$(VERSION)/ HEAD | xz > $(PACKAGE)-$(VERSION).tar.xz; $(info $(PACKAGE)-$(VERSION).tar.xz is ready) tag: git tag $(TAG) git push origin $(TAG) # Makefile ends here