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
--abbrev
=6 HEAD
)
15 ORGVERSION ?
= $(subst release_
,,$(shell git describe
--abbrev
=0 HEAD
))
16 GITSTATUS ?
= $(shell git status
-uno
--porcelain
)
18 -include mk
/version.mk
22 DATE
= $(shell date
+%Y-
%m-
%d
)
24 GITVERSION
:= $(GITVERSION
:.dirty
=).dirty
27 .PHONY
: all oldorg update update2 up0 up1 up2 single
$(SUBDIRS
) \
28 check test install $(INSTSUB
) \
29 info html pdf card refcard doc docs \
30 autoloads cleanall
clean $(CLEANDIRS
:%=clean%) \
31 clean-install cleanelc cleandirs cleanaddcontrib \
32 cleanlisp cleandoc cleandocs cleantest \
33 compile compile-dirty uncompiled \
34 config config-test config-exe config-all config-eol config-version
36 CONF_BASE
= EMACS DESTDIR ORGCM ORG_MAKE_DOC
37 CONF_DEST
= lispdir
infodir datadir testdir
38 CONF_TEST
= BTEST_PRE BTEST_POST BTEST_OB_LANGUAGES BTEST_EXTRA
39 CONF_EXEC
= CP MKDIR RM RMR FIND SUDO PDFTEX TEXI2PDF TEXI2HTML MAKEINFO INSTALL_INFO
40 CONF_CALL
= BATCH BATCHL ELC ELCDIR BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION
42 config-eol
:: config-all
45 $(info ========= Emacs executable and Installation paths
)
46 $(foreach var
,$(CONF_BASE
),$(info $(var
) = $($(var
))$(EOL
)))
47 $(foreach var
,$(CONF_DEST
),$(info $(var
) = $(DESTDIR
)$($(var
))$(EOL
)))
48 $(info ========= Additional files from contrib
/lisp
)
52 $(addprefix contrib
/lisp
/, \
54 $(notdir $(ORG_ADD_CONTRIB
))))))))
55 config-test config-all
::
57 $(info ========= Test configuration
)
58 $(foreach var
,$(CONF_TEST
),$(info $(var
) = $($(var
))$(EOL
)))
59 config-exe config-all
::
61 $(info ========= Executables used by make
)
62 $(foreach var
,$(CONF_EXEC
),$(info $(var
) = $($(var
))$(EOL
)))
63 config-cmd config-all
::
65 $(info ========= Commands used by make
)
66 $(foreach var
,$(CONF_CALL
),$(info $(var
) = $($(var
))$(EOL
)))
67 config config-test config-exe config-all config-version
::
68 $(info ========= Org version
)
69 $(info make
: Org-mode version
$(ORGVERSION
) ($(GITVERSION
) => $(lispdir
)))
72 oldorg
: compile
info # what the old makefile did when no target was specified
73 uncompiled
: cleanlisp autoloads
# for developing
75 update update2
:: up0
all
82 $(info ======================================================)
83 $(info = Invoke
"make help" for a synopsis of make targets.
=)
84 $(info = Created a default local.mk template.
=)
85 $(info = Setting
"oldorg" as the default target.
=)
86 $(info = Please adapt local.mk to your local setup
! =)
87 $(info ======================================================)
91 $(foreach dir, doc lisp
, $(MAKE
) -C
$(dir) clean;)
92 compile compile-dirty
::
95 $(foreach dir, $(SUBDIRS
), $(MAKE
) -C
$(dir) $@
;)
97 check test single-test
:: compile
98 check test test-dirty
::
100 TMPDIR
=$(testdir
) $(BTEST
) -f org-test-run-batch-tests
102 single-test single-test-dirty
::
104 TMPDIR
=$(testdir
) $(BTEST
) --eval
"(org-test-load)" --eval
"(ert '$(TEST))"
106 ifeq ($(TEST_NO_AUTOCLEAN
),) # define this variable to leave $(testdir) around for inspection
110 up0
:: cleanaddcontrib
117 $(SUDO
) $(MAKE
) install
121 install-info
: install-doc
123 doc docs
: $(ORG_MAKE_DOC
)
129 $(MAKE
) -C
$(@
:install-
%=%) install
135 $(foreach dir, $(SUBDIRS
), $(MAKE
) -C
$(dir) cleanall
;)
137 clean: cleanlisp cleandoc
139 cleanall
: cleandirs cleantest cleanaddcontrib
140 -$(FIND
) . \
( -name \
*~
-o
-name \
*# -o -name .#\* \) -exec $(RM) {} \;
141 -$(FIND
) $(CLEANDIRS
) \
( -name \
*~
-o
-name \
*.elc \
) -exec
$(RM
) {} \
;
143 $(CLEANDIRS
:%=clean%):
144 -$(FIND
) $(@
:clean%=%) \
( -name \
*~
-o
-name \
*.elc \
) -exec
$(RM
) {} \
;
150 -$(RM
) $(wildcard $(addprefix lisp
/,$(notdir $(wildcard contrib
/lisp
/*.el
))))
152 cleanlisp
: cleanaddcontrib
154 $(MAKE
) -C
$(@
:clean%=%) clean
158 -$(FIND
) doc
-name \
*~
-exec
$(RM
) {} \
;