]> code.delx.au - gnu-emacs-elpa/blobdiff - GNUmakefile
[gnugo] Make ‘C-u F’ add the blurb as a comment to the last node.
[gnu-emacs-elpa] / GNUmakefile
index 7f2061d12f3323302c16d1314ccfa7a31f4a7804..2b077678f37ae6a0d1b6aa5e0e6fe409272943b5 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for GNU Emacs Lisp Package Archive.
 
-EMACS=emacs
+EMACS=emacs --batch
 
 ARCHIVE_TMP=archive-tmp
 SITE_DIR=site
@@ -9,46 +9,55 @@ SITE_DIR=site
 
 all: all-in-place
 
-## Set up the source files for direct usage, by pointing
-## `package-directory-list' to the site/ directory.
-site: packages
-       mkdir -p $(SITE_DIR)
-       $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el \
-         --eval "(batch-make-site-dir \"packages\" \"$(SITE_DIR)\")"
-
-site/%: do-it
-       $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el \
-         --eval "(progn (setq debug-on-error t) (batch-make-site-package \"$@\"))"
+CR_EXCEPTIONS=copyright_exceptions
+.PHONY: check_copyrights
+check_copyrights:
+       @echo "Compute exceptions >$(CR_EXCEPTIONS)~"
+       @export LANG=C;                                                 \
+       (cd packages;                                                   \
+       find . -name '*.el' -print0 |                                   \
+           xargs -0 grep -L 'Free Software Foundation, Inc' |          \
+           grep -v '\(\.dir-locals\|.-\(pkg\|autoloads\)\)\.el$$';     \
+       find . -name '*.el' -print |                                    \
+           while read f; do                                            \
+               fquoted="$$(echo $$f|tr '|' '_')";                      \
+               sed -n -e '/[Cc]opyright.*, *[1-9][-0-9]*,\?$$/N'       \
+                   -e '/Free Software Foundation/d'                    \
+                   -e "s|^\\(.*[Cc]opyright\\)|$$fquoted:\\1|p"        \
+                  "$$f";                                               \
+           done) | sort >$(CR_EXCEPTIONS)~
+       diff -u "$(CR_EXCEPTIONS)" "$(CR_EXCEPTIONS)~"
 
 ## Deploy the package archive to archive/, with packages in
 ## archive/packages/:
 archive: archive-tmp
        $(MAKE) $(MFLAGS) process-archive
 
-archive-tmp: packages changelogs
+archive-tmp: packages
        -rm -r $(ARCHIVE_TMP)
        mkdir -p $(ARCHIVE_TMP)
        cp -a packages/. $(ARCHIVE_TMP)/packages
 
-# Refresh the ChangeLog files.  This needs to be done in
-# the source tree, because it needs the Bzr data!
-changelogs:
-       cd packages; \
-       $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el \
-                       -f batch-prepare-packages
-
 process-archive:
        # FIXME, we could probably speed this up significantly with
        # rules like "%.tar: ../%/ChangeLog" so we only rebuild the packages
        # that have indeed changed.
-       cd $(ARCHIVE_TMP)/packages; $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el -f batch-make-archive
-       @cd $(ARCHIVE_TMP)/packages; \
-       for pt in *; do \
-           if [ -d $$pt ]; then \
-               echo "Creating tarball $${pt}.tar" && \
-               tar -cf $${pt}.tar $$pt --remove-files; \
-           fi; \
-       done
+       cd $(ARCHIVE_TMP)/packages;                             \
+         $(EMACS) -l $(CURDIR)/admin/archive-contents.el       \
+                  -f batch-make-archive
+       @cd $(ARCHIVE_TMP)/packages;                            \
+         for pt in *; do                                       \
+             if [ -f "$${pt}/.elpaignore" ]; then              \
+                 ignore="$${pt}/.elpaignore";                  \
+             else                                              \
+                 ignore="/dev/null";                           \
+             fi;                                               \
+             if [ -d $$pt ]; then                              \
+                 echo "Creating tarball $${pt}.tar" &&         \
+                 tar -cf $${pt}.tar $$pt -X "$$ignore";        \
+                 rm -r $${pt};                                 \
+             fi;                                               \
+         done
        mkdir -p archive/packages
        mv archive/packages archive/packages-old
        mv $(ARCHIVE_TMP)/packages archive/packages
@@ -62,6 +71,8 @@ archive-full: archive-tmp org-fetch
        #mkdir -p archive/admin
        #cp admin/* archive/admin/
 
+# FIXME: Turn it into an `external', which will require adding the notion of
+# "snapshot" packages.
 org-fetch: archive-tmp
        cd $(ARCHIVE_TMP)/packages; \
        pkgname=`curl -s http://orgmode.org/elpa/|perl -ne 'push @f, $$1 if m/(org-\d{8})\.tar/; END { @f = sort @f; print "$$f[-1]\n"}'`; \
@@ -75,7 +86,7 @@ org-fetch: archive-tmp
 clean:
        rm -rf archive $(ARCHIVE_TMP) $(SITE_DIR)
 
-########## Rules for in-place installation ##########
+########## Rules for in-place installation ####################################
 pkgs := $(foreach pkg, $(wildcard packages/*), \
           $(if $(shell [ -d "$(pkg)" ] && echo true), $(pkg)))
 
@@ -98,12 +109,11 @@ $(foreach al, $(autoloads), $(eval $(call RULE-srcdeps, $(al))))
 %-autoloads.el:
        @echo 'EMACS -f package-generate-autoloads $@'
        @cd $(dir $@); \
-       $(EMACS) --batch \
-           -l $(CURDIR)/admin/archive-contents.el \
-           --eval "(archive--refresh-pkg-file)" \
-           --eval "(require 'package)" \
-           --eval "(package-generate-autoloads '$$(basename $$(pwd)) \
-                                               \"$$(pwd)\")"
+         $(EMACS) -l $(CURDIR)/admin/archive-contents.el \
+             --eval "(archive--refresh-pkg-file)" \
+             --eval "(require 'package)" \
+             --eval "(package-generate-autoloads \"$$(basename $$(pwd))\" \
+                                                 \"$$(pwd)\")"
 
 # Put into elcs the set of elc files we need to keep up-to-date.
 # I.e. one for each .el file except for the -pkg.el, the -autoloads.el, and
@@ -120,7 +130,7 @@ 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 $<'
-       @$(EMACS) --batch \
+       @$(EMACS) \
            --eval "(setq package-directory-list '(\"$(abspath packages)\"))" \
            --eval '(package-initialize)' \
            -L $(dir $@) -f batch-byte-compile $<
@@ -142,7 +152,7 @@ $(extra_elcs):; rm $@
 # #$(foreach al, $(single_pkgs), $(eval $(call RULE-srcdeps, $(al))))
 # %-pkg.el: %.el
 #      @echo 'EMACS -f package-generate-description-file $@'
-#      @$(EMACS) --batch \
+#      @$(EMACS) \
 #          --eval '(require (quote package))' \
 #          --eval '(setq b (find-file-noselect "$<"))' \
 #          --eval '(setq d (with-current-buffer b (package-buffer-info)))' \
@@ -152,3 +162,11 @@ $(extra_elcs):; rm $@
 all-in-place: $(extra_elcs) $(autoloads) # $(single_pkgs)
        # Do them in a sub-make, so that autoloads are done first.
        $(MAKE) elcs
+
+
+############### Rules to prepare the externals ################################
+
+.PHONY:
+externals:
+       $(EMACS) -l admin/archive-contents.el \
+           -f archive-add/remove/update-externals