# # Automatic management of a collection of small librairies for Emacs. # # Set the variable AUTOLOADFILE below # to a filename which will contain all the autoloads. This file must # then be "required" by your configuration file (.emacs for a single # user.) by the following line : # (require 'site-autoloads "~/.autoloads") # where, off course, ~/.autoloads is to be replaced by the value of # AUTOLOADFILE. AUTOLOADFILE = $(HOME)/.autoloads EMACS = emacs -no-site-file -no-init-file LISPDIRS = $(PWD) #LISPDIRS = $(HOME)/emacs-lisp $(HOME)/emacs-lisp/moy ##################################################################### LISPFILES = ${wildcard ${patsubst %, %/*.el, $(LISPDIRS)}} all : byte-compile autoloads autoloads : $(AUTOLOADFILE).elc byte-compile : ${patsubst %.el, %.elc, $(LISPFILES)} %.elc : %.el @echo "Byte compiling the source file "$< @$(EMACS) -batch -q -f batch-byte-compile $< $(AUTOLOADFILE).el: $(LISPFILES) @$(RM) $@; @echo "(provide 'moy-autoloads)" > $@; @echo " " >> $@; $(EMACS) -batch -q -l autoload \ --eval '(setq generated-autoload-file "$@")' \ --eval "(if (featurep 'xemacs) (delete-file generated-autoload-file))" \ --eval '(setq make-backup-files nil)' \ -f batch-update-autoloads $(LISPDIRS) $(AUTOLOADFILE).elc: $(AUTOLOADFILE).el @echo "Byte compiling the autoload file "$< @$(EMACS) -batch -q -f batch-byte-compile $^ @echo "*******************************************************************" @echo "Autoloads up to date. Put the following lines in your configuration" @echo "file (~/.emacs for a single user) :" @echo @echo ${patsubst %, "(add-to-list 'load-path \""%"\") ", $(LISPDIRS)} @echo "(require 'moy-autoloads \""$(AUTOLOADFILE)"\")" @echo