fix bug introduced with aliasing target "doc" to "docs"
[org-mode/org-mode-NeilSmithlineMods.git] / targets.mk
blob394e55e896179c09d86ea5f225128741f335e790
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-%)
10 ifneq ($(wildcard .git),)
11 GITVERSION ?= $(shell git describe --abbrev=6 HEAD)
12 ORGVERSION ?= $(subst release_,,$(shell git describe --abbrev=0 HEAD))
13 GITSTATUS ?= $(shell git status -uno --porcelain)
14 else
15 GITVERSION ?= N/A
16 ORGVERSION ?= N/A
17 endif
18 DATE = $(shell date +%Y-%m-%d)
19 ifneq ($(GITSTATUS),)
20 GITVERSION := $(GITVERSION).dirty
21 endif
23 .PHONY: default all oldorg up2 update compile lisp doc etc \
24 check test install info html pdf card doc docs $(INSTSUB) \
25 autoloads cleanall clean cleancontrib cleanrel clean-install \
26 cleanelc cleandirs cleanlisp cleandoc cleandocs cleantest
28 # backwards compatibility target
29 oldorg: compile autoloads info
31 all \
32 compile:: lisp
33 $(MAKE) -C $< clean
35 compile \
36 compile-dirty:: lisp
37 $(MAKE) -C $< $@
39 all \
40 clean-install::
41 $(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) $@;)
43 check test:: all
45 check test \
46 test-dirty::
47 -$(MKDIR) $(testdir)
48 TMPDIR=$(testdir) $(BTEST)
49 ifeq ($(TEST_NO_AUTOCLEAN),) # define this variable to leave $(testdir) around for inspection
50 $(MAKE) cleantest
51 endif
53 up2: update
54 $(SUDO) $(MAKE) install
56 update:
57 git remote update
58 git pull
59 $(MAKE) check
61 install: $(INSTSUB)
63 install-info: install-doc
65 doc docs: info html pdf card
67 info html pdf card:
68 $(MAKE) -C doc $@
70 $(INSTSUB):
71 $(MAKE) -C $(@:install-%=%) install
73 autoloads: lisp
74 $(MAKE) -C $< $@
76 cleandirs:
77 $(foreach dir, $(SUBDIRS), $(MAKE) -C $(dir) cleanall;)
79 clean: cleanrel
80 $(MAKE) -C lisp clean
81 $(MAKE) -C doc clean
83 cleanall: cleandirs cleantest
84 -$(FIND) . -name \*~ -exec $(RM) {} \;
86 cleancontrib:
87 -$(FIND) contrib -name \*~ -exec $(RM) {} \;
89 cleanrel:
90 $(RMR) RELEASEDIR
91 $(RMR) org-7.*
92 $(RMR) org-7*zip org-7*tar.gz
94 cleanelc cleanlisp:
95 $(MAKE) -C lisp clean
96 -$(FIND) lisp -name \*~ -exec $(RM) {} \;
98 cleandoc cleandocs:
99 $(MAKE) -C doc clean
100 -$(FIND) doc -name \*~ -exec $(RM) {} \;
102 cleantest:
103 $(RMR) $(testdir)