1
0
Fork 0
emacs-config/GNUmakefile
Tom Willemse b26c3c8899 Isolate building packages some more
Don't load the user init file while building my Emacs packages, make sure to use
a different ‘package-user-dir’ so that bad packages don't interfere and it
doesn't accidentally work because of existing packages. Specify the
‘package-archive-upload-base’ in the Makefile so that there is only one place to
look and modify if this needs to move. Ensure that the
‘package-archive-upload-base’ exists before uploading to it.
2023-04-26 23:08:21 -07:00

88 lines
2.1 KiB
Makefile

FILES := $(wildcard oni-*.el)
PACKAGE_TARGETS := $(addprefix package-,$(FILES))
define upload =
emacs --quick --batch \
--eval "(setq package-user-dir \"local-elpa/\")" \
--load oni-package.el \
--funcall package-initialize \
--eval "(let ((package-archive-upload-base \"bin/\")) \
(mkdir package-archive-upload-base t) \
(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-oni-csharp package-oni-bats
package-%: %
$(call upload,\"$^\")
package-oni-bats:
$(call upload-multi-file,oni-bats)
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)
package-oni-csharp:
$(call upload-multi-file,oni-csharp)
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 '$*)"
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)" \
--funcall ert-run-tests-batch-and-exit
integration-test-%: install-%
bats test/integration/$*.bats
clean:
rm -fv $(FILES)