-
Notifications
You must be signed in to change notification settings - Fork 46
/
Makefile
76 lines (53 loc) · 1.56 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
EMACS = emacs
EMACSFLAGS =
CASK = cask
ERTSELECTOR = t
REQUEST_BACKEND= t
YCMDPATH=../ycmd/ycmd
CONVERT = convert
VERSION := $(shell EMACS=$(EMACS) $(CASK) version)
PKGDIR := $(shell EMACS=$(EMACS) $(CASK) package-directory)
# Export Emacs to goals, mainly for CASK
CASK_EMACS = $(EMACS)
export EMACS
export CASK_EMACS
SRCS = ycmd.el contrib/ycmd-next-error.el
OBJECTS = $(SRCS:.el=.elc)
SRCS_COMP = company-ycmd.el
OBJECTS_COMP = $(SRCS_COMP:.el=.elc)
SRCS_FLYC = flycheck-ycmd.el
OBJECTS_FLYC = $(SRCS_FLYC:.el=.elc)
SRCS_ELDOC = ycmd-eldoc.el
OBJECTS_ELDOC = $(SRCS_ELDOC:.el=.elc)
DISTDIR = dist
BUILDDIR = build
EMACSBATCH = $(CASK) exec $(EMACS) -Q --batch $(EMACSFLAGS)
.PHONY: deps all ycmd company-ycmd flycheck-ycmd ycmd-eldoc dist \
test clean clean-elc clobber clobber-dist clobber-deps
# Build targets
all : $(OBJECTS) $(OBJECTS_COMP) $(OBJECTS_FLYC) $(OBJECTS_ELDOC)
ycmd : $(OBJECTS)
company-ycmd : ycmd $(OBJECTS_COMP)
flycheck-ycmd : ycmd $(OBJECTS_FLYC)
ycmd-eldoc : ycmd $(OBJECTS_ELDOC)
dist :
$(CASK) package
# Test targets
test : $(OBJECTS) $(OBJECTS_COMP) $(OBJECTS_FLYC) $(OBJECTS_ELDOC)
$(EMACSBATCH) --script test/run.el '$(YCMDPATH)' '$(ERTSELECTOR)' '$(REQUEST_BACKEND)'
# Support targets
deps : $(PKGDIR)
# Cleanup targets
clean : clean-elc
clobber: clobber-dist clobber-deps
clean-elc :
rm -rf $(OBJECTS) $(OBJECTS_COMP) $(OBJECTS_FLYC) $(OBJECTS_ELDOC)
clobber-dist :
rm -rf $(DISTDIR)
clobber-deps :
rm -rf .cask/
$(PKGDIR) : Cask
$(CASK) install
touch $(PKGDIR)
%.elc : %.el $(PKGDIR)
$(EMACSBATCH) -L . -f batch-byte-compile $<