summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: ba4bc5a8083226da47ef3e26b6ba59bd493abab2 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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)

svntag:
	-svn mkdir $(SVN_BASE)/releases/$(TAG) -m "created directory $(TAG)"
	svn copy $(SVNCOPY) $(SVNROOT)/releases/$(TAG) -m "Tagged as $(TAG)"

# Makefile ends here