Makefile
author Oleksandr Gavenko <gavenkoa@gmail.com>
Thu, 28 Jan 2010 20:01:05 +0200
changeset 267 55541cafde9d
parent 261 16b1f9a3ee99
child 268 b2cd8fbe5ec3
permissions -rw-r--r--
As template-post removed dont install them.

# Copyright (C) 2008 by Oleksandr Gavenko <gavenkoa@gmail.com>

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

.PHONY: all
all: install

.PHONY: install
install: preinstall update-dot-emacs-pre

.PHONY: preinstall
preinstall: .emacs .emacs-my .emacs-pre .emacs-post
	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

.PHONY: install-all
install-all: preinstall-all update-dot-emacs-pre

.PHONY: preinstall-all
preinstall-all: .emacs .emacs-my .emacs-pre .emacs-post
	for file in $^; do \
		cp $$file $(HOME)/$$file; \
	done

.PHONY: update-dot-emacs-pre
update-dot-emacs-pre:
	printf ";; DO NOT EDIT! This file automatically generated.\n\n" >$(HOME)/.emacs-pre-auto
	for file in `cd template-pre; ls *.el`; do \
		cat template-pre/$$file >>$(HOME)/.emacs-pre-auto; \
	done

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

.PHONY: distclean
distclean: clean

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