Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

81 lines (62 sloc) 2.773 kb
VERSION=$(shell git describe --tags --dirty)
EMACS=emacs
PREFIX=/usr/local
SYSCONFDIR=/etc
ELS=magit.el magit-svn.el magit-topgit.el magit-stgit.el magit-key-mode.el magit-bisect.el
ELS_CONTRIB=contrib/magit-simple-keys.el contrib/magit-classic-theme.el
ELCS=$(ELS:.el=.elc)
ELCS_CONTRIB=$(ELS_CONTRIB:.el=.elc)
DIST_FILES=$(ELS) Makefile magit.texi magit.info README.md magit.spec.in magit-pkg.el.in 50magit.el
DIST_FILES_CONTRIB=$(ELS_CONTRIB) contrib/magit
.PHONY=install
BATCH=$(EMACS) -batch -q -no-site-file -eval \
"(setq load-path (cons (expand-file-name \".\") load-path))"
%.elc: %.el
$(BATCH) --eval '(byte-compile-file "$<")'
all: core docs contrib
core: $(ELCS) magit.spec magit-pkg.el
docs: magit.info
contrib: $(ELCS_CONTRIB)
magit.spec: magit.spec.in
sed -e s/@VERSION@/$(VERSION)/ < $< > $@
magit-pkg.el: magit-pkg.el.in
sed -e s/@VERSION@/$(VERSION)/ < $< > $@
magit.elc: magit.el
sed -e "s/@GIT_DEV_VERSION@/$(VERSION)/" < magit.el > magit.tmp.el #NO_DIST
$(BATCH) --eval '(byte-compile-file "magit.tmp.el")' #NO_DIST
mv magit.tmp.elc magit.elc #NO_DIST
rm magit.tmp.el #NO_DIST
magit-key-mode.elc:
magit-svn.elc:
magit-topgit.elc:
magit-stgit.elc:
magit.info:
dist: magit-$(VERSION).tar.gz
magit-$(VERSION).tar.gz: $(DIST_FILES) $(DIST_FILES_CONTRIB)
mkdir -p magit-$(VERSION)/contrib
cp --preserve=timestamps $(DIST_FILES) magit-$(VERSION)
cp --preserve=timestamps $(DIST_FILES_CONTRIB) magit-$(VERSION)/contrib
sed -i -e "1 s/=.*/=$(VERSION)/" magit-$(VERSION)/Makefile #NO_DIST
sed -i -e "/NO_DIST/d" magit-$(VERSION)/Makefile #NO_DIST
sed -i -e "s/@GIT_DEV_VERSION@/$(VERSION)/" magit-$(VERSION)/magit.el #NO_DIST
tar -cvzf magit-$(VERSION).tar.gz magit-$(VERSION)
rm -rf magit-$(VERSION)
install: install_core install_docs
install_core: core
mkdir -p $(DESTDIR)$(PREFIX)/share/emacs/site-lisp
install -m 644 $(ELS) $(ELCS) $(DESTDIR)$(PREFIX)/share/emacs/site-lisp
sed -i -e "s/@GIT_DEV_VERSION@/$(VERSION)/" $(DESTDIR)$(PREFIX)/share/emacs/site-lisp/magit.el #NO_DIST
mkdir -p $(DESTDIR)$(SYSCONFDIR)/emacs/site-start.d
install -m 644 50magit.el $(DESTDIR)$(SYSCONFDIR)/emacs/site-start.d/50magit.el
install_docs: docs
mkdir -p $(DESTDIR)$(PREFIX)/share/info
install -m 644 magit.info $(DESTDIR)$(PREFIX)/share/info
install-info --info-dir=$(DESTDIR)$(PREFIX)/share/info $(DESTDIR)$(PREFIX)/share/info/magit.info
install_contrib: contrib
mkdir -p $(DESTDIR)$(PREFIX)/share/emacs/site-lisp
install -m 644 $(ELS_CONTRIB) $(ELCS_CONTRIB) $(DESTDIR)$(PREFIX)/share/emacs/site-lisp
mkdir -p $(DESTDIR)$(PREFIX)/bin
install -m 755 contrib/magit $(DESTDIR)$(PREFIX)/bin
install_all: install install_contrib
clean:
rm -fr magit-pkg.el magit.spec magit.info $(ELCS) $(ELCS_CONTRIB) *.tar.gz magit-$(VERSION)
Jump to Line
Something went wrong with that request. Please try again.