Skip to content

Commit 8d3edf5

Browse files
committed
Reimplement 'make dist' target for git repository
1 parent ae7cee0 commit 8d3edf5

File tree

1 file changed

+18
-30
lines changed

1 file changed

+18
-30
lines changed

Makefile

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
VERSION = $(shell git describe --tags --dirty | sed 's/_/\./g')
12
EMACS = emacs
2-
BATCH = $(EMACS) --batch -Q
3+
EFLAGS =
4+
BATCH = $(EMACS) $(EFLAGS) --batch -Q -L .
35

46
ELFILES = \
57
haskell-c.el \
@@ -31,10 +33,12 @@ ELFILES = \
3133
ELCFILES = $(ELFILES:.el=.elc)
3234
# AUTOLOADS = $(PACKAGE)-startup.el
3335
AUTOLOADS = haskell-site-file.el
36+
DIST_FILES = $(ELFILES) $(ELCFILES) $(AUTOLOADS) logo.svg Makefile README.md
37+
DIST_FILES_EX = examples/init.el examples/fontlock.hs examples/indent.hs
38+
TGZ = haskell-mode-$(VERSION).tar.gz
3439

3540
%.elc: %.el
36-
$(BATCH) --eval '(setq load-path (cons "." load-path))' \
37-
-f batch-byte-compile $<
41+
@$(BATCH) -f batch-byte-compile $<
3842

3943
.PHONY: all compile info dist clean
4044

@@ -43,37 +47,21 @@ all: compile $(AUTOLOADS)
4347
compile: $(ELCFILES)
4448

4549
clean:
46-
$(RM) $(ELCFILES) $(AUTOLOADS)
50+
$(RM) $(ELCFILES) $(AUTOLOADS) $(TGZ)
4751

48-
info:
49-
# No Texinfo file, sorry.
52+
info: # No Texinfo file, sorry.
5053

51-
######################################################################
52-
### don't look below ###
53-
######################################################################
54-
55-
PACKAGE=haskell-mode
54+
dist: $(TGZ)
5655

5756
$(AUTOLOADS): $(ELFILES)
5857
[ -f $@ ] || echo ' ' >$@
5958
$(BATCH) --eval '(setq generated-autoload-file "'`pwd`'/$@")' -f batch-update-autoloads "."
6059

61-
##
62-
63-
VERSION = $(shell darcs show tags | head -n 1)
64-
TAG = $(shell echo v$(VERSION) | sed 's/\./\\\./g')
65-
TMP = $(shell echo $(PACKAGE)-$(VERSION))
66-
67-
dist:
68-
darcs get --lazy . $(TMP) &&\
69-
cd $(TMP) &&\
70-
rm -r _darcs &&\
71-
sed -i 's/\$$Name: \$$/$(TAG)/g' * &&\
72-
make $(AUTOLOADS) &&\
73-
rm *~ &&\
74-
darcs changes > ChangeLog &&\
75-
rm Makefile &&\
76-
cd .. &&\
77-
tar czf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) &&\
78-
rm -rf $(PACKAGE)-$(VERSION) &&\
79-
mv $(PACKAGE)-$(VERSION).tar.gz ../haskellmode-emacs-web/
60+
$(TGZ): $(DIST_FILES)
61+
rm -rf haskell-mode-$(VERSION)
62+
mkdir haskell-mode-$(VERSION)
63+
cp -p $(DIST_FILES) haskell-mode-$(VERSION)
64+
mkdir haskell-mode-$(VERSION)/examples
65+
cp -p $(DIST_FILES_EX) haskell-mode-$(VERSION)/examples
66+
tar cvzf $(TGZ) haskell-mode-$(VERSION)
67+
rm -rf haskell-mode-$(VERSION)

0 commit comments

Comments
 (0)