introduce new make target "test"
[org-mode.git] / targets.mk
blob02d1be09a14e0e2f15513e87ad46ecd8cf49cec0
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 test install info html pdf card docs $(INSTSUB) \
25 autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel clean-install
27 all \
28 compile:: lisp
29 $(MAKE) -C $< clean
31 compile \
32 compile-dirty:: lisp
33 $(MAKE) -C $< $@
35 all \
36 clean-install:: $(SUBDIRS)
37 $(foreach dir, $?, $(MAKE) -C $(dir) $@;)
39 test:: all
41 test \
42 test-dirty::
43 $(BTEST)
45 up2: update
46 sudo ${MAKE} install
48 update:
49 git pull
50 ${MAKE} clean
51 ${MAKE} all
53 install: $(INSTSUB)
55 install-info: install-doc
57 docs: info html pdf card
59 info html pdf card:
60 $(MAKE) -C doc $@
62 $(INSTSUB):
63 $(MAKE) -C $(@:install-%=%) install
65 autoloads: lisp maint.mk
66 $(MAKE) -C $< $@
68 cleanall: $(SUBDIRS)
69 $(foreach dir, $?, $(MAKE) -C $(dir) $@;)
70 -$(FIND) . -name \*~ -exec $(RM) {} \;
72 clean: cleanrel
73 $(MAKE) -C lisp clean
74 $(MAKE) -C doc clean
75 -$(FIND) . -name \*~ -exec $(RM) {} \;
77 cleancontrib:
78 -$(FIND) contrib -name \*~ -exec $(RM) {} \;
80 cleanrel:
81 $(RMR) RELEASEDIR
82 $(RMR) org-7.*
83 $(RMR) org-7*zip org-7*tar.gz