File: Makefile

package info (click to toggle)
misspell-fixer 0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,024 kB
  • sloc: sed: 20,181; sh: 993; makefile: 41; perl: 26
file content (51 lines) | stat: -rw-r--r-- 1,566 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
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/make

.PHONY: test prepare_environment coveralls

all: lint_dicts $(wildcard rules/*.sed)

rules/%.sed: dict/%.dict
	./util/convert-dict-to-sed.pl <$< >./$@
	chmod a+x ./$@

lint_dicts:
	./util/lint-dicts.sh

ifeq ($(wildcard /usr/local/bin/kcov),)
    KCOV_BIN = kcov
else
    KCOV_BIN = /usr/local/bin/kcov
endif

ifeq ($(wildcard shunit2-2.1.8),)
    SHUNIT_PREFIX = ""
else
    SHUNIT_PREFIX = shunit2-2.1.8/
endif

KCOV=${KCOV_BIN} --include-pattern=misspell-fixer/misspell-fixer,misspell-fixer/lib --path-strip-level=1
COV_DIR=/tmp/coverage
KCOV_WITH_ENV=env -i COVERAGE_WRAPPER="${KCOV} ${COV_DIR}-forks $(CURDIR)/test/coverage_wrapper.sh" SHUNIT_PREFIX=${SHUNIT_PREFIX} ${KCOV}
test_with_coverage:
	${KCOV_WITH_ENV} ${COV_DIR}-main test/tests.sh &&\
	${KCOV_WITH_ENV} --coveralls-id=${TRAVIS_JOB_ID} --merge ${COV_DIR} ${COV_DIR}-main ${COV_DIR}-forks

test:
	/bin/bash -c 'source test/tests.sh'

test_self:
	env -i SHUNIT_PREFIX=${SHUNIT_PREFIX}test/self-spelling-test.sh

prepare_environment:
	sudo apt-get update -qq
	sudo apt-get install -y elfutils libdw1 libasm1 libdw-dev libelf-dev libcurl4-openssl-dev cmake g++ zlib1g-dev python3 libssl-dev shunit2
	cd /tmp;git clone --branch v41 https://github.com/SimonKagstrom/kcov kcov
	cd /tmp/kcov;cmake ./;make;sudo make install

man:
	ronn --roff --manual=misspell-fixer README.md
	sed -i -e 's/README/misspell-fixer/g' -e '/travis/d' -e '/Jump to docker/d' README
	sed -i '/.TH /a .SH NAME\
	misspell-fixer \- misspell-fixer' README
	sed -e "s/\\\'/'/g" README >doc/misspell-fixer.1
	rm README