repobrowse 0.0.0
[repobrowse.git] / GNUmakefile
blob52a04d3ddca926aef8a06c2a3c3ac3316fa25be0
1 # Copyright (C) 2013-2018 all contributors <repobrowse-public@80x24.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3 all::
4 rubybin := $(shell which ruby)
5 RUBY = $(rubybin)
6 lib := lib
8 # support using eatmydata to speed up tests (apt-get install eatmydata):
9 # https://www.flamingspork.com/projects/libeatmydata/
10 EATMYDATA =
11 -include config.mak
13 ifeq ($(RUBY_TEST_OPTS),)
14 ifeq ($(V),1)
15 RUBY_TEST_OPTS := -v
16 endif
17 endif
19 all:: test
20 test_units := $(wildcard test/test_*.rb)
21 test: $(test_units)
22 $(test_units):
23 $(EATMYDATA) $(RUBY) -w -I $(lib) $@ $(RUBY_TEST_OPTS)
25 check-warnings:
26 @(for i in $$(git ls-files '*.rb'| grep -v '^setup\.rb$$'); \
27 do $(RUBY) -d -W2 -c $$i; done) | grep -v '^Syntax OK$$' || :
29 check: test
31 coverage: export COVERAGE=1
32 coverage:
33 >coverage.dump
34 $(MAKE) check
35 $(RUBY) ./test/covshow.rb
37 .PHONY: all test $(test_units) NEWS
38 .PHONY: check-warnings fix-perms