From 5a2fa7a18a44812edff01af516e3062287a53cf8 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Tue, 13 Sep 2016 16:53:11 +0100 Subject: [PATCH] Lots of changes --- packages/GNUmakefile | 8 +++--- packages/admin/package-makefile.el | 43 ++++++++++++++++++++++++++++++ packages/gnumakefile.mk | 2 +- packages/temp.el | 11 ++++++++ 4 files changed, 58 insertions(+), 6 deletions(-) diff --git a/packages/GNUmakefile b/packages/GNUmakefile index d419b1de475..4d97ed32934 100644 --- a/packages/GNUmakefile +++ b/packages/GNUmakefile @@ -6,10 +6,9 @@ EMACS=../src/emacs DIRS=$(filter-out .,$(subst ./,,$(shell find . -maxdepth 1 -type d))) -## alas "all" is an ELPA package, so this is going to break -all: build-all +## dependent on makefile +all: pkg-all $(EMACS) -build-all: $(DIRS) $(EMACS) # define package_template @@ -31,8 +30,7 @@ build-all: $(DIRS) $(EMACS) # test: $(patsubst %,%-test,$(DIRS)) -include gnumakefile.mk - +include gnumakefile-inc.mk clean: find . -name "*pkg.el" -exec rm -v {} \; diff --git a/packages/admin/package-makefile.el b/packages/admin/package-makefile.el index c83235099e4..34f32d69490 100644 --- a/packages/admin/package-makefile.el +++ b/packages/admin/package-makefile.el @@ -12,6 +12,49 @@ packages which occur earlier in the list.") (defun package-makefile--package-dirs (directory) (directory-files directory nil "[^.].*")) + +(defun package-makefile--target-pkg-el (top-dir base-dir) + (format + "%s-pkg: %s/%s/%s-pkg.el + +%s/%s/%s-pkg.el: +\t$(EMACS) --batch --directory=admin \\ +\t\t--load admin/package-build.el \\ +\t\t--eval '(package-build-prepare \"%s/%s\")' +" + + base-dir top-dir base-dir base-dir + top-dir base-dir base-dir + top-dir base-dir)) + +(defun package-makefile--makefile-pkg-targets (top-dir) + (concat + "pkg-all: " + (mapconcat + 'identity + (package-makefile--package-dirs top-dir) "" "-pkg ") + "\n\n" + (mapconcat + (lambda (base-dir) + (package-makefile--target-pkg-el top-dir base-dir)) + (package-makefile--package-dirs top-dir) + "\n"))) + +(defun package-makefile--makefile () + (mapconcat + (lambda (top-dir) + (package-makefile--makefile-pkg-targets top-dir)) + package-makefile-archives + "\n")) + + +(defun package-makefile () + (with-temp-buffer + (insert + (package-makefile--makefile)) + + (write-file "gnumakefile-inc.mk"))) + ;; example: core/example/example-pkg.el ;; core/example/example-pkg.el ;; $(EMACS) --batch --load package-build.el --eval '(package-build-prepare "core/example"")' diff --git a/packages/gnumakefile.mk b/packages/gnumakefile.mk index a6f350a227e..347f0da201f 100644 --- a/packages/gnumakefile.mk +++ b/packages/gnumakefile.mk @@ -3,4 +3,4 @@ example: core/example/example-pkg.el core/example/example-pkg.el: $(EMACS) --batch --directory=admin \ --load admin/package-build.el \ - --eval '(package-build-prepare "core/example"")' + --eval '(package-build-prepare "core/example")' diff --git a/packages/temp.el b/packages/temp.el index ccf0101cb31..fb2399aafaa 100644 --- a/packages/temp.el +++ b/packages/temp.el @@ -1,2 +1,13 @@ (package-makefile--package-dirs "core") (package-makefile--package-dirs "/home/phillord/src/git/elpa/master/packages") + + +(package-makefile--target-pkg-el "core" "example") +(package-makefile--makefile-pkg-targets "core") +(package-makefile--makefile) + +(package-build-prepare "core/example") + +(defun temp () + (interactive) + (package-makefile)) -- 2.39.5