org-mode/lisp/Makefile
Achim Gratz df89e3cd0c 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-05-18 07:45:44 +02:00

53 lines
1.3 KiB
Makefile

.NOTPARALLEL: # always run this make serially
.SUFFIXES: # we don't need default suffix rules
ifeq ($(MAKELEVEL), 0)
$(error This make needs to be started as a sub-make from the toplevel directory.)
endif
LISPV = org-version.el
LISPI = org-install.el
LISPA = $(LISPV) $(LISPI)
LISPF = $(filter-out $(LISPA),$(wildcard *.el))
LISPC = $(LISPF:%el=%elc)
NOSTOP = all compile compile-dirty
DOSTOP = compile-stop compile-stop-dirty
.PHONY: $(NOSTOP) $(DOSTOP) \
autoloads $(LISPA) \
install clean cleanauto cleanall clean-install \
# do not clean here, done in toplevel make
$(NOSTOP) $(DOSTOP):: $(LISPV)
$(ELCDIR)
$(NOSTOP)::
$(MAKE) cleanauto
autoloads: $(LISPA)
$(LISPV):
@echo "org-version: $(ORGVERSION) ($(GITVERSION))"
@$(MAKE_ORG_VERSION)
$(LISPI): $(LISPV)
@echo "org-install: $(ORGVERSION) ($(GITVERSION))"
$(MAKE_ORG_INSTALL)
install: $(LISPF) compile
if [ ! -d $(DESTDIR)$(lispdir) ] ; then \
$(MKDIR) $(DESTDIR)$(lispdir) ; \
fi ;
$(MAKE) autoloads
$(CP) $(LISPC) $(LISPF) $(LISPA) $(DESTDIR)$(lispdir)
$(MAKE) cleanauto
cleanauto clean cleanall::
$(RM) $(LISPA) $(LISPA:%el=%elc)
clean cleanall::
$(RM) *.elc
clean-install:
if [ -d $(DESTDIR)$(lispdir) ] ; then \
$(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* ; \
fi ;