1
0
Fork 0
emacs-config/GNUmakefile
Tom Willemse e62e994630 Switch the Test and Package stages
In order to simplify the testing of each package, do the packaging step first so
that when it gets to the testing stage it can load the packaged files from the
local repository and manage the interdependencies that way.
2019-12-11 21:55:20 -08:00

75 lines
1.7 KiB
Makefile

FILES := $(wildcard *.el)
PACKAGE_TARGETS := $(addprefix package-,$(FILES))
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) package-oni-conf package-oni-css package-oni-elisp \
package-oni-haml package-oni-html package-oni-nxml package-oni-org \
package-oni-php package-oni-python package-oni-ruby package-oni-twig
package-%: %
$(call upload,\"$^\")
package-oni-conf:
$(call upload-multi-file,oni-conf)
package-oni-css:
$(call upload-multi-file,oni-css)
package-oni-elisp:
$(call upload-multi-file,oni-elisp)
package-oni-haml:
$(call upload-multi-file,oni-haml)
package-oni-html:
$(call upload-multi-file,oni-html)
package-oni-nxml:
$(call upload-multi-file,oni-nxml)
package-oni-org:
$(call upload-multi-file,oni-org)
package-oni-php:
$(call upload-multi-file,oni-php)
package-oni-python:
$(call upload-multi-file,oni-python)
package-oni-ruby:
$(call upload-multi-file,oni-ruby)
package-oni-twig:
$(call upload-multi-file,oni-twig)
install-%:
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval "(add-to-list 'package-archives '(\"test\" . \"$(TEST_ARCHIVE)\"))" \
--eval '(package-refresh-contents)' \
--eval "(package-install '$*)"
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)" \
--funcall ert-run-tests-batch-and-exit
clean:
rm -fv $(FILES)