2018-11-15 14:20:26 -06:00
|
|
|
EMACS ?= emacs
|
2023-01-30 15:09:58 -06:00
|
|
|
SHELL ?= bash
|
2018-11-15 14:20:26 -06:00
|
|
|
CASK ?= $(shell command -v cask)
|
|
|
|
|
|
|
|
FILES = $(wildcard *.el)
|
|
|
|
ELCFILES = $(FILES:.el=.elc)
|
2023-01-30 15:09:58 -06:00
|
|
|
TESTFILES = $(foreach file,$(wildcard test/*.el),-l $(file))
|
|
|
|
TESTSELECTORS =
|
2018-11-15 14:20:26 -06:00
|
|
|
|
|
|
|
ifneq ($(TAGS),)
|
2023-01-30 15:09:58 -06:00
|
|
|
comma := ,
|
|
|
|
TESTSELECTORS := $(foreach tag,$(subst $(comma), ,$(TAGS)),(tag $(tag)))
|
2018-11-15 14:20:26 -06:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(PATTERN),)
|
2023-01-30 15:09:58 -06:00
|
|
|
TESTSELECTORS := $(TESTSELECTORS) \"$(PATTERN)\"
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(TESTSELECTORS),)
|
|
|
|
TESTSELECTORS := (quote (or $(TESTSELECTORS)))
|
2018-11-15 14:20:26 -06:00
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: compile
|
|
|
|
|
2019-02-12 20:23:08 -06:00
|
|
|
.PHONY: cask
|
|
|
|
cask:
|
|
|
|
ifeq ($(CASK),)
|
|
|
|
$(error "Install cask (https://github.com/cask/cask)")
|
|
|
|
endif
|
|
|
|
|
2021-02-06 15:09:26 -06:00
|
|
|
# Build the zmq module.
|
|
|
|
.PHONY: zmq
|
|
|
|
ifneq ($(APPVEYOR),)
|
|
|
|
# There are issues with string quoting in Appveyor which causes the normal
|
|
|
|
# evaluated command to give a parsing error so we just make this a no-op in
|
|
|
|
# Appveyor. The pre-built binaries are used when building in Appveyor anyways.
|
|
|
|
zmq:
|
|
|
|
else
|
|
|
|
zmq: cask
|
|
|
|
$(CASK) emacs -Q -batch --eval "(progn (fset 'read-string (lambda (&rest _) \"y\")) (require 'zmq))"
|
|
|
|
endif
|
|
|
|
|
2018-11-15 14:20:26 -06:00
|
|
|
.PHONY: dev
|
2019-02-12 20:23:08 -06:00
|
|
|
dev: cask
|
2021-11-27 18:41:11 +01:00
|
|
|
$(CASK) install
|
|
|
|
$(CASK) update
|
2018-11-15 14:20:26 -06:00
|
|
|
|
2023-01-30 15:09:58 -06:00
|
|
|
test: export EMACSLOADPATH = $(shell $(CASK) load-path)
|
|
|
|
|
2018-11-15 14:20:26 -06:00
|
|
|
.PHONY: test
|
2021-02-06 15:09:26 -06:00
|
|
|
test: zmq
|
2023-01-30 15:09:58 -06:00
|
|
|
$(EMACS) -nw -Q -batch -l ert $(TESTFILES) \
|
|
|
|
--eval "(ert-run-tests-batch-and-exit $(TESTSELECTORS))"
|
2018-11-15 14:20:26 -06:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
make -C js clean
|
2019-02-06 20:26:52 +00:00
|
|
|
@rm $(ELCFILES) 2>/dev/null || true
|
2018-11-15 14:20:26 -06:00
|
|
|
|
|
|
|
.PHONY: clean-cask
|
|
|
|
clean-cask:
|
2019-02-06 20:26:52 +00:00
|
|
|
@rm -rf .cask/ 2>/dev/null || true
|
2018-11-15 14:20:26 -06:00
|
|
|
|
|
|
|
.PHONY: widgets
|
|
|
|
widgets:
|
|
|
|
make -C js
|
|
|
|
|
|
|
|
.PHONY: compile
|
2021-02-06 15:09:26 -06:00
|
|
|
compile: zmq
|
2018-11-15 14:20:26 -06:00
|
|
|
$(CASK) build
|