X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/3dc7169f617fbaeac115e8089e470fc115ae444f..b885adac363e09626a84a9631d27bade2151f42a:/GNUmakefile diff --git a/GNUmakefile b/GNUmakefile index 2b077678f..e35b82d66 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -15,10 +15,10 @@ check_copyrights: @echo "Compute exceptions >$(CR_EXCEPTIONS)~" @export LANG=C; \ (cd packages; \ - find . -name '*.el' -print0 | \ + find . -name '.git' -prune -o -name '*.el' -print0 | \ xargs -0 grep -L 'Free Software Foundation, Inc' | \ grep -v '\(\.dir-locals\|.-\(pkg\|autoloads\)\)\.el$$'; \ - find . -name '*.el' -print | \ + find . -name '.git' -prune -o -name '*.el' -print | \ while read f; do \ fquoted="$$(echo $$f|tr '|' '_')"; \ sed -n -e '/[Cc]opyright.*, *[1-9][-0-9]*,\?$$/N' \ @@ -54,8 +54,8 @@ process-archive: fi; \ if [ -d $$pt ]; then \ echo "Creating tarball $${pt}.tar" && \ - tar -cf $${pt}.tar $$pt -X "$$ignore"; \ - rm -r $${pt}; \ + tar -cf $${pt}.tar $$pt --exclude-vcs -X "$$ignore"; \ + rm -rf $${pt}; \ fi; \ done mkdir -p archive/packages @@ -105,13 +105,26 @@ endef # Compute the set of autolods files and their dependencies. autoloads := $(foreach pkg, $(pkgs), $(pkg)/$(notdir $(pkg))-autoloads.el) +# FIXME: In 99% of the cases, autoloads can be generated in any order. +# But the `names' package is an exception because it sets up an advice that +# changes the way autload.el operates, and that advice is needed when creating +# the autoloads file of packages that use `names', such as `aggressive-indent'. +# The right solution is to check the Package-Requires and create the autoloads +# files in topological order, but for now we'll just do it the ad-hoc way +# add hand-made dependencies between autoloads files, and explicitly +# load the names-autoloads file when building autoloads files. + +packages/aggressive-indent/aggressive-indent-autoloads.el: \ + packages/names/names-autoloads.el + $(foreach al, $(autoloads), $(eval $(call RULE-srcdeps, $(al)))) %-autoloads.el: - @echo 'EMACS -f package-generate-autoloads $@' + @echo 'Generating autoloads for $@' @cd $(dir $@); \ $(EMACS) -l $(CURDIR)/admin/archive-contents.el \ --eval "(archive--refresh-pkg-file)" \ --eval "(require 'package)" \ + --eval "(load (expand-file-name \"../names/names-autoloads.el\") t t)" \ --eval "(package-generate-autoloads \"$$(basename $$(pwd))\" \ \"$$(pwd)\")" @@ -129,10 +142,10 @@ elcs := $(call SET-diff, $(naive_elcs), $(patsubst %.el, %.elc, $(nbc_els))) # '(dolist (al (quote ($(patsubst %, "%", $(autoloads))))) (load (expand-file-name al) nil t))' %.elc: %.el - @echo 'EMACS -f batch-byte-compile $<' + @echo 'Byte compiling $<' @$(EMACS) \ - --eval "(setq package-directory-list '(\"$(abspath packages)\"))" \ - --eval '(package-initialize)' \ + --eval "(setq package-directory-list nil package-user-dir \"$(abspath packages)\")" \ + -f package-initialize \ -L $(dir $@) -f batch-byte-compile $< .PHONY: elcs @@ -145,21 +158,18 @@ $(extra_elcs):; rm $@ # # Put into single_pkgs the set of -pkg.el files we need to keep up-to-date. # # I.e. all the -pkg.el files for the single-file packages. -# single_pkgs:=$(foreach pkg, $(pkgs), \ -# $(word $(words $(call FILTER-nonsrc, \ -# $(wildcard $(pkg)/*.el))), \ -# $(pkg)/$(notdir $(pkg))-pkg.el)) -# #$(foreach al, $(single_pkgs), $(eval $(call RULE-srcdeps, $(al)))) -# %-pkg.el: %.el -# @echo 'EMACS -f package-generate-description-file $@' -# @$(EMACS) \ -# --eval '(require (quote package))' \ -# --eval '(setq b (find-file-noselect "$<"))' \ -# --eval '(setq d (with-current-buffer b (package-buffer-info)))' \ -# --eval '(package-generate-description-file d "$(dir $@)")' +pkg_descs:=$(foreach pkg, $(pkgs), $(pkg)/$(notdir $(pkg))-pkg.el) +#$(foreach al, $(single_pkgs), $(eval $(call RULE-srcdeps, $(al)))) +%-pkg.el: %.el + @echo 'Generating description file $@' + @$(EMACS) \ + --eval '(require (quote package))' \ + --eval '(setq b (find-file-noselect "$<"))' \ + --eval '(setq d (with-current-buffer b (package-buffer-info)))' \ + --eval '(package-generate-description-file d "$@")' .PHONY: all-in-place -all-in-place: $(extra_elcs) $(autoloads) # $(single_pkgs) +all-in-place: $(extra_elcs) $(autoloads) $(pkg_descs) # Do them in a sub-make, so that autoloads are done first. $(MAKE) elcs