3 # Additional distribution files
4 DISTFILES_extra
= Makefile request-assign-future.txt contrib etc
8 CLEANDIRS
= contrib testing utils
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
)
28 DATE
= $(shell date
+%Y-
%m-
%d
)
30 GITVERSION
:= $(GITVERSION
:.dirty
=).dirty
33 .PHONY
: all oldorg update update2 up0 up1 up2 single
$(SUBDIRS
) \
34 check test install $(INSTSUB
) \
35 info html pdf card refcard doc docs \
36 autoloads cleanall
clean $(CLEANDIRS
:%=clean%) \
37 clean-install cleanelc cleandirs \
38 cleanlisp cleandoc cleandocs cleantest \
39 compile compile-dirty uncompiled \
40 config config-test config-exe config-all config-eol
42 CONF_BASE
= EMACS DESTDIR ORGCM
43 CONF_DEST
= lispdir
infodir datadir testdir
44 CONF_TEST
= BTEST_PRE BTEST_POST BTEST_OB_LANGUAGES BTEST_EXTRA
45 CONF_EXEC
= CP MKDIR RM RMR FIND SUDO PDFTEX TEXI2PDF TEXI2HTML MAKEINFO INSTALL_INFO
46 CONF_CALL
= BATCH BATCHL ELC ELCDIR BTEST MAKE_LOCAL_MK MAKE_ORG_INSTALL MAKE_ORG_VERSION
48 config-eol
:: config-all
51 $(info ========= Emacs executable and Installation paths
)
52 $(foreach var
,$(CONF_BASE
),$(info $(var
) = $($(var
))$(EOL
)))
53 $(foreach var
,$(CONF_DEST
),$(info $(var
) = $(DESTDIR
)$($(var
))$(EOL
)))
54 $(info ========= Additional files from contrib
/lisp
)
55 $(info ORG_FROM_CONTRIB
=)
56 $(info $(ORG_TO_LISP
:lisp
/%=%))
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
::
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 ifneq ($(ORG_FROM_CONTRIB
),)
92 $(CP
) $(ORG_FROM_CONTRIB
) lisp
/
94 $(foreach dir, doc lisp
, $(MAKE
) -C
$(dir) clean;)
95 compile compile-dirty
::
98 $(foreach dir, $(SUBDIRS
), $(MAKE
) -C
$(dir) $@
;)
101 check test test-dirty
::
103 TMPDIR
=$(testdir
) $(BTEST
)
104 ifeq ($(TEST_NO_AUTOCLEAN
),) # define this variable to leave $(testdir) around for inspection
114 $(SUDO
) $(MAKE
) install
118 install-info
: install-doc
120 doc docs
: $(ORG_MAKE_DOC
)
126 $(MAKE
) -C
$(@
:install-
%=%) install
132 $(foreach dir, $(SUBDIRS
), $(MAKE
) -C
$(dir) cleanall
;)
134 clean: cleanlisp cleandoc
136 cleanall
: cleandirs cleantest
137 -$(FIND
) . \
( -name \
*~
-o
-name \
*# -o -name .#\* \) -exec $(RM) {} \;
138 -$(FIND
) $(CLEANDIRS
) \
( -name \
*~
-o
-name \
*.elc \
) -exec
$(RM
) {} \
;
140 $(CLEANDIRS
:%=clean%):
141 -$(FIND
) $(@
:clean%=%) \
( -name \
*~
-o
-name \
*.elc \
) -exec
$(RM
) {} \
;
143 ifneq ($(ORG_TO_LISP
),)
144 cleanlisp
: cleanaddcontrib
153 $(MAKE
) -C
$(@
:clean%=%) clean
157 -$(FIND
) doc
-name \
*~
-exec
$(RM
) {} \
;