-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
58 lines (47 loc) · 1.41 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
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, Zech XU
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# ----------------------------------------------------------------------------
.DEFAULT_GOAL := test
VERSION:=1.0
PACKAGE_NAME:=seqel-$(VERSION)
PACKAGE_DIR:=/tmp/$(PACKAGE_NAME)
PACKAGE:=/tmp/$(PACKAGE_NAME).tar
# Allow EMACS to be set via environment variable, default to an empty string
EMACS ?=
# If EMACS is not set, determine the default based on the OS
ifeq ($(EMACS),)
ifeq ($(OS),Windows_NT)
EMACS = emacs
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
EMACS = emacs
endif
ifeq ($(UNAME_S),Darwin)
EMACS = /Applications/Emacs.app/Contents/MacOS/Emacs
endif
endif
endif
package: $(PACKAGE_DIR)
tar cvf $(PACKAGE) -C $(PACKAGE_DIR)/.. $(PACKAGE_NAME)
$(PACKAGE_DIR):
mkdir $@
cp -r *.el $@
clean:
rm -f $(PACKAGE)
rm -rf $(PACKAGE_DIR)
rm -f *.elc
# learned from https://github.com/xuchunyang/pinyin.el
.PHONY: test
test:
@printf "\n------- Checking Emacs Version...\n"
@$(EMACS) --version | head -1
@printf "\n------- Byte-Compiling elisp files...\n"
${EMACS} -Q --batch -L . -f batch-byte-compile *.el
@printf "\n------- Testing...\n"
${EMACS} -Q --batch -L . -L test -l ert -l all-tests.el -f ert-run-tests-batch-and-exit
# end