Merge branch 'master' of orgmode.org:org-mode
[org-mode.git] / lisp / Makefile
blob4047b42cfb6f08c86d9c353a0fa7158b114eef06
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
7 LISPV = org-version.el
8 LISPI = org-install.el
9 LISPA = $(LISPV) $(LISPI)
10 LISPF = $(filter-out $(LISPA),$(sort $(wildcard *.el)))
11 LISPC = $(filter-out $(LISPN:%el=%elc),$(LISPF:%el=%elc))
13 .PHONY: all compile compile-dirty \
14 dirall source slint1 slint3 slint4 \
15 compile-single compile-source \
16 compile-slint1 compile-slint2 compile-slint3 compile-slint4 \
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-$(_COMPILE_)
24 compile-dirall: dirall
25 compile-single: $(LISPC)
26 compile-source: source dirall
27 compile-slint1: dirall slint1
28 compile-slint2: source dirall slint1
29 compile-slint3: slint3 dirall
30 compile-slint4: slint4 dirall
32 # internal
33 dirall:
34 @$(info ==================== $@ ====================)
35 @$(ELCDIR)
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);)
42 slint3:
43 @$(info ==================== $@ ====================)
44 -@$(ELINTL) $(foreach el,$(LISPF),$(ELINTF))
45 slint4:
46 @$(info ==================== $@ ====================)
47 -@$(foreach el,$(LISPF),$(ELINTL) $(ELINTF);)
49 %.elc: %.el
50 @$(info Compiling single $(abspath $<)...)
51 -@$(ELC) $<
53 autoloads: cleanauto $(LISPI) $(LISPV)
55 $(LISPV): $(LISPF)
56 @echo "org-version: $(ORGVERSION) ($(GITVERSION))"
57 @$(RM) $(@)
58 @$(MAKE_ORG_VERSION)
60 $(LISPI): $(LISPV) $(LISPF)
61 @echo "org-install: $(ORGVERSION) ($(GITVERSION))"
62 @$(RM) $(@)
63 @$(MAKE_ORG_INSTALL)
65 install: $(LISPF) compile
66 if [ ! -d $(DESTDIR)$(lispdir) ] ; then \
67 $(MKDIR) $(DESTDIR)$(lispdir) ; \
68 fi ;
69 $(CP) $(LISPC) $(LISPF) $(LISPA) $(DESTDIR)$(lispdir)
71 cleanauto clean cleanall::
72 $(RM) $(LISPA) $(LISPA:%el=%elc)
73 clean cleanall cleanelc::
74 $(RM) *.elc
76 clean-install:
77 if [ -d $(DESTDIR)$(lispdir) ] ; then \
78 $(RM) $(DESTDIR)$(lispdir)/org*.el* $(DESTDIR)$(lispdir)/ob*.el* ; \
79 fi ;