aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 0cd248c40bb212a216fa1e727e6b0644e2502001 (plain)
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
VERSION=1.0.0

DST=emmet-mode.el

# set markdown input format to "markdown-smart" for pandoc version 2 and to "markdown" for pandoc prior to version 2
MARKDOWN = $(shell if [ `pandoc -v | head -n1 | cut -d" " -f2 | head -c1` = "2" ]; then echo markdown-smart; else echo markdown; fi)

all: emmet-mode.el emmet-mode.elc

emmet-mode.el: src/snippets.el src/preferences.el src/*
	rm -f $(DST)
	touch $(DST)
	cat src/comments.el >> $(DST)
	cat src/init.el >> $(DST)
	cat src/mode-def.el >> $(DST)
	cat src/snippets.el >> $(DST)
	cat src/preferences.el >> $(DST)
	cat src/html-abbrev.el >> $(DST)
	cat src/lorem.el >> $(DST)
	cat src/css-abbrev.el >> $(DST)
	echo "" >> $(DST)
	echo ";;; emmet-mode.el ends here" >> $(DST)

emmet-mode.elc: emmet-mode.el
	emacs --batch --eval '(byte-compile-file "emmet-mode.el")'

src/snippets.el: conf/snippets.json
	tools/json2hash conf/snippets.json -o src/snippets.el --defvar 'emmet-snippets'

src/preferences.el: conf/preferences.json
	tools/json2hash conf/preferences.json -o src/preferences.el --defvar 'emmet-preferences'

clean:
	rm -f emmet-mode.elc emmet-mode.el README.txt src/snippets.el src/preferences.el emmet-mode-$(VERSION).tar.gz

test: emmet-mode.el
	emacs --quick --script src/test.el

README.txt: README.md
	pandoc -f $(MARKDOWN) -t plain README.md -o README.txt

docs: README.txt
	@echo generated docs

dist: docs
	@tar -czf emmet-mode-$(VERSION).tar.gz --transform "s|^|emmet-mode-$(VERSION)/|" --owner 0 --group 0 \
		--exclude '*.DS_Store' \
		--exclude '*.kate-swp' \
		--exclude '*.elcc' \
		--exclude '*~' \
		--exclude '.git' \
		-- \
		conf src tools LICENSE Makefile \
		README.md README.txt AUTHORS

.PHONY: all test docs clean