PL=rebootin SH_FILES=detectloader installkernel installkernel.sysconfig kernel_remove_initrd SH=$(SH_FILES) kheader MAN=rebootin.8 detectloader.8 FROMPERLFILES=kheader ARCH=$(shell uname -m) UTILS = bootloader-utils.spec Makefile FILES = $(PL) $(SH_FILES) $(MAN) $(UTILS) $(FROMPERLFILES:%=%.pl) PACKAGE=bootloader-utils VERSION=1.15 TAG = $(VERSION) SVN_URL := $(shell svn info | sed -n '/^URL[^:]*: *\(.*\)/s//\1/p') SVNROOT := $(shell dirname $(SVN_URL)) SVNCOPY = $(SVN_URL) all: $(FROMPERLFILES) 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/ install -m755 kheader $(ROOT)/etc/rc.d/init.d/kheader $(FROMPERLFILES) : %: %.pl rm -f $@ perl $< > $@ chmod a-w $@ clean: rm -f *~ $(FROMPERLFILES) $(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) tar: tar cvf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION) bzip2 -9vf $(PACKAGE)-$(VERSION).tar rm -rf $(PACKAGE)-$(VERSION) # rules to build a distributable dist dist: cleandist export tar export: svn export $(SVNROOT)/releases/$(TAG) $(PACKAGE)-$(VERSION) svntag: -svn mkdir $(SVN_BASE)/releases/$(TAG) -m "created directory $(TAG)" svn copy $(SVNCOPY) $(SVNROOT)/releases/$(TAG) -m "Tagged as $(TAG)" localchangelog: #svn2cl is available in our contrib. svn cat `dirname $(SVNROOT)`/common/username.xml > $$TMPDIR/username.xml; \ svn2cl --authors $$TMPDIR/username.xml --accum; \ rm -f ChangeLog.bak $$TMPDIR/username.xml changelog: localchangelog svn commit -m "Generated by svn2cl the `date '+%d_%b'`" ChangeLog # Makefile ends here