Makefile: add link to Worg to `make helpĀ“
[org-mode.git] / lisp / Makefile
blobcd2ec1ed4582f0ab8420153278bf5526c7982137
1 .NOTPARALLEL: # always run this make serially
2 .SUFFIXES: # we don't need default suffix rules
3 ifeq ($(MAKELEVEL), 0)
4 $(error This make needs to be started as a sub-make from the toplevel directory.)
5 endif
6 -include local.mk
8 LISPV = org-version.el
9 LISPI = org-install.el
10 LISPA = $(LISPV) $(LISPI)
11 LISPF = $(filter-out $(LISPA),$(sort $(wildcard *.el)))
12 LISPC = $(filter-out $(LISPN:%el=%elc),$(LISPF:%el=%elc))
14 _ORGCM_ = dirall single source slint1
15 .PHONY: all compile compile-dirty \
16 $(_ORGCM_) $(_ORGCM_:%=compile-%) compile-slint2 \
17 autoloads \
18 install clean cleanauto cleanall cleanelc clean-install
20 # do not clean here, done in toplevel make
21 all compile compile-dirty:: autoloads
22 $(MAKE) compile-$(ORGCM)
24 compile-dirall: dirall
25 compile-single: single $(LISPC)
26 compile-source: source dirall
27 compile-slint1: dirall slint1
28 compile-slint2: source dirall slint1
30 # internal
31 dirall:
32 @$(info ==================== $@ ====================)
33 @$(ELCDIR)
34 single:
35 @$(info ==================== $@ ====================)
36 source: cleanelc
37 @$(info ==================== $@ ====================)
38 @$(foreach elc,$(LISPC),$(MAKE) $(elc) && $(RM) $(elc);)
39 slint1:
40 @$(info ==================== $@ ====================)
41 @$(foreach elc,$(LISPC),$(RM) $(elc); $(MAKE) $(elc);)
43 %.elc: %.el
44 @$(info Compiling single $(abspath $<)...)
45 -@$(ELC) $<
47 autoloads: cleanauto $(LISPI) $(LISPV)
49 $(LISPV): $(LISPF)
50 @echo "org-version: $(ORGVERSION) ($(GITVERSION))"
51 @$(RM) $(@)
52 @$(MAKE_ORG_VERSION)
54 $(LISPI): $(LISPV) $(LISPF)
55 @echo "org-install: $(ORGVERSION) ($(GITVERSION))"
56 @$(RM) $(@)
57 @$(MAKE_ORG_INSTALL)
59 install: $(LISPF) compile
60 if [ ! -d $(DESTDIR)$(lispdir) ] ; then \
61 $(MKDIR) $(DESTDIR)$(lispdir) ; \
62 fi ;
63 $(CP) $(LISPC) $(LISPF) $(LISPA) $(DESTDIR)$(lispdir)
65 cleanauto clean cleanall::
66 $(RM) $(LISPA) $(LISPA:%el=%elc)
67 clean cleanall cleanelc::
68 $(RM) *.elc
70 clean-install:
71 if [ -d $(DESTDIR)$(lispdir) ] ; then \
72 $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* ; \
73 fi ;