org-drill: prevent errors caused by attempting to display inline images on a non...
[org-mode/org-mode-NeilSmithlineMods.git] / targets.mk
blob4ad5c5f11f59708fba9a0410ba2a8b51920451bd
1 .NOTPARALLEL: .PHONY
2 # Additional distribution files
3 DISTFILES_extra= Makefile request-assign-future.txt contrib etc
4 .EXPORT_ALL_VARIABLES:
6 LISPDIRS = lisp
7 SUBDIRS = doc etc $(LISPDIRS)
8 INSTSUB = $(SUBDIRS:%=install-%)
9 ORG_MAKE_DOC ?= info html pdf
11 ifneq ($(wildcard .git),)
12 GITVERSION ?= $(shell git describe --abbrev=6 HEAD)
13 ORGVERSION ?= $(subst release_,,$(shell git describe --abbrev=0 HEAD))
14 GITSTATUS ?= $(shell git status -uno --porcelain)
15 else
16 GITVERSION ?= N/A
17 ORGVERSION ?= N/A
18 endif
19 DATE = $(shell date +%Y-%m-%d)
20 ifneq ($(GITSTATUS),)
21 GITVERSION := $(GITVERSION).dirty
22 endif
24 .PHONY: all oldorg update update2 up0 up1 up2 compile $(SUBDIRS) \
25 check test install info html pdf card doc docs $(INSTSUB) \
26 autoloads cleanall clean cleancontrib cleanrel clean-install \
27 cleanelc cleandirs cleanlisp cleandoc cleandocs cleantest \
28 compile compile-dirty uncompiled
30 oldorg: compile autoloads info # what the old makefile did when no target was specified
31 uncompiled: cleanlisp autoloads # for developing
32 refcard: card
33 update update2:: up0 all
35 .PRECIOUS: local.mk
36 local.mk:
37 $(info ======================================================)
38 $(info = Invoke "make help" for a synopsis of make targets. =)
39 $(info = Created a default local.mk template. =)
40 $(info = Setting "oldorg" as the default target. =)
41 $(info = Please adapt local.mk to your local setup! =)
42 $(info ======================================================)
43 -@$(SED) -n \
44 -e '1 i ## Remove the following line to make "all" the default target' \
45 -e '1 i oldorg:' \
46 -e '/-8<-/,/->8-/ {s/^\(\s*[^#]\)/#\1/;p}' \
47 -e '$$ i ## See default.mk for further configuration options.' \
48 default.mk > $@
50 all \
51 compile:: lisp
52 $(MAKE) -C $< clean
54 compile \
55 compile-dirty:: lisp
56 $(MAKE) -C $< $@
58 all \
59 clean-install::
60 $(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) $@;)
62 check test:: all
64 check test \
65 test-dirty::
66 -$(MKDIR) $(testdir)
67 TMPDIR=$(testdir) $(BTEST)
68 ifeq ($(TEST_NO_AUTOCLEAN),) # define this variable to leave $(testdir) around for inspection
69 $(MAKE) cleantest
70 endif
72 up0 up1 up2::
73 git remote update
74 git pull
75 up1 up2:: all
76 $(MAKE) test-dirty
77 up2 update2::
78 $(SUDO) $(MAKE) install
80 install: $(INSTSUB)
82 install-info: install-doc
84 doc docs: $(ORG_MAKE_DOC)
86 info html pdf card:
87 $(MAKE) -C doc $@
89 $(INSTSUB):
90 $(MAKE) -C $(@:install-%=%) install
92 autoloads: lisp
93 $(MAKE) -C $< $@
95 cleandirs:
96 $(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) cleanall;)
98 clean: cleanrel
99 $(MAKE) -C lisp clean
100 $(MAKE) -C doc clean
102 cleanall: cleandirs cleantest cleancontrib
103 -$(FIND) . -name \*~ -exec $(RM) {} \;
105 cleancontrib:
106 -$(FIND) contrib -name \*~ -exec $(RM) {} \;
108 cleanrel:
109 $(RMR) RELEASEDIR
110 $(RMR) org-7.*
111 $(RMR) org-7*zip org-7*tar.gz
113 cleanelc cleanlisp:
114 $(MAKE) -C lisp clean
115 -$(FIND) lisp -name \*~ -exec $(RM) {} \;
117 cleandoc cleandocs:
118 $(MAKE) -C doc clean
119 -$(FIND) doc -name \*~ -exec $(RM) {} \;
121 cleantest:
122 $(RMR) $(testdir)