Create the lowercase ecss repository as a pure selector and CSS cascade package with no TP, Ebox, or historical ECSS dependency.\n\nVerified with 47 ERT tests, warning-free byte compilation, checkdoc, and git diff checks.
50 lines
1.6 KiB
Makefile
50 lines
1.6 KiB
Makefile
# Makefile for the ecss library.
|
|
|
|
EMACS ?= emacs
|
|
LOADPATH = -L . -L tests
|
|
PACKAGE_LINT_LOAD_EXTRA ?=
|
|
SRC = ecss-selector.el ecss-cascade.el ecss.el
|
|
TESTS = $(wildcard tests/*-tests.el)
|
|
|
|
.PHONY: test compile compile-all checkdoc package-lint check clean diff-check
|
|
|
|
test: clean
|
|
$(EMACS) -Q --batch $(LOADPATH) -l ecss.el \
|
|
$(patsubst %,-l %,$(TESTS)) -f ert-run-tests-batch-and-exit
|
|
|
|
compile: clean
|
|
$(EMACS) -Q --batch $(LOADPATH) \
|
|
--eval '(setq byte-compile-error-on-warn t)' \
|
|
-f batch-byte-compile $(SRC)
|
|
|
|
compile-all: clean
|
|
$(EMACS) -Q --batch $(LOADPATH) \
|
|
--eval '(setq byte-compile-error-on-warn t)' \
|
|
-f batch-byte-compile $(SRC) $(TESTS)
|
|
|
|
checkdoc:
|
|
$(EMACS) -Q --batch $(LOADPATH) \
|
|
--eval '(progn (require (quote cl-lib)) (require (quote checkdoc)) \
|
|
(cl-letf (((symbol-function (quote display-warning)) \
|
|
(lambda (_type message &rest _args) (error "%s" message)))) \
|
|
(dolist (file (quote ("ecss-selector.el" "ecss-cascade.el" "ecss.el"))) \
|
|
(checkdoc-file file))))'
|
|
|
|
package-lint:
|
|
$(EMACS) -Q --batch $(LOADPATH) $(PACKAGE_LINT_LOAD_EXTRA) \
|
|
--eval '(progn (require (quote package-lint)) \
|
|
(setq package-lint-main-file "ecss.el") \
|
|
(dolist (file (quote ("ecss-selector.el" "ecss-cascade.el" "ecss.el"))) \
|
|
(with-current-buffer (find-file-noselect file) \
|
|
(let ((issues (package-lint-buffer))) \
|
|
(when issues (error "package-lint failed for %s: %S" file issues))))))'
|
|
|
|
diff-check:
|
|
git diff --check
|
|
|
|
check: compile-all test checkdoc diff-check
|
|
$(MAKE) clean
|
|
|
|
clean:
|
|
rm -f *.elc tests/*.elc
|