1
0
Fork 0
emacs-config/GNUmakefile

170 lines
5.5 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 '(package-refresh-contents)' \
$(foreach DEP,$(DEPS),--eval "(package-install-file \"$(DEP).el\")") \
--eval "(package-install-file \"$*.el\")"
install-oni-conf:
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval '(package-refresh-contents)' \
$(foreach DEP,$(DEPS),--eval "(package-install-file \"$(DEP).el\")") \
--eval "(package-install-file (car (sort (file-expand-wildcards \"oni-conf/dist/*.tar\") #'string>)))"
install-oni-css:
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval '(package-refresh-contents)' \
$(foreach DEP,$(DEPS),--eval "(package-install-file \"$(DEP).el\")") \
--eval "(package-install-file (car (sort (file-expand-wildcards \"oni-css/dist/*.tar\") #'string>)))"
install-oni-elisp:
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval '(package-refresh-contents)' \
$(foreach DEP,$(DEPS),--eval "(package-install-file \"$(DEP).el\")") \
--eval "(package-install-file (car (sort (file-expand-wildcards \"oni-elisp/dist/*.tar\") #'string>)))"
install-oni-haml:
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval '(package-refresh-contents)' \
$(foreach DEP,$(DEPS),--eval "(package-install-file \"$(DEP).el\")") \
--eval "(package-install-file (car (sort (file-expand-wildcards \"oni-haml/dist/*.tar\") #'string>)))"
install-oni-html:
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval '(package-refresh-contents)' \
$(foreach DEP,$(DEPS),--eval "(package-install-file \"$(DEP).el\")") \
--eval "(package-install-file (car (sort (file-expand-wildcards \"oni-html/dist/*.tar\") #'string>)))"
install-oni-nxml:
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval '(package-refresh-contents)' \
$(foreach DEP,$(DEPS),--eval "(package-install-file \"$(DEP).el\")") \
--eval "(package-install-file (car (sort (file-expand-wildcards \"oni-nxml/dist/*.tar\") #'string>)))"
install-oni-org:
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval '(package-refresh-contents)' \
$(foreach DEP,$(DEPS),--eval "(package-install-file \"$(DEP).el\")") \
--eval "(package-install-file (car (sort (file-expand-wildcards \"oni-org/dist/*.tar\") #'string>)))"
install-oni-php:
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval '(package-refresh-contents)' \
$(foreach DEP,$(DEPS),--eval "(package-install-file \"$(DEP).el\")") \
--eval "(package-install-file (car (sort (file-expand-wildcards \"oni-php/dist/*.tar\") #'string>)))"
install-oni-python:
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval '(package-refresh-contents)' \
$(foreach DEP,$(DEPS),--eval "(package-install-file \"$(DEP).el\")") \
--eval "(package-install-file (car (sort (file-expand-wildcards \"oni-python/dist/*.tar\") #'string>)))"
install-oni-ruby:
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval '(package-refresh-contents)' \
$(foreach DEP,$(DEPS),--eval "(package-install-file \"$(DEP).el\")") \
--eval "(package-install-file (car (sort (file-expand-wildcards \"oni-ruby/dist/*.tar\") #'string>)))"
install-oni-twig:
emacs --batch \
--load oni-package.el \
--funcall package-initialize \
--eval '(package-refresh-contents)' \
$(foreach DEP,$(DEPS),--eval "(package-install-file \"$(DEP).el\")") \
--eval "(package-install-file (car (sort (file-expand-wildcards \"oni-twig/dist/*.tar\") #'string>)))"
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
test-oni-bookmark: DEPS := oni-data-dir
test-oni-conf: DEPS := oni-yasnippet
test-oni-css: DEPS := oni-company oni-fci
test-oni-php: DEPS := oni-flycheck oni-company oni-fci
test-oni-elisp: DEPS := oni-company oni-flycheck oni-paredit oni-fci \
oni-yasnippet
clean:
rm -fv $(FILES)