Browse Source

activate local.mk and hand off ./lisp to a sub-make

* Makefile: add an optional include local.mk
* default.mk: install lisp files into org subfolder by default
* lisp/Makefile: new file to handle all make targets within lisp
* lisp/dependencies.mk: dependencies, should rather be auto-generated
* maint.mk: remove obsolete variable definitions
* targets.mk: hand off to sub-make in ./lisp, remove unused targets
Achim Gratz 9 years ago
parent
commit
ac3162b4f0
7 changed files with 120 additions and 202 deletions
  1. 5 5
      Makefile
  2. 4 4
      default.mk
  3. 0 61
      dependencies.mk
  4. 38 0
      lisp/Makefile
  5. 61 0
      lisp/dependencies.mk
  6. 0 105
      maint.mk
  7. 12 27
      targets.mk

+ 5 - 5
Makefile

@@ -21,8 +21,8 @@ targets help:
 	@echo "make install-lisp - install Org ELisp files"
 	@echo "make install-info - install Org Info file"
 
-include default.mk
-include maint.mk
-include targets.mk
-include maint-targets.mk
-include dependencies.mk
+ include default.mk
+-include local.mk
+ include maint.mk
+ include targets.mk
+ include maint-targets.mk

+ 4 - 4
default.mk

@@ -9,7 +9,7 @@ EMACS   = emacs
 prefix  = /usr/share
 
 # Where local lisp files go.
-lispdir = $(prefix)/emacs/site-lisp
+lispdir = $(prefix)/emacs/site-lisp/org
 
 # Where info files go.
 infodir = $(prefix)/info
@@ -20,8 +20,8 @@ infodir = $(prefix)/info
 
 # Using emacs in batch mode.
 
-BATCH   = $(EMACS) -batch -q -no-site-file -eval                        \
-          "(setq load-path (cons (expand-file-name \"./lisp/\")         \
+BATCH   = $(EMACS) -batch -q -no-site-file -eval          \
+          "(setq load-path (cons (expand-file-name \".\") \
                                  (cons \"$(lispdir)\" load-path)))"
 
 # Specify the byte-compiler for compiling org-mode files
@@ -43,7 +43,7 @@ TEXI2HTML = makeinfo --html --number-sections
 FIND    = find
 
 # How to remove files
-RM      = rm
+RM      = rm -f
 
 # How to copy the lisp files and elc files to their destination.
 # CP    = cp -p         # try this if there is no install

+ 0 - 61
dependencies.mk

@@ -1,61 +0,0 @@
-# Dependencies
-
-lisp/org.elc:		lisp/org-macs.el lisp/org-compat.el lisp/org-faces.el
-lisp/org-agenda.elc:	lisp/org.el
-lisp/org-ascii.elc:	lisp/org-exp.el
-lisp/org-attach.elc:	lisp/org.el lisp/org-id.el
-lisp/org-archive.elc:	lisp/org.el
-lisp/org-bbdb.elc:	lisp/org.el
-lisp/org-beamer.elc:	lisp/org.el
-lisp/org-bibtex.elc:	lisp/org.el
-lisp/org-capture.elc:	lisp/org.el lisp/org-mks.el
-lisp/org-clock.elc:	lisp/org.el
-lisp/org-colview.elc:	lisp/org.el
-lisp/org-colview-xemacs.elc:	lisp/org.el
-lisp/org-compat.elc:	lisp/org-macs.el
-lisp/org-crypt.elc:	lisp/org-crypt.el lisp/org.el
-lisp/org-ctags.elc:	lisp/org.el
-lisp/org-datetree.elc:	lisp/org.el
-lisp/org-docview.elc:	lisp/org.el
-lisp/org-entities.elc:
-lisp/org-exp.elc:	lisp/org.el lisp/org-agenda.el
-lisp/org-exp-blocks.elc: lisp/org.el
-lisp/org-latex.elc:	lisp/org.el lisp/org-exp.el lisp/org-beamer.el
-lisp/org-docbook.elc:	lisp/org.el lisp/org-exp.el
-lisp/org-faces.elc:	lisp/org-macs.el lisp/org-compat.el
-lisp/org-feed.elc:	lisp/org.el
-lisp/org-footnotes.elc:	lisp/org-macs.el lisp/org-compat.el
-lisp/org-freemind.elc:	lisp/org.el
-lisp/org-gnus.elc:	lisp/org.el
-lisp/org-html.elc:	lisp/org-exp.el
-lisp/org-habit.elc:	lisp/org.el lisp/org-agenda.el
-lisp/org-icalendar.elc:	lisp/org-exp.el
-lisp/org-id.elc:	lisp/org.el
-lisp/org-indent.elc:	lisp/org.el lisp/org-macs.el lisp/org-compat.el
-lisp/org-info.elc:	lisp/org.el
-lisp/org-inlinetask.elc:
-lisp/org-irc.elc:	lisp/org.el
-lisp/org-jsinfo.elc:	lisp/org.el lisp/org-exp.el
-lisp/org-list.elc:	lisp/org-macs.el lisp/org-compat.el
-lisp/org-mac-message.elc:	lisp/org.el
-lisp/org-macs.elc:
-lisp/org-mew.elc:	lisp/org.el
-lisp/org-mhe.elc:	lisp/org.el
-lisp/org-mks.elc:
-lisp/org-mobile.elc:	lisp/org.el
-lisp/org-mouse.elc:	lisp/org.el
-lisp/org-plot.elc:	lisp/org.el lisp/org-exp.el lisp/org-table.el
-lisp/org-publish.elc:
-lisp/org-protocol.elc:	lisp/org.el
-lisp/org-remember.elc:	lisp/org.el
-lisp/org-rmail.elc:	lisp/org.el
-lisp/org-special-blocks.elc:	lisp/org-compat.el
-lisp/org-src.elc:	lisp/org-macs.el lisp/org-compat.el
-lisp/org-table.elc:	lisp/org.el
-lisp/org-taskjuggler.elc: lisp/org.el lisp/org-exp.el
-lisp/org-timer.elc:	lisp/org.el
-lisp/org-vm.elc:	lisp/org.el
-lisp/org-w3m.elc:	lisp/org.el
-lisp/org-wl.elc:	lisp/org.el
-lisp/org-xoxo.elc:	lisp/org-exp.el
-

+ 38 - 0
lisp/Makefile

@@ -0,0 +1,38 @@
+LISPO = org-install.el
+LISPF = $(subst $(LISPO),,$(wildcard *.el))
+LISPC = $(LISPF:%el=%elc)
+
+include dependencies.mk
+
+.PHONY:		autoloads compile install clean cleanall
+
+$(LISPC):	dependencies.mk
+
+compile:	$(LISPC)
+
+autoloads:	$(LISPO)
+
+org-install.el:	$(LISPC)
+	$(BATCH) \
+	 --eval "(require 'autoload)" \
+	 --eval '(find-file "$(LISPO)")' \
+	 --eval '(erase-buffer)' \
+	 --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPF))))' \
+	 --eval '(insert "\n(provide (quote org-install))\n")' \
+	 --eval '(save-buffer)'
+
+install:	$(LISPF) compile autoloads
+	$(CP) $(LISPC) $(LISPF) $(LISPO) $(lispdir)
+
+clean:
+	$(RM) $(LISPC)
+
+cleanall:
+	$(RM) $(LISPC) $(LISPO)
+
+.SUFFIXES:	# we don't need default suffix rules
+.SUFFIXES:	.el .elc
+
+.el.elc:
+	$(info in subdir lisp)
+	$(ELC) $<

+ 61 - 0
lisp/dependencies.mk

@@ -0,0 +1,61 @@
+# Dependencies
+
+org.elc:		org-macs.el org-compat.el org-faces.el
+org-agenda.elc:	org.el
+org-ascii.elc:	org-exp.el
+org-attach.elc:	org.el org-id.el
+org-archive.elc:	org.el
+org-bbdb.elc:	org.el
+org-beamer.elc:	org.el
+org-bibtex.elc:	org.el
+org-capture.elc:	org.el org-mks.el
+org-clock.elc:	org.el
+org-colview.elc:	org.el
+org-colview-xemacs.elc:	org.el
+org-compat.elc:	org-macs.el
+org-crypt.elc:	org-crypt.el org.el
+org-ctags.elc:	org.el
+org-datetree.elc:	org.el
+org-docview.elc:	org.el
+org-entities.elc:
+org-exp.elc:	org.el org-agenda.el
+org-exp-blocks.elc: org.el
+org-latex.elc:	org.el org-exp.el org-beamer.el
+org-docbook.elc:	org.el org-exp.el
+org-faces.elc:	org-macs.el org-compat.el
+org-feed.elc:	org.el
+org-footnotes.elc:	org-macs.el org-compat.el
+org-freemind.elc:	org.el
+org-gnus.elc:	org.el
+org-html.elc:	org-exp.el
+org-habit.elc:	org.el org-agenda.el
+org-icalendar.elc:	org-exp.el
+org-id.elc:	org.el
+org-indent.elc:	org.el org-macs.el org-compat.el
+org-info.elc:	org.el
+org-inlinetask.elc:
+org-irc.elc:	org.el
+org-jsinfo.elc:	org.el org-exp.el
+org-list.elc:	org-macs.el org-compat.el
+org-mac-message.elc:	org.el
+org-macs.elc:
+org-mew.elc:	org.el
+org-mhe.elc:	org.el
+org-mks.elc:
+org-mobile.elc:	org.el
+org-mouse.elc:	org.el
+org-plot.elc:	org.el org-exp.el org-table.el
+org-publish.elc:
+org-protocol.elc:	org.el
+org-remember.elc:	org.el
+org-rmail.elc:	org.el
+org-special-blocks.elc:	org-compat.el
+org-src.elc:	org-macs.el org-compat.el
+org-table.elc:	org.el
+org-taskjuggler.elc: org.el org-exp.el
+org-timer.elc:	org.el
+org-vm.elc:	org.el
+org-w3m.elc:	org.el
+org-wl.elc:	org.el
+org-xoxo.elc:	org-exp.el
+

+ 0 - 105
maint.mk

@@ -3,111 +3,6 @@
 ##----------------------------------------------------------------------
 
 # The following variables need to be defined by the maintainer
-LISPF      = 	org.el			\
-		org-agenda.el		\
-		org-ascii.el		\
-	     	org-attach.el		\
-	     	org-archive.el		\
-		org-bbdb.el		\
-		org-beamer.el		\
-		org-bibtex.el		\
-	     	org-capture.el		\
-	     	org-clock.el		\
-	     	org-colview.el		\
-	     	org-colview-xemacs.el	\
-	     	org-compat.el		\
-	     	org-pcomplete.el	\
-	     	org-crypt.el		\
-	     	org-ctags.el		\
-	     	org-datetree.el		\
-	     	org-docview.el		\
-	     	org-entities.el		\
-		org-exp.el		\
-		org-exp-blocks.el	\
-		org-docbook.el		\
-		org-faces.el		\
-		org-feed.el		\
-		org-footnote.el		\
-		org-freemind.el		\
-		org-gnus.el		\
-		org-habit.el		\
-		org-html.el		\
-		org-icalendar.el	\
-		org-id.el		\
-		org-indent.el		\
-		org-info.el		\
-		org-inlinetask.el	\
-		org-jsinfo.el		\
-		org-irc.el		\
-		org-latex.el		\
-		org-list.el		\
-		org-mac-message.el	\
-	     	org-macs.el		\
-		org-mew.el              \
-		org-mhe.el		\
-		org-mks.el		\
-		org-mobile.el		\
-		org-mouse.el		\
-		org-publish.el		\
-		org-plot.el		\
-		org-protocol.el		\
-		org-remember.el		\
-		org-rmail.el		\
-		org-special-blocks.el	\
-		org-src.el		\
-		org-table.el		\
-		org-taskjuggler.el	\
-		org-timer.el		\
-		org-vm.el		\
-		org-w3m.el              \
-		org-wl.el		\
-		org-xoxo.el		\
-		ob.el			\
-		ob-table.el		\
-		ob-lob.el		\
-		ob-ref.el		\
-		ob-exp.el		\
-		ob-tangle.el		\
-		ob-comint.el		\
-		ob-eval.el		\
-		ob-keys.el		\
-		ob-awk.el		\
-		ob-C.el			\
-		ob-calc.el		\
-		ob-ditaa.el		\
-		ob-haskell.el		\
-		ob-perl.el		\
-		ob-sh.el		\
-		ob-R.el			\
-		ob-dot.el		\
-		ob-mscgen.el		\
-		ob-latex.el		\
-		ob-lisp.el		\
-		ob-ledger.el		\
-		ob-python.el		\
-		ob-sql.el		\
-		ob-asymptote.el		\
-		ob-emacs-lisp.el	\
-		ob-matlab.el		\
-		ob-ruby.el		\
-		ob-sqlite.el		\
-		ob-clojure.el		\
-		ob-ocaml.el		\
-		ob-sass.el		\
-		ob-css.el		\
-		ob-gnuplot.el		\
-		ob-octave.el		\
-		ob-screen.el		\
-		ob-plantuml.el		\
-		ob-org.el		\
-		ob-js.el		\
-		ob-scheme.el		\
-		ob-lilypond.el
-
-LISPFILES0  = $(LISPF:%=lisp/%)
-LISPFILES   = $(LISPFILES0) lisp/org-install.el
-ELCFILES0   = $(LISPFILES0:.el=.elc)
-ELCFILES    = $(LISPFILES:.el=.elc)
 DOCFILES    = doc/org.texi doc/org.pdf doc/org doc/dir \
               doc/pdflayout.sty doc/.nosearch \
               doc/orgguide.texi doc/orgguide.pdf

+ 12 - 27
targets.mk

@@ -1,13 +1,15 @@
-.PHONY:	default all up2 update compile \
+.PHONY:	default all up2 update compile lisp\
 	install info html pdf card doc install-lisp install-info \
 	autoloads cleanall clean cleancontrib cleanelc cleandoc cleanrel
 .NOTPARALLEL: .PHONY
 # Additional distribution files
 DISTFILES_extra=  Makefile request-assign-future.txt contrib etc
+.EXPORT_ALL_VARIABLES:
 
-default: $(ELCFILES)
+lisp compile:
+	$(MAKE) -C lisp compile
 
-all:	default $(INFOFILES)
+all:	lisp $(INFOFILES)
 
 up2:	update
 	sudo ${MAKE} install
@@ -17,8 +19,6 @@ update:
 	${MAKE} clean
 	${MAKE} all
 
-compile: $(ELCFILES0)
-
 install: install-lisp
 
 info:	doc/org
@@ -31,27 +31,17 @@ card:	doc/orgcard.pdf doc/orgcard_letter.pdf doc/orgcard.txt
 
 doc:	html pdf card
 
-install-lisp: $(LISPFILES) default
+install-lisp:
 	if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ;
-	$(CP) $(LISPFILES)  $(lispdir)
-	$(CP) $(ELCFILES)   $(lispdir)
+	$(MAKE) -C lisp install
 
 install-info: $(INFOFILES)
 	if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ;
 	$(CP) $(INFOFILES) $(infodir)
 	$(INSTALL_INFO) --infodir=$(infodir) $(INFOFILES)
 
-autoloads: lisp/org-install.el
-
-lisp/org-install.el: $(LISPFILES0) maint.mk dependencies.mk
-	$(BATCH) \
-	 --eval "(require 'autoload)" \
-	 --eval '(find-file "org-install.el")' \
-	 --eval '(erase-buffer)' \
-	 --eval '(mapc (lambda (x) (generate-file-autoloads (symbol-name x))) (quote ($(LISPFILES0))))' \
-	 --eval '(insert "\n(provide (quote org-install))\n")' \
-	 --eval '(save-buffer)'
-	mv org-install.el lisp
+autoloads: lisp maint.mk
+	$(MAKE) -C lisp autoloads
 
 doc/org: doc/org.texi
 	(cd doc && $(MAKEINFO) --no-split org.texi -o org)
@@ -75,17 +65,15 @@ doc/orgcard_letter.tex: doc/orgcard.tex
                    doc/orgcard.tex > doc/orgcard_letter.tex
 
 cleanall: clean
-	$(RM) lisp/org-install.el
+	$(MAKE) -C lisp cleanall
 
-clean:	cleanelc cleandoc cleanrel cleancontrib
+clean:	cleandoc cleanrel cleancontrib
+	$(MAKE) -C lisp clean
 	-$(FIND) . -name \*~ -exec $(RM) {} \;
 
 cleancontrib:
 	-$(FIND) contrib -name \*~ -exec $(RM) {} \;
 
-cleanelc:
-	rm -f $(ELCFILES)
-
 cleandoc:
 	-(cd doc && rm -f org.pdf org org.html orgcard.pdf orgguide.pdf)
 	-(cd doc && rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs)
@@ -97,6 +85,3 @@ cleanrel:
 	rm -rf RELEASEDIR
 	rm -rf org-7.*
 	rm -rf org-7*zip org-7*tar.gz
-
-.el.elc:
-	$(ELC) $<