diff options
author | Eric Wong <e@80x24.org> | 2016-11-12 02:13:42 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-01-01 03:30:41 +0000 |
commit | 76c10dada86fd807d36ccafca393e945e381696a (patch) | |
tree | 88227412057f87821a78e6f97c0ec864e9431ce5 /GNUmakefile | |
download | msgthr-76c10dada86fd807d36ccafca393e945e381696a.tar.gz |
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..49ab677 --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,45 @@ +# 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 := 0.0.0 + +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 + 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) + +.PHONY: all test $(test_units) +.PHONY: check-warnings fix-perms |