org-e-odt: Turn off `org-e-odt-prettify-xml'
[org-mode.git] / targets.mk
blob680af0547828e2adbc9894324bcf24999486aeeb
1 .EXPORT_ALL_VARIABLES:
2 .NOTPARALLEL: .PHONY
3 # Additional distribution files
4 DISTFILES_extra= Makefile request-assign-future.txt contrib etc
6 LISPDIRS = lisp
7 OTHERDIRS = doc etc
8 SUBDIRS = $(OTHERDIRS) $(LISPDIRS)
9 INSTSUB = $(SUBDIRS:%=install-%)
10 ORG_MAKE_DOC ?= info html pdf
12 ifneq ($(wildcard .git),)
13 GITVERSION ?= $(shell git describe --abbrev=6 HEAD)
14 ORGVERSION ?= $(subst release_,,$(shell git describe --abbrev=0 HEAD))
15 GITSTATUS ?= $(shell git status -uno --porcelain)
16 else
17 GITVERSION ?= N/A
18 ORGVERSION ?= N/A
19 endif
20 DATE = $(shell date +%Y-%m-%d)
21 ifneq ($(GITSTATUS),)
22 GITVERSION := $(GITVERSION:.dirty=).dirty
23 endif
25 .PHONY: all oldorg update update2 up0 up1 up2 compile $(SUBDIRS) \
26 check test install info html pdf card doc docs $(INSTSUB) \
27 autoloads cleanall clean cleancontrib cleanutils cleanrel clean-install \
28 cleanelc cleandirs cleanlisp cleandoc cleandocs cleantest
29 compile compile-dirty uncompiled
31 oldorg: compile info # what the old makefile did when no target was specified
32 uncompiled: cleanlisp autoloads # for developing
33 refcard: card
34 update update2:: up0 all
36 .PRECIOUS: local.mk
37 local.mk:
38 $(info ======================================================)
39 $(info = Invoke "make help" for a synopsis of make targets. =)
40 $(info = Created a default local.mk template. =)
41 $(info = Setting "oldorg" as the default target. =)
42 $(info = Please adapt local.mk to your local setup! =)
43 $(info ======================================================)
44 -@$(MAKE_LOCAL_MK)
46 all compile::
47 $(foreach dir, doc lisp, $(MAKE) -C $(dir) clean;)
48 compile compile-dirty::
49 $(MAKE) -C lisp $@
50 all clean-install::
51 $(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) $@;)
53 check test:: compile
54 check test test-dirty::
55 -$(MKDIR) $(testdir)
56 TMPDIR=$(testdir) $(BTEST)
57 ifeq ($(TEST_NO_AUTOCLEAN),) # define this variable to leave $(testdir) around for inspection
58 $(MAKE) cleantest
59 endif
61 up0 up1 up2::
62 git remote update
63 git pull
64 up1 up2:: all
65 $(MAKE) test-dirty
66 up2 update2::
67 $(SUDO) $(MAKE) install
69 install: $(INSTSUB)
71 install-info: install-doc
73 doc docs: $(ORG_MAKE_DOC)
75 info html pdf card:
76 $(MAKE) -C doc $@
78 $(INSTSUB):
79 $(MAKE) -C $(@:install-%=%) install
81 autoloads: lisp
82 $(MAKE) -C $< $@
84 cleandirs:
85 $(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) cleanall;)
87 clean: cleanrel
88 $(MAKE) -C lisp clean
89 $(MAKE) -C doc clean
91 cleanall: cleandirs cleantest cleancontrib cleanutils
92 -$(FIND) . -name \*~ -o -name \*# -o -name .#\* -exec $(RM) {} \;
94 cleancontrib:
95 -$(FIND) contrib -name \*~ -o -name \*.elc -exec $(RM) {} \;
97 cleanutils:
98 -$(FIND) UTILITIES -name \*~ -o -name \*.elc -exec $(RM) {} \;
100 cleanrel:
101 $(RMR) RELEASEDIR
102 $(RMR) org-7.*
103 $(RMR) org-7*zip org-7*tar.gz
105 cleanelc cleanlisp:
106 $(MAKE) -C lisp clean
107 -$(FIND) lisp -name \*~ -exec $(RM) {} \;
109 cleandoc cleandocs:
110 $(MAKE) -C doc clean
111 -$(FIND) doc -name \*~ -exec $(RM) {} \;
113 cleantest:
114 $(RMR) $(testdir)