emacs-jupyter/Makefile

72 lines
1.4 KiB
Makefile
Raw Normal View History

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
.PHONY: cask
cask:
ifeq ($(CASK),)
$(error "Install cask (https://github.com/cask/cask)")
endif
# 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
dev: cask
$(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
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
@rm $(ELCFILES) 2>/dev/null || true
2018-11-15 14:20:26 -06:00
.PHONY: clean-cask
clean-cask:
@rm -rf .cask/ 2>/dev/null || true
2018-11-15 14:20:26 -06:00
.PHONY: widgets
widgets:
make -C js
.PHONY: compile
compile: zmq
2018-11-15 14:20:26 -06:00
$(CASK) build