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