-
Notifications
You must be signed in to change notification settings - Fork 7
/
makefile
97 lines (73 loc) · 2.31 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
OPTIMIZATION=-O0
build:
nix-shell --run "make build_"
build_:
cabal new-build all -j --ghc-options $(OPTIMIZATION)
haddock:
nix-shell --run "cabal new-haddock all"
haddock-hackage: clean
cabal new-haddock all --haddock-for-hackage --haddock-option=--hyperlinked-source
echo "the hackage ui doesn't accept the default format, use command instead"
cabal upload -d --publish ./dist-newstyle/*-docs.tar.gz
hpack:
nix-shell ./nix/hpack-shell.nix --run "make update-cabal"
bundle:
rm -f result
nix-build nix/bundle.nix
mv result cut-the-crap
ghcid: clean hpack etags
nix-shell --run "make ghcid_"
ghcid_:
ghcid -s "import Main" -c "cabal new-repl" -T "main" test:unit
ghci:
nix-shell --run "cabal new-repl test:unit"
etags:
nix-shell --run "hasktags -e ./src"
update-cabal:
cat package.yaml.template | sed s,REPLACED_MODEL,"$(MODEL)",g > package.yaml
hpack --force ./
rm package.yaml
enter:
nix-shell --cores 0 -j 8 --pure
RUN=""
run-in-shell:
nix-shell --cores 0 -j 8 --run "$(RUN)"
WORK="/tmp/cut-the-crap"
clean-work-dir:
rm -fR $(WORK)
mkdir -p $(WORK)
runDebug: clean-work-dir
cabal new-run cut-the-crap --ghc-options $(OPTIMIZATION) -- \
./input.mkv \
--workDir $(WORK)
runMusic:
nix-shell --run "./run-music.sh ~/streams/"
run: hpack
nix-shell --run "make runDebug"
clean: clean-work-dir
rm -fR dist dist-*
.PHONY: test run_
sdist: hpack
nix-build nix/ci.nix
make bundle
make run-in-shell RUN="cabal sdist"
brittany_:
$(shell set -x; for i in `fd hs`; do hlint --refactor --refactor-options=-i $$i; brittany --write-mode=inplace $$i; done)
brittany:
nix-shell ./nix/travis-shell.nix --run "make brittany_"
# this doesn't really work well, we need to keep updating everything
# according to how ubuntu builds. It's too much work for me
ubuntu-release:
docker build -t ubuntu-release scripts
docker run -v ~/projects/cut-the-crap:/home/jappie -t ubuntu-release
# only works with this: https://github.com/nh2/static-haskell-nix
# in other words, it doesn't work without musl
static-linked-build:
nix-build --no-link
MODEL=$(shell nix-shell --run "pkg-config --variable=modeldir pocketsphinx")
sphinx:
gcc -o run-sphinx.bin main.c includes/speech_recognition.c \
-Iincludes \
-DMODELDIR="\"$(MODEL)\"" \
$(shell pkg-config --cflags --libs pocketsphinx sphinxbase)
.PHONY: sphinx