File: Makefile

package info (click to toggle)
gap-matrix-schreiersims 0.9.20041122-3.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 716 kB
  • ctags: 47
  • sloc: makefile: 144
file content (112 lines) | stat: -rw-r--r-- 4,035 bytes parent folder | download | duplicates (2)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# to create packages
PACKAGE_FILES = Manifest.text Manifest.bin
CHECK_SUMS    = SHA1SUMS MD5SUMS
DIR           := $(shell pwd)
CUR_DIR       := $(notdir $(DIR))

# to upload packages
FTP_USER      = anonymous
FTP_PASSWD    = redstar_@users.sourceforge.net
FTP_DIR       = /incoming
FTP_HOST      = upload.sourceforge.net

# to upload homepage
WEB_SERVER    = shell.sourceforge.net
WEB_PATH      = /home/groups/m/ma/matrixss/htdocs
SCP_USER      = redstar_
WEB_FILES     = doc/www/*.html README PackageInfo.g ChangeLog 
WEBMAN_PATH   = /home/groups/m/ma/matrixss/htdocs/manual
WEBMAN_FILES  = htm/*.htm

# to perform test/benchmark
TEST_FILE     = tst/test.g
BENCH_FILE    = tst/bench.g
PROFILE_FILE  = tst/profile.g

DATE = $(shell date +%Y%m%d)
# package default name
ifeq ($(PACKAGE),)
	PACKAGE = matrixss-0.9.$(DATE)
	DEBPKG  = gap-matrix-schreiersims_0.9.$(DATE)
endif

# output package files
PACKAGES = tmp/$(PACKAGE).tar.gz tmp/$(PACKAGE)-win.zip \
           tmp/$(PACKAGE).zoo tmp/$(PACKAGE).tar.bz2

# checksum files regexp
SHA1 := $(word 1, $(CHECK_SUMS))
MD5  := $(word 2, $(CHECK_SUMS))
CHECKS := $(SHA1)\|$(MD5)

# for making html manual
HTML_MAN = ../../etc/convert.pl

all:

test:
	gap -q < $(TEST_FILE)

bench:
	gap -o 1g -K 2g -q < $(BENCH_FILE)

profile:
	gap -q < $(PROFILE_FILE)

release: upload www

checksums: $(CHECK_SUMS)

$(CHECK_SUMS): ChangeLog manual
	md5sum `grep --invert-match --extended-regexp --regexp=$(CHECKS) Manifest.text` > $(MD5)
	md5sum -b `grep --invert-match --extended-regexp --regexp=$(CHECKS) Manifest.bin` >> $(MD5)
	sha1sum --text `grep --invert-match --extended-regexp --regexp=$(CHECKS) Manifest.text` > $(SHA1)
	sha1sum --binary `grep --invert-match --extended-regexp --regexp=$(CHECKS) Manifest.bin` >> $(SHA1)

NEWS: doc/www/news.html
	html2text < $< > $@

ChangeLog: NEWS
	echo -e "Matrix Schreier-Sims ChangeLog\n" | cvs2cl --prune --separate-header --gmt --usermap AUTHORS --header -

deb: $(PACKAGES)
	cvs tag -F $(DEB_TAG) `grep --invert-match --extended-regexp --regexp=$(CHECKS) Manifest.text` Makefile doc/code.msk doc/config.matrixss doc/report/schreiersims.bib debian/*
	cp tmp/$(PACKAGE).tar.gz tmp/gap-matrix-schreiersims/$(DEBPKG).orig.tar.gz
	cvs-buildpackage -R $(DIR)/tmp -rfakeroot -kredstar -Mmatrixss

manual: 
	$(MAKE) -C doc $@
	$(HTML_MAN) -c -t -i -n matrixss doc htm

package: manual $(PACKAGES)

$(PACKAGES): ChangeLog checksums
	mkdir --parents tmp/gap-matrix-schreiersims
#	mkdir --parents tmp/doc
#	cp ../../doc/gapmacro.tex tmp/doc/
	cat $(PACKAGE_FILES) | sed --expression='s/^/$(CUR_DIR)\//' | tar --verify --verbose --create --directory .. --file tmp/$(PACKAGE).tar --files-from - 
	bzip2 --keep --verbose --best --force tmp/$(PACKAGE).tar
	bzip2 --test --verbose tmp/$(PACKAGE).tar.bz2
	gzip --best --force --verbose tmp/$(PACKAGE).tar
	gzip --verbose --test tmp/$(PACKAGE).tar.gz
	cd .. && cat $(CUR_DIR)/Manifest.text | sed --expression='s/^/$(CUR_DIR)\//' | zip -v -l -9 $(CUR_DIR)/tmp/$(PACKAGE)-win.zip -@ && cd $(CUR_DIR)
	cd .. && cat $(CUR_DIR)/Manifest.bin | sed --expression='s/^/$(CUR_DIR)\//' | zip -v -9 $(CUR_DIR)/tmp/$(PACKAGE)-win.zip -@ && cd $(CUR_DIR)
	unzip -t tmp/$(PACKAGE)-win.zip
	cd .. && cat $(CUR_DIR)/Manifest.text | sed --expression='s/^\([^!/]\)/$(CUR_DIR)\/\1/' | perl -e '{ while(<>) { print; print "!TEXT!\n/END\n"; } }' | zoo achPI $(CUR_DIR)/tmp/$(PACKAGE).zoo && cd $(CUR_DIR)
	cd .. && cat $(CUR_DIR)/Manifest.bin | sed --expression='s/^\([^!/]\)/$(CUR_DIR)\/\1/' | zoo ahPI $(CUR_DIR)/tmp/$(PACKAGE).zoo && cd $(CUR_DIR)
	zoo xN tmp/$(PACKAGE).zoo

upload:
	ncftpput -u $(FTP_USER) -p $(FTP_PASSWD) $(FTP_HOST) $(FTP_DIR) $(PACKAGES) tmp/gap-matrix-schreiersims/$(DEBPKG)*

www: ChangeLog
	scp $(WEB_FILES) $(SCP_USER)@$(WEB_SERVER):$(WEB_PATH)
	scp $(WEBMAN_FILES) $(SCP_USER)@$(WEB_SERVER):$(WEBMAN_PATH)

distclean:
	rm --force $(PACKAGES) $(CHECK_SUMS) ChangeLog NEWS

clean:
	rm --force $(PACKAGES) $(CHECK_SUMS) ChangeLog NEWS htm/*.htm
	rm --recursive --force tmp *~ *.bak debian/*~
	$(MAKE) -C doc clean