Makefile
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 07 Mar 2010 10:58:13 +0200
changeset 323 7a7dc2befa99
parent 318 6a430707c23e
child 379 271ed5d61644
permissions -rw-r--r--
Because of Debian policy documentation covered by FDL license with invariant sections not allowed in packet repository tree. So it must be installed manually. My usually configuration install user local software into ~/usr DISTDIR.

# Copyright (C) 2008-2010 by Oleksandr Gavenko <gavenkoa@gmail.com>
#
# You can do anything with this file without any warranty.

ifeq '' '$(HOME)'
  $(error Home env var not set!)
endif

FILES_MODE_EL := $(wildcard *-mode.el)

.PHONY: all
all: install

.PHONY: install-all
install-all: install
	cp .emacs-pre $(HOME)/.emacs-pre
	cp .emacs-post $(HOME)/.emacs-post

.PHONY: install
install: .emacs .emacs-my .emacs-pre .emacs-post $(FILES_MODE_EL)
	for file in .emacs-pre .emacs-post; do \
		if [ ! -f $(HOME)/$$file ]; then cp $$file $(HOME)/$$file; fi; \
	done
	cp .emacs $(HOME)/.emacs
	cp .emacs-my $(HOME)/.emacs-my
	rm -f -r $(HOME)/.emacs.d/my-lisp
	mkdir -p $(HOME)/.emacs.d/my-lisp
	for file in $(FILES_MODE_EL); do \
		cp -f $$file $(HOME)/.emacs.d/my-lisp; \
	done
	emacs --batch \
		--eval='(let ( (generated-autoload-file "~/.emacs.d/my-lisp/autoload-my.el") ) (update-directory-autoloads "~/.emacs.d/my-lisp") )'

.PHONY: uninstall
uninstall:
	@echo !!! Nothing done !!!

.PHONY: tar
tar:
	tar cf dot-emacs.tar .emacs .emacs-my

.PHONY: distclean
distclean: clean

.PHONY: clean
clean:
	rm -f dot-emacs.tar