-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
78 lines (58 loc) · 1.71 KB
/
Makefile
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
# (c) Copyright Levent Erkok. All rights reserved.
#
# The crackNum library/binary is distributed with the BSD3 license. See the LICENSE file
# in the distribution for details.
SHELL := /usr/bin/env bash
TSTSRCS = $(shell find . -name '*.hs' -or -name '*.lhs' | grep -v Setup.hs | grep -v Paths_crackNum.hs)
DEPSRCS = $(shell find . -name '*.hs' -or -name '*.lhs' -or -name '*.cabal' | grep -v Paths_crackNum.hs)
CABAL = cabal
TIME = /usr/bin/time
OS := $(shell uname)
ifeq ($(OS), Darwin)
# OSX tends to sleep for long jobs; so run through caffeinate
NO_OF_CORES = `sysctl hw.ncpu | awk '{print $$2}'`
else
NO_OF_CORES = `grep -c "^processor" /proc/cpuinfo`
endif
ifdef TGT
TESTTARGET =-p ${TGT}
TESTHIDE =
else
TESTTARGET =
TESTHIDE = --hide-successes
endif
ifdef ACCEPT
TESTACCEPT=--accept
TESTHIDE =
else
TESTACCEPT=--no-create
endif
define mkTags
@find . -name \*.\*hs | xargs fast-tags
endef
.PHONY: all ghcid install sdist clean docs hlint tags
all: install
ghci:
cabal new-repl --repl-options=-Wno-unused-packages
ghcid:
ghcid --command="cabal new-repl --repl-options=-Wno-unused-packages"
install:
cabal new-install --overwrite-policy=always
release: clean
sdist: install
cabal new-sdist
clean:
@rm -rf dist-newstyle
release: clean install sdist hlint test checkLinks
@echo "*** crackNum is ready for release!"
hlint: install
@echo "Running HLint.."
@hlint src -i "Use otherwise" --cpp-simple
test:
@crackNum --runTests -- -j $(NO_OF_CORES) ${TESTTARGET} ${TESTACCEPT} ${TESTHIDE}
checkLinks:
@brok --no-cache --only-failures $(DOCTESTSOURCES) COPYRIGHT LICENSE $(wildcard *.md)
ci:
haskell-ci github crackNum.cabal --no-tests --no-benchmarks
tags:
$(call mkTags)