diff --git a/GNUmakefile b/GNUmakefile index 4ff3121..342a533 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -2,92 +2,57 @@ 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-%: % - emacs --batch \ - --load oni-package.el \ - --funcall package-initialize \ - --eval '(package-upload-file "$^")' + $(call upload,\"$^\") package-oni-conf: - emacs --batch \ - --load oni-package.el \ - --funcall package-initialize \ - --eval "(package-upload-file (car (sort (file-expand-wildcards \"oni-conf/dist/*.tar\") #'string>)))" - cp oni-conf/dist/oni-conf-readme.txt bin/ + $(call upload-multi-file,oni-conf) package-oni-css: - emacs --batch \ - --load oni-package.el \ - --funcall package-initialize \ - --eval "(package-upload-file (car (sort (file-expand-wildcards \"oni-css/dist/*.tar\") #'string>)))" - cp oni-css/dist/oni-css-readme.txt bin/ + $(call upload-multi-file,oni-css) package-oni-elisp: - emacs --batch \ - --load oni-package.el \ - --funcall package-initialize \ - --eval "(package-upload-file (car (sort (file-expand-wildcards \"oni-elisp/dist/*tar\") #'string>)))" - cp oni-elisp/dist/oni-elisp-readme.txt bin/ + $(call upload-multi-file,oni-elisp) package-oni-haml: - emacs --batch \ - --load oni-package.el \ - --funcall package-initialize \ - --eval "(package-upload-file (car (sort (file-expand-wildcards \"oni-haml/dist/*.tar\") #'string>)))" - cp oni-haml/dist/oni-haml-readme.txt bin/ + $(call upload-multi-file,oni-haml) package-oni-html: - emacs --batch \ - --load oni-package.el \ - --funcall package-initialize \ - --eval "(package-upload-file (car (sort (file-expand-wildcards \"oni-html/dist/*.tar\") #'string>)))" - cp oni-html/dist/oni-html-readme.txt bin/ + $(call upload-multi-file,oni-html) package-oni-nxml: - emacs --batch \ - --load oni-package.el \ - --funcall package-initialize \ - --eval "(package-upload-file (car (sort (file-expand-wildcards \"oni-nxml/dist/*.tar\") #'string>)))" - cp oni-nxml/dist/oni-nxml-readme.txt bin/ + $(call upload-multi-file,oni-nxml) package-oni-org: - emacs --batch \ - --load oni-package.el \ - --funcall package-initialize \ - --eval "(package-upload-file (car (sort (file-expand-wildcards \"oni-org/dist/*.tar\") #'string>)))" - cp oni-org/dist/oni-org-readme.txt bin/ + $(call upload-multi-file,oni-org) package-oni-php: - emacs --batch \ - --load oni-package.el \ - --funcall package-initialize \ - --eval "(package-upload-file (car (sort (file-expand-wildcards \"oni-php/dist/*.tar\") #'string>)))" - cp oni-php/dist/oni-php-readme.txt bin/ + $(call upload-multi-file,oni-php) package-oni-python: - emacs --batch \ - --load oni-package.el \ - --funcall package-initialize \ - --eval "(package-upload-file (car (sort (file-expand-wildcards \"oni-python/dist/*.tar\") #'string>)))" - cp oni-python/dist/oni-python-readme.txt bin/ + $(call upload-multi-file,oni-python) package-oni-ruby: - emacs --batch \ - --load oni-package.el \ - --funcall package-initialize \ - --eval "(package-upload-file (car (sort (file-expand-wildcards \"oni-ruby/dist/*.tar\") #'string>)))" - cp oni-ruby/dist/oni-ruby-readme.txt bin/ + $(call upload-multi-file,oni-ruby) package-oni-twig: - emacs --batch \ - --load oni-package.el \ - --funcall package-initialize \ - --eval "(package-upload-file (car (sort (file-expand-wildcards \"oni-twig/dist/*.tar\") #'string>)))" - cp oni-twig/dist/oni-twig-readme.txt bin/ + $(call upload-multi-file,oni-twig) install-%: emacs --batch \