Skip to content

Commit 596e797

Browse files
committed
Remove dist target hack
This removes quite a bit of Makefile hackery and finally resolves #156.
1 parent b9186db commit 596e797

File tree

1 file changed

+8
-29
lines changed

1 file changed

+8
-29
lines changed

Makefile

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ ELFILES = \
3535

3636
ELCFILES = $(ELFILES:.el=.elc)
3737
AUTOLOADS = haskell-mode-autoloads.el
38-
DIST_FILES = $(ELFILES) $(ELCFILES) $(AUTOLOADS) haskell-mode-pkg.el.in logo.svg Makefile README.md NEWS
39-
DIST_FILES_EX = examples/init.el examples/fontlock.hs examples/indent.hs
40-
DIST_TGZ = haskell-mode-$(GIT_VERSION).tar.gz
4138

4239
PKG_DIST_FILES = $(ELFILES) logo.svg
4340
PKG_TAR = haskell-mode-$(VERSION).tar
@@ -48,7 +45,7 @@ ELCHECKS=$(addprefix check-, $(ELFILES:.el=))
4845
--eval "(byte-compile-disable-warning 'cl-functions)" \
4946
-f batch-byte-compile $<
5047

51-
.PHONY: all compile info dist clean check $(ELCHECKS) elpa package
48+
.PHONY: all compile info clean check $(ELCHECKS) elpa package
5249

5350
all: compile $(AUTOLOADS)
5451

@@ -67,13 +64,10 @@ check: $(ELCHECKS)
6764
@echo "checks passed!"
6865

6966
clean:
70-
$(RM) $(ELCFILES) $(AUTOLOADS) $(AUTOLOADS:.el=.elc) $(DIST_TGZ) $(PKG_TAR)
67+
$(RM) $(ELCFILES) $(AUTOLOADS) $(AUTOLOADS:.el=.elc) $(PKG_TAR)
7168

7269
info: # No Texinfo file, sorry.
7370

74-
# Generate snapshot distribution
75-
dist: $(DIST_TGZ)
76-
7771
# Generate ELPA-compatible package
7872
package: $(PKG_TAR)
7973
elpa: $(PKG_TAR)
@@ -83,7 +77,7 @@ $(PKG_TAR): $(PKG_DIST_FILES) haskell-mode-pkg.el.in
8377
mkdir haskell-mode-$(VERSION)
8478
cp $(PKG_DIST_FILES) haskell-mode-$(VERSION)/
8579
sed -e 's/@VERSION@/$(VERSION)/g' < haskell-mode-pkg.el.in > haskell-mode-$(VERSION)/haskell-mode-pkg.el
86-
sed -e 's/@GIT_VERSION@/$(GIT_VERSION)/g;s/@VERSION@/$(VERSION)/g' < haskell-mode.el > haskell-mode-$(VERSION)/haskell-mode.el #NO_DIST
80+
sed -e 's/@GIT_VERSION@/$(GIT_VERSION)/g;s/@VERSION@/$(VERSION)/g' < haskell-mode.el > haskell-mode-$(VERSION)/haskell-mode.el
8781
tar cvf $@ haskell-mode-$(VERSION)
8882
rm -rf haskell-mode-$(VERSION)
8983
@echo
@@ -95,24 +89,9 @@ $(AUTOLOADS): $(ELFILES) haskell-mode.elc
9589
--eval '(setq generated-autoload-file "$(CURDIR)/$@")' \
9690
-f batch-update-autoloads "."
9791

98-
# embed version number into .elc file
92+
# HACK: embed version number into .elc file
9993
haskell-mode.elc: haskell-mode.el
100-
sed -e 's/@GIT_VERSION@/$(GIT_VERSION)/g;s/@VERSION@/$(VERSION)/g' < haskell-mode.el > haskell-mode.tmp.el #NO_DIST
101-
@$(BATCH) --eval "(byte-compile-disable-warning 'cl-functions)" -f batch-byte-compile haskell-mode.tmp.el #NO_DIST
102-
mv haskell-mode.tmp.elc haskell-mode.elc #NO_DIST
103-
$(RM) haskell-mode.tmp.el #NO_DIST
104-
105-
$(DIST_TGZ): $(DIST_FILES)
106-
rm -rf haskell-mode-$(GIT_VERSION)
107-
mkdir haskell-mode-$(GIT_VERSION)
108-
cp -p $(DIST_FILES) haskell-mode-$(GIT_VERSION)
109-
mkdir haskell-mode-$(GIT_VERSION)/examples
110-
cp -p $(DIST_FILES_EX) haskell-mode-$(GIT_VERSION)/examples
111-
112-
printf "1s/=.*/= $(VERSION)/\nw\n" | ed -s haskell-mode-$(GIT_VERSION)/Makefile #NO_DIST
113-
printf "2s/=.*/= $(GIT_VERSION)/\nw\n" | ed -s haskell-mode-$(GIT_VERSION)/Makefile #NO_DIST
114-
printf "g/NO_DIST/d\nw\n" | ed -s haskell-mode-$(GIT_VERSION)/Makefile #NO_DIST
115-
printf ',s/@VERSION@/$(VERSION)/\nw\n' | ed -s haskell-mode-$(GIT_VERSION)/haskell-mode.el #NO_DIST
116-
117-
tar cvzf $@ haskell-mode-$(GIT_VERSION)
118-
rm -rf haskell-mode-$(GIT_VERSION)
94+
sed -e 's/@GIT_VERSION@/$(GIT_VERSION)/g;s/@VERSION@/$(VERSION)/g' < haskell-mode.el > haskell-mode.tmp.el
95+
@$(BATCH) --eval "(byte-compile-disable-warning 'cl-functions)" -f batch-byte-compile haskell-mode.tmp.el
96+
mv haskell-mode.tmp.elc haskell-mode.elc
97+
$(RM) haskell-mode.tmp.el

0 commit comments

Comments
 (0)