msgthr.git  about / heads / tags
non-recursive, container-agnostic message threading
blob b9c3e222113fd36e72d18164bc0533f2e5c30201 1774 bytes (raw)
$ git show HEAD:GNUmakefile	# shows this blob on the CLI

 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
 
# Copyright (C) 2016 all contributors <msgthr-public@80x24.org>
# License: GPL-2.0+ <https://www.gnu.org/licenses/gpl-2.0.txt>
all::
pkg = msgthr
RUBY = ruby
lib := lib
VERSION := 1.2.2
RSYNC_DEST := 80x24.org:/srv/80x24/msgthr/

RSYNC = rsync
OLDDOC = olddoc
RDOC = rdoc

all:: test
test_units := $(wildcard test/test_*.rb)
test: $(test_units)
$(test_units):
	$(RUBY) -w -I $(lib) $@ -v

check-warnings:
	@(for i in $$(git ls-files '*.rb'| grep -v '^setup\.rb$$'); \
	  do $(RUBY) -d -W2 -c $$i; done) | grep -v '^Syntax OK$$' || :

check: test

pkggem := pkg/$(pkg)-$(VERSION).gem

fix-perms:
	git ls-tree -r HEAD | awk '/^100644 / {print $$NF}' | xargs chmod 644

gem: $(pkggem)

install-gem: $(pkggem)
	gem install --local $(CURDIR)/$<

$(pkggem): .manifest NEWS
	VERSION=$(VERSION) gem build $(pkg).gemspec
	mkdir -p pkg
	mv $(@F) $@

pkg_extra :=

.manifest: fix-perms
	git ls-files | LC_ALL=C sort >$@+
	cmp $@+ $@ || mv $@+ $@; rm -f $@+

package: $(pkggem)

NEWS: .olddoc.yml
	$(OLDDOC) prepare || echo 'See https://80x24.org/msgthr/NEWS' >$@
LATEST: NEWS

doc:: .document .olddoc.yml
	-find lib -type f -name '*.rbc' -exec rm -f '{}' ';'
	$(RM) -r doc
	$(OLDDOC) prepare
	$(RDOC) -f dark216

# this requires GNU coreutils variants
ifneq ($(RSYNC_DEST),)
publish_doc:
	-git set-file-times
	$(MAKE) doc
	mkdir -p www
	$(RM) -r www/rdoc
	mv doc www/rdoc
	install -m644 README www/README
	install -m644 NEWS www/NEWS
	install -m644 NEWS.atom.xml www/NEWS.atom.xml
	for i in $$(find www -type f ! -regex '^.*\.gz$$'); do \
	  gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
	$(RSYNC) -av www/ $(RSYNC_DEST) \
		--exclude index.html* --exclude created.rid*
	git ls-files | xargs touch
endif

.PHONY: all test $(test_units)
.PHONY: check-warnings fix-perms

git clone https://80x24.org/msgthr.git