Commit Graph

23 Commits

Author SHA1 Message Date
Achim Gratz 357fd63a14 Improve compatibility with old Makefile
* targets.mk: change the "local.mk" template so that "oldorg" will be
  the default target for maximum compatibility.  Admonish info message
  with a reminder to use "make help" for more information on targets
  and that "oldorg" is the default target for now.  Add new
  convenience target "uncompiled" that will keep the lisp directory
  free from *.elc files and the autoload files up-to-date.

* Makefile: make "targets" and "helpall" depend on "help" so that only
  "help::" or "helpall::" needs to be written for adding more help
  messages.  Useful when users want to add their own messages to "make
  help" et al.
2012-04-26 08:55:32 +02:00
Achim Gratz 687766c922 Introduce compatibility and convenience targets, local.mk template, add "helpall"
* Makefile: new target "helpall" to document all targets, while "help"
  continues to show a brief subset.

* default.mk: add cutlines for sed to produce local.mk with.

* targets.mk: add target "local.mk" to produce an (empty) local.mk
  configuration template when it isn't already present.  Ignore any
  error when making this target since sed might not be present on all
  systems.  Redefine target "update" to not include testing, similarly
  add target "update2" to additionally install without test.  Add
  targets "up0" to stop after git pull and "up1" to stop after test,
  while "up2" continues to do everything and then installs.  Complete
  .PHONY target list.  Add "refcard" target for compatibility with old
  make.  Clean contrib in "cleanall", too.
2012-04-23 21:42:08 +02:00
Achim Gratz 0a9c29d305 allow customization of the "doc" target to skip certain types of documentation
* doc/Makefile: read targets to make for "doc" from $(ORG_MAKE_DOC),
  defaults to "info html pdf"; can be overridden by the user in
  local.mk.

* targets.mk: read targets to make for "doc" and "docs" from
  $(ORG_MAKE_DOC), defaults to "info html pdf"; can be overridden by
  the user in local.mk.

* default.mk: document ORG_MAKE_DOC and provide a (commented) example
  of how to have make only produce info documentation.
2012-04-22 10:51:29 +02:00
Achim Gratz 7993ae4816 fix bug introduced with aliasing target "doc" to "docs"
* targets.mk: $(SUBDIRS) must not be used as a dependency since "doc"
  is both an existing directory and a phony target
2012-04-22 10:51:25 +02:00
Achim Gratz c83da85416 provide an easier way to get the old behaviour of plain "make" back
* Makefile: move setup includes to top

* lisp/Makefile: reduce verbosity of org-version.el target, add a more
  friendly @echo instead.

* targets.mk: provide compatibility target "oldorg" to do "compile
  autoloads info" which is closest to the old behaviour.
2012-04-21 17:38:49 +02:00
Achim Gratz 4d97b47fe5 clean up documentation and provide "doc" as alternative target for "docs"
* Makefile: make documentation follow the implementation.

* targets.mk: add "doc" as alternative target for "docs" to adhere
  more closely to standards
some fixes
2012-04-21 12:27:18 +02:00
Achim Gratz 97e7636b68 Modify target 'update' to run tests before installation
* targets.mk: replace 'all' with 'test' in 'update'
2012-04-20 21:04:13 +02:00
Achim Gratz 3bbd458780 add cleaning of temporary test files (with option to keep them)
default.mk: add $(testdir) definition based on $(TMPDIR), which
    defaults to "/tmp" if not already defined

    targets.mk(check): call test suite with TMPDIR=$(testdir) and remove
    direactory after successful run of testsuite.  Do not remove
    temporary test files if $(TEST_NO_AUTOCLEAN) is set to a non-empty
    value.

    targets.mk(cleandirs): refactor the first part of what cleanall
    had been doing.

    targets.mk(cleanall): run cleantest and cleandirs, then remove
    backup files.

    targets.mk(cleanlisp): remove backup files.

    targets.mk(cleandoc): remove backup files.

    targets.mk(cleanall): run cleantest and cleandirs, then remove
    backup files.

    targets.mk(cleantest): removal of temporary test files.
2012-04-20 21:04:13 +02:00
Achim Gratz 035f24673b introduce "check" as alias for "test" to comply with GNU Makefile conventions
Makefile: change test to check in help text

	  targets.mk: add check as alias for test
2012-04-20 21:04:13 +02:00
Achim Gratz 353a0c519b introduce $(SUDO) to make install with administrative privileges customizable
defaults.mk: define SUDO to map to sudo, add comment to define
	blank if administrative privileges are not needed (already root on
	Linux or Administrator on Windows)

	targets.mk: use newly defined $(SUDO) uinstead of plain sudo,
	replaces some braces with parentheses
2012-04-20 21:04:12 +02:00
Achim Gratz 41624c1809 ignore *.t2d directories in doc/, adapt some comments, implement missing targets
.gitignore: also ignore *.t2d directories in doc/ that texi2pdf
	might produce when run in tidy mode

	default.mk: correct some comments

	targets.mk: implement missing clean targets and add aliases for
	them
2012-04-20 21:04:12 +02:00
Achim Gratz 4a7ed95010 introduce new make target "test"
Makefile: add help for target "test"

	default.mk: more sane location for local data, add $(BTEST) that
	will run the test in batch mode.  Some tests require non-standard
	packages, introduce $(BTEST_EXTRA) in order to add options so they
	can be found.

	targets.mk: new target "test" that implies "all" and then runs all
	test. Hidden target "test-dirty" runs tests without doing
	compilation.
2012-04-20 21:04:12 +02:00
Achim Gratz 6ec5f30165 Do not croak when git is not available
targets.mk: if no .git directory is present, assume that Git is
	not available.  Make ORGVERSION, GITVERSION and GITSTATUS
	customizable from local.mk (override from command line is also
	possible and probably easier)
2012-04-20 21:04:11 +02:00
Achim Gratz 0081071a52 create Makefile for etc/, some additions to .gitignore
* etc/Makefile: create, activate subdir "styles" for ODT exporter
	* .gitignore: ignore doc/git-describe.texi and .gitattributes
2012-04-20 21:04:10 +02:00
Achim Gratz 1e343f7f3b update target descriptions, target "all" now automatically cleans .elc before compilation
* targets.mk: target "all" for lisp directory does now the same as
	"compile", i.e. it cleans .elc file first
	* Makefile: describe all targets and re-arrange the target groups
2012-04-20 21:04:10 +02:00
Achim Gratz 6da2d089b0 move all version strings into org-install.el
* targets.mk: check for release and git version and record this
	into environment variables for use in sub-make invocations; add
	new target "compile-dirty" that does not invoke "make clean" first
	* doc/Makefile, lisp/Makefile: remove git version check, since
	they are now provided by first-level make
	* lisp/Makefile: add insertion of version information into
	org-install.el, have org-install.el depend on LISPF rather than
	LISPC so that autoloads can be produced without compiling
	everything and remove insertion into org.el and re-compilation
	during install; add new target "compile-dirty" to support
	invocation from first-level make
	* lisp/org.el (org-version): remove determination of version
	information, show "N/A" if the information is not provided via
	org-install.el
2012-04-20 21:04:10 +02:00
Achim Gratz 465adbdae3 Always "make clean" for lisp files before compiling them
* Makefile: prepend "make clean" in lisp directory when compiling

Rationale: Emacs prefers the compiled lisp files even if the source is newer.
In case of circular dependencies or if the dependencies file is not correct,
the compiled files might not reflect the sources.  Since there is no canonical
way to remove all compiled files which are stale (it can be hacked, but it is
really ugly), it seems more prudent to just always remove the compiled files
before starting the compilation.  Most folks already already do that anyway.
2012-04-20 21:04:09 +02:00
Achim Gratz 236b79da67 prepare for additional subdirs for "install"
* targets.mk: modify install target to be based on pattern
          match so that additional SUBDIRS will be automatically
          processed
2012-04-20 21:04:09 +02:00
Achim Gratz 501f9b1741 use sed instead of perl, add target clean-install
* Makefile, lisp/Makefile, doc/Makefile: add target clean-install
	to remove files in install-directories

	* default.mk: add customization variable $(SED)

	* doc/Makefile: do not remove dir while cleaning

	* lisp/Makefile: use sed instead of perl to weave git-status into
	org.el and ignore any errors while doing it.  Keep git status in
	$(GITSTATUS) to make it more clear what happens in the check.
2012-04-20 21:04:08 +02:00
Achim Gratz a5cb04dcd8 hand off ./doc to sub-make
* Makefile: use info function for output and call shell only once
* default.mk: add PDFTEX and RMR variables for customization
* lisp/Makefile: add target 'all' and create $(lispdir) if necessary
* maint-targets.mk: invoke sub-make for HTML manuals
* maint.mk: remove unsused VARIABLES
* targets.mk: invoke sub-make for ./doc and clean up some targets
2012-04-20 21:04:07 +02:00
Achim Gratz ac3162b4f0 activate local.mk and hand off ./lisp to a sub-make
* Makefile: add an optional include local.mk
* default.mk: install lisp files into org subfolder by default
* lisp/Makefile: new file to handle all make targets within lisp
* lisp/dependencies.mk: dependencies, should rather be auto-generated
* maint.mk: remove obsolete variable definitions
* targets.mk: hand off to sub-make in ./lisp, remove unused targets
2012-04-20 21:04:07 +02:00
Achim Gratz 77f0e50787 shuffle targets to their correct place, harden recipes
* Makefile: declare phony targets, remove help text for install-info-debian
* default.mk: add variable for FIND and RM
* targets.mk, maint-targets.mk: shuffle targets to where they belong, declare
  phony targets, work around a texi2dvi bug, use pattern rules, use targets for
  dependencies instead of repeating them verbatim
2012-04-20 21:04:07 +02:00
Achim Gratz b0ebd4365e Split off Makefile into several parts, included from master Makefile
* Makefile: just keep help target (now also default for no target)
  and include all other parts from here.
* default.mk: user editable variables with their default values
* maint.mk: definitions by maintainer, should not be touched by user
* targets.mk: user callable targets
* maint-targets.mk: targets for maintenance, should not be called by user
* dependencies.mk: keep order during compile (could become auto-generated)

This is the first in a series of patches that restructures the Makefile to
achieve easier customization and separation of different concerns (mainly user
vs. maintenance of the distribution).  This first patch simply establishes a
set of files without changing anything else to provide a clean starting point.
It uses GNU make extensions since Makefile already depends on GNU make anyway.
2012-04-20 21:04:07 +02:00