123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- .NOTPARALLEL: .PHONY
- # Additional distribution files
- DISTFILES_extra= Makefile request-assign-future.txt contrib etc
- .EXPORT_ALL_VARIABLES:
- LISPDIRS = lisp
- SUBDIRS = doc etc $(LISPDIRS)
- INSTSUB = $(SUBDIRS:%=install-%)
- ORG_MAKE_DOC ?= info html pdf
- ifneq ($(wildcard .git),)
- GITVERSION ?= $(shell git describe --abbrev=6 HEAD)
- ORGVERSION ?= $(subst release_,,$(shell git describe --abbrev=0 HEAD))
- GITSTATUS ?= $(shell git status -uno --porcelain)
- else
- GITVERSION ?= N/A
- ORGVERSION ?= N/A
- endif
- DATE = $(shell date +%Y-%m-%d)
- ifneq ($(GITSTATUS),)
- GITVERSION := $(GITVERSION).dirty
- endif
- .PHONY: all oldorg update update2 up0 up1 up2 compile $(SUBDIRS) \
- check test install info html pdf card doc docs $(INSTSUB) \
- autoloads cleanall clean cleancontrib cleanrel clean-install \
- cleanelc cleandirs cleanlisp cleandoc cleandocs cleantest \
- compile compile-dirty
- oldorg: compile autoloads info # what the old makefile did when no target was specified
- refcard: card
- update update2:: up0 all
- .PRECIOUS: local.mk
- local.mk:
- $(info ==========================================)
- $(info Created a local.mk template.)
- $(info Please adapt local.mk to your local setup!)
- $(info ==========================================)
- -@$(SED) -n \
- -e '/-8<-/,/->8-/ {s/^\(\s*[^#]\)/#\1/;p}' \
- -e '$$ i ## See default.mk for further configuration options.' \
- default.mk > $@
- all \
- compile:: lisp
- $(MAKE) -C $< clean
- compile \
- compile-dirty:: lisp
- $(MAKE) -C $< $@
- all \
- clean-install::
- $(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) $@;)
- check test:: all
- check test \
- test-dirty::
- -$(MKDIR) $(testdir)
- TMPDIR=$(testdir) $(BTEST)
- ifeq ($(TEST_NO_AUTOCLEAN),) # define this variable to leave $(testdir) around for inspection
- $(MAKE) cleantest
- endif
- up0 up1 up2::
- git remote update
- git pull
- up1 up2:: all
- $(MAKE) test-dirty
- up2 update2::
- $(SUDO) $(MAKE) install
- install: $(INSTSUB)
- install-info: install-doc
- doc docs: $(ORG_MAKE_DOC)
- info html pdf card:
- $(MAKE) -C doc $@
- $(INSTSUB):
- $(MAKE) -C $(@:install-%=%) install
- autoloads: lisp
- $(MAKE) -C $< $@
- cleandirs:
- $(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) cleanall;)
- clean: cleanrel
- $(MAKE) -C lisp clean
- $(MAKE) -C doc clean
- cleanall: cleandirs cleantest cleancontrib
- -$(FIND) . -name \*~ -exec $(RM) {} \;
- cleancontrib:
- -$(FIND) contrib -name \*~ -exec $(RM) {} \;
- cleanrel:
- $(RMR) RELEASEDIR
- $(RMR) org-7.*
- $(RMR) org-7*zip org-7*tar.gz
- cleanelc cleanlisp:
- $(MAKE) -C lisp clean
- -$(FIND) lisp -name \*~ -exec $(RM) {} \;
- cleandoc cleandocs:
- $(MAKE) -C doc clean
- -$(FIND) doc -name \*~ -exec $(RM) {} \;
- cleantest:
- $(RMR) $(testdir)
|