-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
72 lines (54 loc) · 1.32 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
EMACS = emacs
EMACSFLAGS =
GHC = ghc
GHCFLAGS = -Wall -Werror -O1
HLINT = hlint
HLINTFLAGS =
CASK = cask
PKGDIR := $(shell EMACS=$(EMACS) $(CASK) package-directory)
# Export the used EMACS to recipe environments
export EMACS
HS_BUILDDIR = build/hs
EL_SRCS = flycheck-haskell.el
EL_OBJS = $(EL_SRCS:.el=.elc)
HS_SRCS = get-cabal-configuration.hs
HS_OBJS = $(HS_SRCS:.hs=)
PACKAGE = flycheck-haskell-$(VERSION).tar
EMACSBATCH = $(EMACS) -Q --batch $(EMACSFLAGS)
.PHONY: compile dist \
lint test \
clean clean-elc clean-dist clean-deps \
deps \
check
# Build targets
compile : $(EL_OBJS) $(HS_OBJS)
dist :
$(CASK) package
# Test targets
lint :
$(HLINT) $(HLINTFLAGS) $(HS_SRCS)
test : $(EL_OBJS)
$(CASK) exec $(EMACSBATCH) -l flycheck-haskell.elc \
-l test/flycheck-haskell-test.el -f ert-run-tests-batch-and-exit
# Support targets
deps : $(PKGDIR)
# Cleanup targets
clean : clean-elc clean-hs clean-dist clean-deps
clean-elc :
rm -rf $(EL_OBJS)
clean-hs:
rm -rf $(HS_OBJS) $(HS_BUILDDIR)
clean-dist :
rm -rf dist/
clean-deps :
rm -rf $(PKGDIR)
# File targets
%.elc : %.el $(PKGDIR)
$(CASK) exec $(EMACSBATCH) -f batch-byte-compile $<
%: %.hs
$(GHC) $(GHCFLAGS) -outputdir $(HS_BUILDDIR) -o $@ $<
check: $(EL_OBJS)
$(GHC) $(GHCFLAGS) -fno-code get-cabal-configuration.hs
$(PKGDIR) : Cask
$(CASK) install
touch $(PKGDIR)