File: Makefile

package info (click to toggle)
qla-tools 20090804-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 136 kB
  • ctags: 6
  • sloc: makefile: 71
file content (38 lines) | stat: -rw-r--r-- 1,188 bytes parent folder | download
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
TARS=$(shell ls ql-set-cmd-timeout-*.tgz \
             ql-hba-snapshot-*.tgz       \
             ql-lun-state-online-*.tgz   \
             ql-dynamic-tgt-lun-disc-*.tgz)
DIRS=$(patsubst %.tgz,%,$(TARS))

SCRIPTS=$(shell find . -name '*.sh')

all: $(DIRS)

%: %.tgz
	tar zxf $<

install: $(SCRIPTS)
	for SCRIPT in $(SCRIPTS); do \
	    cp $$SCRIPT $(DESTDIR)/usr/sbin/`basename $$SCRIPT .sh`; \
	done

clean:
	rm -rf $(DIRS)


# This target is called by hand to create the basic manpages. Due the use of
# escape sequences in the scripts some handwork in the manpages is needed.
manpages: $(SCRIPTS)
	for SCRIPT in $(SCRIPTS); do \
	    help2man --version-option -h -N ./$$SCRIPT > /tmp/`basename $$SCRIPT .sh`.8 ; \
	done

QL_DYN_TGT_VERSION=$(shell ls ql-dynamic-tgt-lun-disc-*.tgz| sed 's/ql-dynamic-tgt-lun-disc-\(.*\).tgz/\1/')

repack: clean $(DIRS)
	mv ql-dynamic-tgt-lun-disc-$(QL_DYN_TGT_VERSION) ql-dynamic-tgt-lun-disc-repacked-$(QL_DYN_TGT_VERSION)
	rm ql-dynamic-tgt-lun-disc-repacked-$(QL_DYN_TGT_VERSION)/sg3_utils-*.tgz
	tar --exclude=*.tgz -zcf ql-dynamic-tgt-lun-disc-repacked-$(QL_DYN_TGT_VERSION).tgz ql-dynamic-tgt-lun-disc-repacked-*
	$(MAKE) clean

.PHONY: clean