1
0
Fork 0
emacs-config/GNUmakefile

49 lines
1.2 KiB
Text
Raw Normal View History

FILES := $(wildcard oni-*.el)
DIRECTORIES := $(wildcard oni-*/)
2019-03-28 08:53:55 +01:00
PACKAGE_TARGETS := $(addprefix package-,$(FILES))
MULTIPACKAGE_TARGETS := $(addprefix multipackage-,$(subst /, ,$(DIRECTORIES)))
2019-03-28 08:53:55 +01:00
define upload =
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval "(package-upload-file $1)"
endef
define upload-multi-file =
$(call upload,(car (sort (file-expand-wildcards \"$1/dist/*.tar\") #'string>)))
cp $1/dist/$1-readme.txt bin/
endef
package: $(PACKAGE_TARGETS) $(MULTIPACKAGE_TARGETS)
2019-03-28 08:53:55 +01:00
package-%: %
$(call upload,\"$^\")
2019-03-28 08:53:55 +01:00
multipackage-%: %
$(call upload-multi-file,$^)
2020-03-03 02:59:42 +01:00
install-%:
2019-03-28 08:53:55 +01:00
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval "(add-to-list 'package-archives '(\"test\" . \"$(TEST_ARCHIVE)\"))" \
2019-03-28 08:53:55 +01:00
--eval '(package-refresh-contents)' \
--eval "(package-install '$*)"
unit-test-%: install-%
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--load ert \
--load "test/$*-test.el" \
--eval "(setq ert-batch-backtrace-right-margin nil)" \
2019-03-28 08:53:55 +01:00
--funcall ert-run-tests-batch-and-exit
integration-test-%: install-%
bats test/integration/$*.bats
2019-03-28 08:53:55 +01:00
clean:
rm -fv $(FILES)