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 ORG_FROM_CONTRIB
= $(wildcard \
15 $(addprefix contrib
/lisp
/, \
17 $(notdir $(ORG_ADD_CONTRIB
))))))
18 ORG_TO_LISP
= $(ORG_FROM_CONTRIB
:contrib
/%=%)
20 ifneq ($(wildcard .git
),)
21 GITVERSION ?
= $(shell git describe
--abbrev
=6 HEAD
)
22 ORGVERSION ?
= $(subst release_
,,$(shell git describe
--abbrev
=0 HEAD
))
23 GITSTATUS ?
= $(shell git status
-uno
--porcelain
)
25 -include mk
/version.mk
29 DATE
= $(shell date
+%Y-
%m-
%d
)
31 GITVERSION
:= $(GITVERSION
:.dirty
=).dirty
34 .PHONY
: all oldorg update update2 up0 up1 up2 single
$(SUBDIRS
) \
35 check test install $(INSTSUB
) \
36 info html pdf card refcard doc docs \
37 autoloads cleanall
clean $(CLEANDIRS
:%=clean%) \
38 clean-install cleanelc cleandirs \
39 cleanlisp cleandoc cleandocs cleantest \
40 compile compile-dirty uncompiled \
41 config config-test config-exe config-all config-eol
43 CONF_BASE
= EMACS DESTDIR ORGCM
44 CONF_DEST
= lispdir
infodir datadir testdir
45 CONF_TEST
= BTEST_PRE BTEST_POST BTEST_OB_LANGUAGES BTEST_EXTRA
46 CONF_EXEC
= CP MKDIR RM RMR FIND SUDO PDFTEX TEXI2PDF TEXI2HTML MAKEINFO INSTALL_INFO
47 CONF_CALL
= BATCH BATCHL ELC ELCDIR BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION
49 config-eol
:: config-all
52 $(info ========= Emacs executable and Installation paths
)
53 $(foreach var
,$(CONF_BASE
),$(info $(var
) = $($(var
))$(EOL
)))
54 $(foreach var
,$(CONF_DEST
),$(info $(var
) = $(DESTDIR
)$($(var
))$(EOL
)))
55 $(info ========= Additional files from contrib
/lisp
)
56 $(info ORG_FROM_CONTRIB
=)
57 $(info $(ORG_TO_LISP
:lisp
/%=%))
58 config-test config-all
::
60 $(info ========= Test configuration
)
61 $(foreach var
,$(CONF_TEST
),$(info $(var
) = $($(var
))$(EOL
)))
62 config-exe config-all
::
64 $(info ========= Executables used by make
)
65 $(foreach var
,$(CONF_EXEC
),$(info $(var
) = $($(var
))$(EOL
)))
66 config-cmd config-all
::
68 $(info ========= Commands used by make
)
69 $(foreach var
,$(CONF_CALL
),$(info $(var
) = $($(var
))$(EOL
)))
70 config config-test config-exe config-all
::
73 oldorg
: compile
info # what the old makefile did when no target was specified
74 uncompiled
: cleanlisp autoloads
# for developing
76 update update2
:: up0
all
83 $(info ======================================================)
84 $(info = Invoke
"make help" for a synopsis of make targets.
=)
85 $(info = Created a default local.mk template.
=)
86 $(info = Setting
"oldorg" as the default target.
=)
87 $(info = Please adapt local.mk to your local setup
! =)
88 $(info ======================================================)
92 ifneq ($(ORG_FROM_CONTRIB
),)
93 $(CP
) $(ORG_FROM_CONTRIB
) lisp
/
95 $(foreach dir, doc lisp
, $(MAKE
) -C
$(dir) clean;)
96 compile compile-dirty
::
99 $(foreach dir, $(SUBDIRS
), $(MAKE
) -C
$(dir) $@
;)
102 check test test-dirty
::
104 TMPDIR
=$(testdir
) $(BTEST
)
105 ifeq ($(TEST_NO_AUTOCLEAN
),) # define this variable to leave $(testdir) around for inspection
115 $(SUDO
) $(MAKE
) install
119 install-info
: install-doc
121 doc docs
: $(ORG_MAKE_DOC
)
127 $(MAKE
) -C
$(@
:install-
%=%) install
133 $(foreach dir, $(SUBDIRS
), $(MAKE
) -C
$(dir) cleanall
;)
135 clean: cleanlisp cleandoc
137 cleanall
: cleandirs cleantest
138 -$(FIND
) . \
( -name \
*~
-o
-name \
*# -o -name .#\* \) -exec $(RM) {} \;
139 -$(FIND
) $(CLEANDIRS
) \
( -name \
*~
-o
-name \
*.elc \
) -exec
$(RM
) {} \
;
141 $(CLEANDIRS
:%=clean%):
142 -$(FIND
) $(@
:clean%=%) \
( -name \
*~
-o
-name \
*.elc \
) -exec
$(RM
) {} \
;
144 ifneq ($(ORG_TO_LISP
),)
145 cleanlisp
: cleanaddcontrib
154 $(MAKE
) -C
$(@
:clean%=%) clean
158 -$(FIND
) doc
-name \
*~
-exec
$(RM
) {} \
;