-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (25 loc) · 827 Bytes
/
Makefile
File metadata and controls
35 lines (25 loc) · 827 Bytes
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
SOURCES=$(shell find * -mindepth 1 -name '*.hs' -type f)
HOTHASKTAGS=$(shell which hothasktags 2>/dev/null)
CTAGS=$(if $(HOTHASKTAGS),$(HOTHASKTAGS),/bin/false)
STYLISHHASKELL=$(shell which stylish-haskell 2>/dev/null)
STYLISH=$(if $(STYLISHHASKELL),$(STYLISHHASKELL),/bin/false)
all: format tags
.PHONY: all test clean
tags: $(SOURCES)
@if [ "$(HOTHASKTAGS)" ] ; then /bin/echo -e "CTAGS\ttags" ; fi
@$(CTAGS) $^ > tags $(REDIRECT)
# Note that the config file *MUST* be the first dependency!
format: .stylish-haskell.yaml $(SOURCES)
@if [ ! -z "$(STYLISH)" ] ; then /bin/echo -e "FORMAT" ; fi
@$(STYLISH) -c $< -i $(filter-out $<,$^)
clean:
@/bin/echo -e "CLEAN"
@cabal clean >/dev/null
@rm -f tags
lint: $(SOURCES)
for i in $^; do hlint $$i; done
test:
@/bin/echo -e "TEST"
cabal test
build:
cabal build