File: Makefile

package info (click to toggle)
shelltestrunner 1.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 896 kB
  • sloc: haskell: 881; makefile: 60; sh: 1
file content (101 lines) | stat: -rw-r--r-- 3,109 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
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
# shelltestrunner project makefile

# ensure a utf8-aware locale is set, required by ghc executables
export LANG = en_US.UTF-8

# which stack.yaml file (& ghc version) to use, can be overridden by STACK env var
STACKYAML ?= stack.yaml

# used below and also in tests which run stack
STACKYAMLOPT = --stack-yaml=$(STACKYAML)

# the current base stack command
STACK = stack --silent $(STACKYAMLOPT)

# the shelltest executable built with current stack
SHELLTESTEXE = $(shell $(STACK) path --local-install-root)/bin/shelltest

# the base shelltest command with common options,
# and the STACKYAMLOPT env var which helps any tests
# which run stack themselves (eg large-output.test)
SHELLTEST = STACKYAMLOPT="$(STACKYAMLOPT)" $(SHELLTESTEXE) --exclude /_ -j16 --hide-successes

# standard targets

default: build

build:
	@$(STACK) build

install:
	@$(STACK) install

ghci:
	@echo
	@echo "Warning: argumentss will be accepted in GHCI only on first run after load,"
	@echo "probably because of using cmdargs' unsafeperformio-based easy mode."
	@echo
	$(STACK) ghci

ghcid:
	$(STACK) exec -- ghcid

test: testcross testunix testbash testexamples

# tests

# run cross-platform shell tests
testcross: build
	@echo; echo "cross-platform tests should succeed:"
	$(SHELLTEST) -w $(SHELLTESTEXE) tests -x /bash -x /examples -x .windows -x .unix

# run unix-specific shell tests
testunix: build
	@echo; echo "on unix, unix tests should succeed:"
	$(SHELLTEST) -w $(SHELLTESTEXE) tests/*.unix

# run windows-specific shell tests
# (though if you are using make on windows, you may be able to, or may have to, use testunix)
testwindows: build
	@echo; echo "on windows, windows tests should succeed:"
	@$(SHELLTEST) -w $(SHELLTESTEXE) tests/*.windows

# run bash-specific shell tests
testbash: build
	@echo; echo "when using bash, bash tests should succeed:"
	@$(SHELLTEST) tests/bash --shell /bin/bash

# run tests of the README examples
testexamples: build
	@echo; echo "README examples should succeed:"
	@$(SHELLTEST) tests/examples

# misc

LASTTAG=$(shell git describe --tags --abbrev=0)

changes-show: $(call def-help,changes-show, show commits affecting the current directory excluding any hledger package subdirs from the last tag as org nodes newest first )
	@make changes-show-from-$(LASTTAG)

changes-show-from-%: #$(call def-help,changes-show-from-REV, show commits affecting the current directory excluding any hledger package subdirs from this git revision onward as org nodes newest first )
	@git log --abbrev-commit --pretty=format:'ORGNODE %s (%an)%n%b%h' $*.. -- . ':!hledger' ':!hledger-*' \
		| sed -e 's/^\*/-/' -e 's/^ORGNODE/*/' \
		| sed -e 's/ (Simon Michael)//'

loc:
	@echo Current lines of code including tests:
	@sloccount src | grep haskell:

# files to tag
HSFILES=src/*.hs src/Utils/*.hs
TESTFILES=tests/format*/*.test

tag: $(HSFILES) #$(TESTFILES) *.md Makefile
	hasktags -e -o TAGS $^
	hasktags -c -o ctags $^

# clean:
# 	rm -f `find . -name "*.o" -o -name "*.hi" -o -name "*~" -o -name "darcs-amend-record*" -o -name "*-darcs-backup*"`

# Clean: clean
# 	rm -f TAGS _cache #_site $(EXE)