introduce "check" as alias for "test" to comply with GNU Makefile conventions
[org-mode.git] / targets.mk
blobfe283a5a5a69528635066d471316b82d9a52fe78
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 up2 update compile lisp doc etc \
24 check test install info html pdf card docs $(INSTSUB) \
25 autoloads cleanall clean cleancontrib cleanrel clean-install \
26 cleanelc cleanlisp cleandoc cleandocs
28 all \
29 compile:: lisp
30 $(MAKE) -C $< clean
32 compile \
33 compile-dirty:: lisp
34 $(MAKE) -C $< $@
36 all \
37 clean-install:: $(SUBDIRS)
38 $(foreach dir, $?, $(MAKE) -C $(dir) $@;)
40 check test:: all
42 check test \
43 test-dirty::
44 $(BTEST)
46 up2: update
47 $(SUDO) $(MAKE) install
49 update:
50 git remote update
51 git pull
52 $(MAKE) all
54 install: $(INSTSUB)
56 install-info: install-doc
58 docs: info html pdf card
60 info html pdf card:
61 $(MAKE) -C doc $@
63 $(INSTSUB):
64 $(MAKE) -C $(@:install-%=%) install
66 autoloads: lisp
67 $(MAKE) -C $< $@
69 cleanall: $(SUBDIRS)
70 $(foreach dir, $?, $(MAKE) -C $(dir) $@;)
71 -$(FIND) . -name \*~ -exec $(RM) {} \;
73 clean: cleanrel
74 $(MAKE) -C lisp clean
75 $(MAKE) -C doc clean
76 -$(FIND) . -name \*~ -exec $(RM) {} \;
78 cleancontrib:
79 -$(FIND) contrib -name \*~ -exec $(RM) {} \;
81 cleanrel:
82 $(RMR) RELEASEDIR
83 $(RMR) org-7.*
84 $(RMR) org-7*zip org-7*tar.gz
86 cleanelc cleanlisp:
87 $(MAKE) -C lisp clean
89 cleandoc cleandocs:
90 $(MAKE) -C doc clean