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 17:24:39 +00:00
|
|
|
.EXPORT_ALL_VARIABLES:
|
2011-07-12 20:31:41 +00:00
|
|
|
.NOTPARALLEL: .PHONY
|
2011-07-12 17:45:59 +00:00
|
|
|
# Additional distribution files
|
2021-09-29 08:08:20 +00:00
|
|
|
DISTFILES_extra= Makefile request-assign-future.txt etc
|
2011-07-12 17:45:59 +00:00
|
|
|
|
2012-01-02 20:24:36 +00:00
|
|
|
LISPDIRS = lisp
|
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 17:24:39 +00:00
|
|
|
OTHERDIRS = doc etc
|
2021-05-30 11:18:52 +00:00
|
|
|
CLEANDIRS = testing mk
|
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 17:24:39 +00:00
|
|
|
SUBDIRS = $(OTHERDIRS) $(LISPDIRS)
|
2012-01-02 20:24:36 +00:00
|
|
|
INSTSUB = $(SUBDIRS:%=install-%)
|
2012-04-22 06:22:31 +00:00
|
|
|
ORG_MAKE_DOC ?= info html pdf
|
2012-01-02 20:24:36 +00:00
|
|
|
|
|
|
|
ifneq ($(wildcard .git),)
|
2014-07-02 18:32:24 +00:00
|
|
|
ORGVERSION ?= $(subst release_,,$(shell git describe --match release\* --abbrev=0 HEAD))
|
2021-02-05 06:20:09 +00:00
|
|
|
ifeq ($(ORGVERSION),)
|
|
|
|
# In elpa.git, there are no tags available. Fall back to using
|
|
|
|
# the org.el header.
|
2021-09-23 21:13:34 +00:00
|
|
|
ORGVERSION := $(patsubst %-dev,%,$(shell $(BATCH) --eval "(require 'lisp-mnt)" \
|
|
|
|
--visit lisp/org.el --eval '(princ (lm-header "version"))'))
|
2021-02-05 06:20:09 +00:00
|
|
|
GITVERSION ?= $(ORGVERSION)-g$(shell git rev-parse --short=6 HEAD)
|
|
|
|
else
|
|
|
|
GITVERSION ?= $(shell git describe --match release\* --abbrev=6 HEAD)
|
|
|
|
endif
|
2012-01-02 20:24:36 +00:00
|
|
|
GITSTATUS ?= $(shell git status -uno --porcelain)
|
|
|
|
else
|
2012-08-26 12:03:20 +00:00
|
|
|
-include mk/version.mk
|
2012-01-02 20:24:36 +00:00
|
|
|
GITVERSION ?= N/A
|
|
|
|
ORGVERSION ?= N/A
|
|
|
|
endif
|
|
|
|
DATE = $(shell date +%Y-%m-%d)
|
2017-06-23 18:54:02 +00:00
|
|
|
YEAR = $(shell date +%Y)
|
2012-01-02 20:24:36 +00:00
|
|
|
ifneq ($(GITSTATUS),)
|
2012-05-17 08:40:54 +00:00
|
|
|
GITVERSION := $(GITVERSION:.dirty=).dirty
|
2011-11-06 16:53:45 +00:00
|
|
|
endif
|
|
|
|
|
2012-08-19 10:21:33 +00:00
|
|
|
.PHONY: all oldorg update update2 up0 up1 up2 single $(SUBDIRS) \
|
|
|
|
check test install $(INSTSUB) \
|
|
|
|
info html pdf card refcard doc docs \
|
2012-08-19 16:54:15 +00:00
|
|
|
autoloads cleanall clean $(CLEANDIRS:%=clean%) \
|
2021-09-29 08:08:20 +00:00
|
|
|
clean-install cleanelc cleandirs \
|
2012-07-15 16:21:42 +00:00
|
|
|
cleanlisp cleandoc cleandocs cleantest \
|
2012-08-19 10:20:47 +00:00
|
|
|
compile compile-dirty uncompiled \
|
2013-12-13 16:34:35 +00:00
|
|
|
config config-test config-exe config-all config-eol config-version \
|
|
|
|
vanilla
|
2012-06-02 11:32:53 +00:00
|
|
|
|
2012-08-27 17:14:39 +00:00
|
|
|
CONF_BASE = EMACS DESTDIR ORGCM ORG_MAKE_DOC
|
2012-07-17 17:54:51 +00:00
|
|
|
CONF_DEST = lispdir infodir datadir testdir
|
2013-11-23 16:46:35 +00:00
|
|
|
CONF_TEST = BTEST_PRE BTEST_POST BTEST_OB_LANGUAGES BTEST_EXTRA BTEST_RE
|
2016-02-14 11:44:56 +00:00
|
|
|
CONF_EXEC = CP MKDIR RM RMR FIND CHMOD SUDO PDFTEX TEXI2PDF TEXI2HTML MAKEINFO INSTALL_INFO
|
2013-12-14 09:17:53 +00:00
|
|
|
CONF_CALL = BATCH BATCHL ELC ELCDIR NOBATCH BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION
|
2012-06-02 11:32:53 +00:00
|
|
|
config-eol:: EOL = \#
|
|
|
|
config-eol:: config-all
|
|
|
|
config config-all::
|
|
|
|
$(info )
|
|
|
|
$(info ========= Emacs executable and Installation paths)
|
|
|
|
$(foreach var,$(CONF_BASE),$(info $(var) = $($(var))$(EOL)))
|
2012-07-17 17:54:51 +00:00
|
|
|
$(foreach var,$(CONF_DEST),$(info $(var) = $(DESTDIR)$($(var))$(EOL)))
|
2012-06-02 11:32:53 +00:00
|
|
|
config-test config-all::
|
|
|
|
$(info )
|
|
|
|
$(info ========= Test configuration)
|
|
|
|
$(foreach var,$(CONF_TEST),$(info $(var) = $($(var))$(EOL)))
|
|
|
|
config-exe config-all::
|
|
|
|
$(info )
|
|
|
|
$(info ========= Executables used by make)
|
|
|
|
$(foreach var,$(CONF_EXEC),$(info $(var) = $($(var))$(EOL)))
|
|
|
|
config-cmd config-all::
|
|
|
|
$(info )
|
|
|
|
$(info ========= Commands used by make)
|
|
|
|
$(foreach var,$(CONF_CALL),$(info $(var) = $($(var))$(EOL)))
|
2012-09-29 08:47:40 +00:00
|
|
|
config config-test config-exe config-all config-version::
|
|
|
|
$(info ========= Org version)
|
2017-12-31 14:48:09 +00:00
|
|
|
$(info make: Org mode version $(ORGVERSION) ($(GITVERSION) => $(lispdir)))
|
2012-08-19 16:54:15 +00:00
|
|
|
@echo ""
|
2012-04-23 19:20:58 +00:00
|
|
|
|
2012-04-30 04:49:23 +00:00
|
|
|
oldorg: compile info # what the old makefile did when no target was specified
|
2012-04-25 17:04:29 +00:00
|
|
|
uncompiled: cleanlisp autoloads # for developing
|
2012-04-23 19:20:58 +00:00
|
|
|
refcard: card
|
|
|
|
update update2:: up0 all
|
|
|
|
|
2012-08-19 10:21:33 +00:00
|
|
|
single: ORGCM=single
|
|
|
|
single: compile
|
|
|
|
|
2012-04-23 19:20:58 +00:00
|
|
|
.PRECIOUS: local.mk
|
|
|
|
local.mk:
|
2012-04-25 17:04:29 +00:00
|
|
|
$(info ======================================================)
|
|
|
|
$(info = Invoke "make help" for a synopsis of make targets. =)
|
|
|
|
$(info = Created a default local.mk template. =)
|
|
|
|
$(info = Setting "oldorg" as the default target. =)
|
|
|
|
$(info = Please adapt local.mk to your local setup! =)
|
|
|
|
$(info ======================================================)
|
2012-05-26 20:32:21 +00:00
|
|
|
-@$(MAKE_LOCAL_MK)
|
2012-04-21 15:25:35 +00:00
|
|
|
|
2012-05-18 15:43:46 +00:00
|
|
|
all compile::
|
|
|
|
$(foreach dir, doc lisp, $(MAKE) -C $(dir) clean;)
|
2012-08-19 10:20:47 +00:00
|
|
|
compile compile-dirty::
|
2012-05-18 15:43:46 +00:00
|
|
|
$(MAKE) -C lisp $@
|
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 17:24:39 +00:00
|
|
|
all clean-install::
|
2012-04-22 06:05:51 +00:00
|
|
|
$(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) $@;)
|
2011-07-12 17:45:59 +00:00
|
|
|
|
2013-12-13 16:34:35 +00:00
|
|
|
vanilla:
|
2013-12-14 09:17:53 +00:00
|
|
|
-@$(NOBATCH) &
|
2013-12-13 16:34:35 +00:00
|
|
|
|
2013-11-05 17:50:06 +00:00
|
|
|
check test:: compile
|
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 17:24:39 +00:00
|
|
|
check test test-dirty::
|
2012-02-16 20:24:51 +00:00
|
|
|
-$(MKDIR) $(testdir)
|
2013-11-05 17:50:06 +00:00
|
|
|
TMPDIR=$(testdir) $(BTEST)
|
2012-02-16 20:24:51 +00:00
|
|
|
ifeq ($(TEST_NO_AUTOCLEAN),) # define this variable to leave $(testdir) around for inspection
|
|
|
|
$(MAKE) cleantest
|
|
|
|
endif
|
2012-01-04 20:02:14 +00:00
|
|
|
|
2012-04-23 19:20:58 +00:00
|
|
|
up0 up1 up2::
|
2013-12-14 09:18:59 +00:00
|
|
|
git checkout $(GIT_BRANCH)
|
2012-01-05 19:54:52 +00:00
|
|
|
git remote update
|
2011-07-12 17:45:59 +00:00
|
|
|
git pull
|
2012-04-23 19:20:58 +00:00
|
|
|
up1 up2:: all
|
|
|
|
$(MAKE) test-dirty
|
|
|
|
up2 update2::
|
2012-04-30 04:49:23 +00:00
|
|
|
$(SUDO) $(MAKE) install
|
2011-07-12 17:45:59 +00:00
|
|
|
|
2011-07-19 18:05:14 +00:00
|
|
|
install: $(INSTSUB)
|
|
|
|
|
|
|
|
install-info: install-doc
|
2011-07-12 17:45:59 +00:00
|
|
|
|
2012-04-22 06:22:31 +00:00
|
|
|
doc docs: $(ORG_MAKE_DOC)
|
2011-07-12 17:45:59 +00:00
|
|
|
|
2011-07-17 12:49:43 +00:00
|
|
|
info html pdf card:
|
|
|
|
$(MAKE) -C doc $@
|
2011-07-12 20:31:41 +00:00
|
|
|
|
2011-07-19 18:05:14 +00:00
|
|
|
$(INSTSUB):
|
|
|
|
$(MAKE) -C $(@:install-%=%) install
|
2011-07-12 17:45:59 +00:00
|
|
|
|
2012-01-05 19:54:52 +00:00
|
|
|
autoloads: lisp
|
2011-07-17 12:49:43 +00:00
|
|
|
$(MAKE) -C $< $@
|
2011-07-12 17:45:59 +00:00
|
|
|
|
2012-04-22 06:05:51 +00:00
|
|
|
cleandirs:
|
|
|
|
$(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) cleanall;)
|
2011-07-12 20:31:41 +00:00
|
|
|
|
2012-08-22 06:04:56 +00:00
|
|
|
clean: cleanlisp cleandoc
|
2012-02-16 20:24:51 +00:00
|
|
|
|
2021-09-29 08:08:20 +00:00
|
|
|
cleanall: cleandirs cleantest
|
2016-02-14 11:44:56 +00:00
|
|
|
-$(FIND) . \( -name \*~ -o -name \*# -o -name .#\* \) -exec $(RM) {} +
|
|
|
|
-$(FIND) $(CLEANDIRS) \( -name \*~ -o -name \*.elc \) -exec $(RM) {} +
|
2011-07-12 20:31:41 +00:00
|
|
|
|
2012-08-19 16:54:15 +00:00
|
|
|
$(CLEANDIRS:%=clean%):
|
2016-02-14 11:44:56 +00:00
|
|
|
-$(FIND) $(@:clean%=%) \( -name \*~ -o -name \*.elc \) -exec $(RM) {} +
|
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 17:24:39 +00:00
|
|
|
|
2012-08-19 10:20:47 +00:00
|
|
|
cleanelc:
|
|
|
|
$(MAKE) -C lisp $@
|
|
|
|
|
2012-08-19 16:54:15 +00:00
|
|
|
cleanlisp cleandoc:
|
|
|
|
$(MAKE) -C $(@:clean%=%) clean
|
2012-01-05 19:54:52 +00:00
|
|
|
|
2012-08-19 16:54:15 +00:00
|
|
|
cleandocs:
|
2012-01-05 19:54:52 +00:00
|
|
|
$(MAKE) -C doc clean
|
2012-02-16 20:24:51 +00:00
|
|
|
-$(FIND) doc -name \*~ -exec $(RM) {} \;
|
|
|
|
|
|
|
|
cleantest:
|
2016-02-14 11:44:56 +00:00
|
|
|
# git-annex creates non-writable directories so that the files within
|
|
|
|
# them can't be removed; if rm fails, try to recover by making all
|
|
|
|
# directories writable
|
|
|
|
-$(RMR) $(testdir) || { \
|
|
|
|
$(FIND) $(testdir) -type d -exec $(CHMOD) u+w {} + && \
|
|
|
|
$(RMR) $(testdir) ; \
|
|
|
|
}
|