3 # Additional distribution files
4 DISTFILES_extra
= Makefile request-assign-future.txt contrib etc
8 CLEANDIRS
= contrib testing mk
9 SUBDIRS
= $(OTHERDIRS
) $(LISPDIRS
)
10 INSTSUB
= $(SUBDIRS
:%=install-
%)
11 ORG_MAKE_DOC ?
= info html pdf
13 ifneq ($(wildcard .git
),)
14 GITVERSION ?
= $(shell git describe
--match release\
* --abbrev
=6 HEAD
)
15 ORGVERSION ?
= $(subst release_
,,$(shell git describe
--match release\
* --abbrev
=0 HEAD
))
16 GITSTATUS ?
= $(shell git status
-uno
--porcelain
)
18 -include mk
/version.mk
22 DATE
= $(shell date
+%Y-
%m-
%d
)
23 YEAR
= $(shell date
+%Y
)
25 GITVERSION
:= $(GITVERSION
:.dirty
=).dirty
28 .PHONY
: all oldorg update update2 up0 up1 up2 single
$(SUBDIRS
) \
29 check test install $(INSTSUB
) \
30 info html pdf card refcard doc docs \
31 autoloads cleanall
clean $(CLEANDIRS
:%=clean%) \
32 clean-install cleanelc cleandirs cleanaddcontrib \
33 cleanlisp cleandoc cleandocs cleantest \
34 compile compile-dirty uncompiled \
35 config config-test config-exe config-all config-eol config-version \
38 CONF_BASE
= EMACS DESTDIR ORGCM ORG_MAKE_DOC
39 CONF_DEST
= lispdir
infodir datadir testdir
40 CONF_TEST
= BTEST_PRE BTEST_POST BTEST_OB_LANGUAGES BTEST_EXTRA BTEST_RE
41 CONF_EXEC
= CP MKDIR RM RMR FIND CHMOD SUDO PDFTEX TEXI2PDF TEXI2HTML MAKEINFO INSTALL_INFO
42 CONF_CALL
= BATCH BATCHL ELC ELCDIR NOBATCH BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION
44 config-eol
:: config-all
47 $(info ========= Emacs executable and Installation paths
)
48 $(foreach var
,$(CONF_BASE
),$(info $(var
) = $($(var
))$(EOL
)))
49 $(foreach var
,$(CONF_DEST
),$(info $(var
) = $(DESTDIR
)$($(var
))$(EOL
)))
50 $(info ========= Additional files from contrib
/lisp
)
54 $(addprefix contrib
/lisp
/, \
56 $(notdir $(ORG_ADD_CONTRIB
))))))))
57 config-test config-all
::
59 $(info ========= Test configuration
)
60 $(foreach var
,$(CONF_TEST
),$(info $(var
) = $($(var
))$(EOL
)))
61 config-exe config-all
::
63 $(info ========= Executables used by make
)
64 $(foreach var
,$(CONF_EXEC
),$(info $(var
) = $($(var
))$(EOL
)))
65 config-cmd config-all
::
67 $(info ========= Commands used by make
)
68 $(foreach var
,$(CONF_CALL
),$(info $(var
) = $($(var
))$(EOL
)))
69 config config-test config-exe config-all config-version
::
70 $(info ========= Org version
)
71 $(info make
: Org-mode version
$(ORGVERSION
) ($(GITVERSION
) => $(lispdir
)))
74 oldorg
: compile
info # what the old makefile did when no target was specified
75 uncompiled
: cleanlisp autoloads
# for developing
77 update update2
:: up0
all
84 $(info ======================================================)
85 $(info = Invoke
"make help" for a synopsis of make targets.
=)
86 $(info = Created a default local.mk template.
=)
87 $(info = Setting
"oldorg" as the default target.
=)
88 $(info = Please adapt local.mk to your local setup
! =)
89 $(info ======================================================)
93 $(foreach dir, doc lisp
, $(MAKE
) -C
$(dir) clean;)
94 compile compile-dirty
::
97 $(foreach dir, $(SUBDIRS
), $(MAKE
) -C
$(dir) $@
;)
103 check test test-dirty
::
105 TMPDIR
=$(testdir
) $(BTEST
)
106 ifeq ($(TEST_NO_AUTOCLEAN
),) # define this variable to leave $(testdir) around for inspection
110 up0
:: cleanaddcontrib
112 git checkout
$(GIT_BRANCH
)
118 $(SUDO
) $(MAKE
) install
122 install-info
: install-doc
124 doc docs
: $(ORG_MAKE_DOC
)
130 $(MAKE
) -C
$(@
:install-
%=%) install
136 $(foreach dir, $(SUBDIRS
), $(MAKE
) -C
$(dir) cleanall
;)
138 clean: cleanlisp cleandoc
140 cleanall
: cleandirs cleantest cleanaddcontrib
141 -$(FIND
) . \
( -name \
*~
-o
-name \
*# -o -name .#\* \) -exec $(RM) {} +
142 -$(FIND
) $(CLEANDIRS
) \
( -name \
*~
-o
-name \
*.elc \
) -exec
$(RM
) {} +
144 $(CLEANDIRS
:%=clean%):
145 -$(FIND
) $(@
:clean%=%) \
( -name \
*~
-o
-name \
*.elc \
) -exec
$(RM
) {} +
151 -$(RM
) $(wildcard $(addprefix lisp
/,$(notdir $(wildcard contrib
/lisp
/*.el
))))
153 cleanlisp
: cleanaddcontrib
155 $(MAKE
) -C
$(@
:clean%=%) clean
159 -$(FIND
) doc
-name \
*~
-exec
$(RM
) {} \
;
162 # git-annex creates non-writable directories so that the files within
163 # them can't be removed; if rm fails, try to recover by making all
164 # directories writable
165 -$(RMR
) $(testdir
) ||
{ \
166 $(FIND
) $(testdir
) -type d
-exec
$(CHMOD
) u
+w
{} + && \
167 $(RMR
) $(testdir
) ; \