Skip to content

Commit 8947650

Browse files
committed
Rewritten Makefile to use Carton.
1 parent af2b2c5 commit 8947650

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

Carton

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(package-file "drupal-mode.el")
2+
3+
(source "marmalade" "http://marmalade-repo.org/packages/")

Makefile

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,41 +19,38 @@
1919

2020
.PHONY: all test clean install
2121

22-
ARCHIVE_NAME:=drupal-mode
23-
VERSION:=$(shell emacs --batch -l package --eval "(with-temp-buffer \
24-
(insert-file \"$(ARCHIVE_NAME).el\")\
25-
(princ (aref (package-buffer-info) 3)))")
26-
PACKAGE_NAME:=$(ARCHIVE_NAME)-$(VERSION)
22+
CARTON?=carton
23+
EMACS?=emacs
24+
TAR?=bsdtar
25+
PANDOC?=pandoc --atx-headers
26+
27+
VERSION?=$(shell $(CARTON) version)
28+
29+
ARCHIVE_NAME=drupal-mode
30+
PACKAGE_NAME=$(ARCHIVE_NAME)-$(VERSION)
2731

2832
all: $(PACKAGE_NAME).tar
2933

3034
test:
31-
emacs --batch --user `whoami` -L `pwd` -l drupal-tests -f ert-run-tests-batch-and-exit
35+
$(CARTON) install
36+
$(CARTON) exec $(EMACS) --no-site-file --no-site-lisp --batch -L $(PWD) -l drupal-tests -f ert-run-tests-batch-and-exit
3237

3338
$(ARCHIVE_NAME).info: README.md
34-
pandoc -t texinfo $^ | makeinfo -o $@
39+
$(PANDOC) -t texinfo $^ | makeinfo -o $@
3540

3641
README: README.md
37-
pandoc --atx-headers -t plain -o $@ $^
42+
$(PANDOC) -t plain -o $@ $^
3843

39-
# requires package-build.el from https://github.com/milkypostman/melpa
40-
# to be available in your emacs load-path
4144
$(ARCHIVE_NAME)-pkg.el: $(ARCHIVE_NAME).el
42-
emacs --batch --user `whoami` -l package-build --eval "(progn \
43-
(pb/write-pkg-file \
44-
\"$(ARCHIVE_NAME)-pkg.el\" \
45-
(with-temp-buffer \
46-
(insert-file \"$(ARCHIVE_NAME).el\") \
47-
(package-buffer-info))))"
45+
$(CARTON) package
4846

4947
# create a tar ball in package.el format for uploading to http://marmalade-repo.org
5048
$(PACKAGE_NAME).tar: README $(ARCHIVE_NAME).el $(ARCHIVE_NAME)-pkg.el $(ARCHIVE_NAME).info dir drupal/*.el drupal-tests.el drush-make-mode.el
51-
tar -c -s "@^@$(PACKAGE_NAME)/@" -f $(PACKAGE_NAME).tar $^
49+
$(TAR) -c -s "@^@$(PACKAGE_NAME)/@" -f $(PACKAGE_NAME).tar $^
5250

5351
install: $(PACKAGE_NAME).tar
54-
emacs --batch --user `whoami` -l package --eval "(progn \
55-
(package-initialize)\
56-
(package-install-file \"`pwd`/$(PACKAGE_NAME).tar\"))"
52+
$(EMACS) --batch -l package -f package-initialize --eval "(package-install-file \"$(PWD)/$(PACKAGE_NAME).tar\")"
5753

5854
clean:
5955
$(RM) $(ARCHIVE_NAME).info $(ARCHIVE_NAME)-*.tar $(ARCHIVE_NAME)-pkg.el README
56+
$(RM) -r elpa

0 commit comments

Comments
 (0)