cleanup in lisp/Makefile, targets; create org-fixup.el, remove version definition
* UTILITIES/org-fixup.el: new file, has functions to create
org-version.el and org-install.el, now use by the build system.
* lisp/Makefile: delete said definitions, now sourced from toplevel
make. "clean" and "cleanall" should do the same thing here, make
them aliases, ditto for "all" and "compile". Both autoload files
must be .PHONY and depend only on each other for correct ordering.
Make "compile-dirty" actually do that again (i.e. no implied
"clean", but "cleanauto"). Remove autoload files directly after
install, so that they will only be present when explicitly requested
by "autoloads". Create "org-version.el" before compilation as it is
mandatory. Remove $(ORG_MAKE_INSTALL) and $(ORG_MAKE_VERSION),
source from default.mk/local.mk.
* default.mk: move definitions for $(ORG_MAKE_INSTALL) and
$(ORG_MAKE_VERSION) here so that they can be more easily configured.
Remove definition of "org-release" from $(BATCH) and $(BTEST), now
sourced from "org-version.el".
* targets.mk: target reorganization, introduce "stop" targets to
prevent cleaning of org-version.el. Use new targets for "oldorg" to
make it more robust in case of errors. New target "cleanutils" to
remove any "*.elc" files that may have been produced there and add
this target to "cleanall". Do the same in cleancontrib.
2012-04-28 13:24:39 -04:00
|
|
|
|
;;; org-fixup.el - to make life easier for folks without GNU make
|
|
|
|
|
;;
|
|
|
|
|
;; Author: Achim Gratz
|
|
|
|
|
;; Keywords: outlines, hypermedia, calendar, wp
|
|
|
|
|
;; Homepage: http://orgmode.org
|
|
|
|
|
;;
|
|
|
|
|
;; This file is not yet part of GNU Emacs.
|
|
|
|
|
;;
|
|
|
|
|
;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation; either version 3, or (at your option)
|
|
|
|
|
;; any later version.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;; along with GNU Emacs; see the file COPYING. If not, write to the
|
|
|
|
|
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
|
;; Boston, MA 02110-1301, USA.
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;;
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
(require 'org-compat)
|
|
|
|
|
(require 'autoload)
|
|
|
|
|
|
|
|
|
|
(defun org-make-org-version (org-release org-git-version odt-dir)
|
|
|
|
|
(find-file "org-version.el")
|
|
|
|
|
(erase-buffer)
|
2012-05-07 15:21:28 -04:00
|
|
|
|
(insert "\
|
|
|
|
|
;;; org-version.el --- autogenerated file, do not edit
|
|
|
|
|
;;
|
|
|
|
|
;;; Code:
|
|
|
|
|
;;;\#\#\#autoload
|
|
|
|
|
\(defun org-release ()
|
|
|
|
|
\"The release version of org-mode.
|
|
|
|
|
Inserted by installing org-mode or when a release is made.\"
|
|
|
|
|
(let ((org-release \"" org-release "\"))
|
|
|
|
|
org-release))
|
|
|
|
|
;;;\#\#\#autoload
|
|
|
|
|
\(defun org-git-version ()
|
|
|
|
|
\"The Git version of org-mode.
|
|
|
|
|
Inserted by installing org-mode or when a release is made.\"
|
|
|
|
|
(let ((org-git-version \"" org-git-version "\"))
|
|
|
|
|
org-git-version))
|
|
|
|
|
;;;\#\#\#autoload
|
|
|
|
|
\(defconst org-odt-data-dir \"" odt-dir "\"
|
|
|
|
|
\"The location of ODT styles.\")
|
|
|
|
|
\f\n;; Local Variables:\n;; version-control: never
|
|
|
|
|
;; no-byte-compile: t
|
|
|
|
|
;; coding: utf-8\n;; End:\n;;; org-version.el ends here\n")
|
cleanup in lisp/Makefile, targets; create org-fixup.el, remove version definition
* UTILITIES/org-fixup.el: new file, has functions to create
org-version.el and org-install.el, now use by the build system.
* lisp/Makefile: delete said definitions, now sourced from toplevel
make. "clean" and "cleanall" should do the same thing here, make
them aliases, ditto for "all" and "compile". Both autoload files
must be .PHONY and depend only on each other for correct ordering.
Make "compile-dirty" actually do that again (i.e. no implied
"clean", but "cleanauto"). Remove autoload files directly after
install, so that they will only be present when explicitly requested
by "autoloads". Create "org-version.el" before compilation as it is
mandatory. Remove $(ORG_MAKE_INSTALL) and $(ORG_MAKE_VERSION),
source from default.mk/local.mk.
* default.mk: move definitions for $(ORG_MAKE_INSTALL) and
$(ORG_MAKE_VERSION) here so that they can be more easily configured.
Remove definition of "org-release" from $(BATCH) and $(BTEST), now
sourced from "org-version.el".
* targets.mk: target reorganization, introduce "stop" targets to
prevent cleaning of org-version.el. Use new targets for "oldorg" to
make it more robust in case of errors. New target "cleanutils" to
remove any "*.elc" files that may have been produced there and add
this target to "cleanall". Do the same in cleancontrib.
2012-04-28 13:24:39 -04:00
|
|
|
|
(save-buffer))
|
|
|
|
|
|
|
|
|
|
(defun org-make-org-install (absfile)
|
|
|
|
|
(find-file absfile)
|
|
|
|
|
(erase-buffer)
|
|
|
|
|
(insert ";;; org-install.el --- autogenerated file, do not edit\n;;\n;;; Code:\n")
|
|
|
|
|
(let ((files (directory-files (file-name-directory absfile) 'full "^[^.#~]*\\.el$")))
|
|
|
|
|
(mapc (lambda (f) (generate-file-autoloads f)) files))
|
|
|
|
|
(insert "\f\n(provide 'org-install)\n")
|
|
|
|
|
(insert "\f\n;; Local Variables:\n;; version-control: never\n")
|
|
|
|
|
(insert ";; no-byte-compile: t\n;; no-update-autoloads: t\n")
|
|
|
|
|
(insert ";; coding: utf-8\n;; End:\n;;; org-install.el ends here\n")
|
|
|
|
|
(save-buffer))
|
|
|
|
|
|
2012-05-07 15:21:28 -04:00
|
|
|
|
(defmacro org-fixup ()
|
|
|
|
|
(let* ((origin default-directory)
|
2012-05-07 16:37:31 -04:00
|
|
|
|
(dirlisp (org-find-library-dir "org"))
|
2012-05-07 15:21:28 -04:00
|
|
|
|
(dirorg (concat dirlisp "../" ))
|
|
|
|
|
(dirgit (concat dirorg ".git/" ))
|
|
|
|
|
(org-version "N/A-fixup")
|
|
|
|
|
(org-git-version "N/A-fixup !!check installation!!"))
|
2012-05-07 16:37:31 -04:00
|
|
|
|
(if (load (concat dirlisp "org-version.el") 'noerror 'nomessage 'nosuffix)
|
2012-05-07 15:21:28 -04:00
|
|
|
|
(setq org-version (org-release)
|
|
|
|
|
org-git-version (org-git-version))
|
|
|
|
|
(when (and (file-exists-p dirgit)
|
|
|
|
|
(executable-find "git"))
|
|
|
|
|
(unwind-protect
|
|
|
|
|
(progn
|
|
|
|
|
(cd dirorg)
|
2012-05-07 16:37:31 -04:00
|
|
|
|
(setq org-git-version
|
|
|
|
|
(concat (substring
|
|
|
|
|
(shell-command-to-string "git describe --abbrev=6 HEAD")
|
|
|
|
|
0 -1)
|
|
|
|
|
(when (string-match "\\S-"
|
|
|
|
|
(shell-command-to-string
|
|
|
|
|
"git status -uno --porcelain"))
|
|
|
|
|
".dirty")))
|
|
|
|
|
(setq org-version
|
|
|
|
|
(substring
|
|
|
|
|
(shell-command-to-string "git describe --abbrev=0 HEAD")
|
|
|
|
|
0 -1))))
|
|
|
|
|
(cd origin)))
|
2012-05-07 15:21:28 -04:00
|
|
|
|
`(progn
|
|
|
|
|
(defun org-release () ,org-version)
|
|
|
|
|
(defun org-git-version () ,org-git-version)
|
2012-05-07 16:37:31 -04:00
|
|
|
|
"org-fixup.el: redefined org version.")))
|
cleanup in lisp/Makefile, targets; create org-fixup.el, remove version definition
* UTILITIES/org-fixup.el: new file, has functions to create
org-version.el and org-install.el, now use by the build system.
* lisp/Makefile: delete said definitions, now sourced from toplevel
make. "clean" and "cleanall" should do the same thing here, make
them aliases, ditto for "all" and "compile". Both autoload files
must be .PHONY and depend only on each other for correct ordering.
Make "compile-dirty" actually do that again (i.e. no implied
"clean", but "cleanauto"). Remove autoload files directly after
install, so that they will only be present when explicitly requested
by "autoloads". Create "org-version.el" before compilation as it is
mandatory. Remove $(ORG_MAKE_INSTALL) and $(ORG_MAKE_VERSION),
source from default.mk/local.mk.
* default.mk: move definitions for $(ORG_MAKE_INSTALL) and
$(ORG_MAKE_VERSION) here so that they can be more easily configured.
Remove definition of "org-release" from $(BATCH) and $(BTEST), now
sourced from "org-version.el".
* targets.mk: target reorganization, introduce "stop" targets to
prevent cleaning of org-version.el. Use new targets for "oldorg" to
make it more robust in case of errors. New target "cleanutils" to
remove any "*.elc" files that may have been produced there and add
this target to "cleanall". Do the same in cleancontrib.
2012-04-28 13:24:39 -04:00
|
|
|
|
|
|
|
|
|
(provide 'org-fixup)
|
|
|
|
|
|
|
|
|
|
;; Local Variables:
|
|
|
|
|
;; no-byte-compile: t
|
|
|
|
|
;; coding: utf-8
|
|
|
|
|
;; End:
|
|
|
|
|
;;; org-fixup.el ends here
|