--- a/Makefile Tue Sep 08 12:10:17 2009 +0300
+++ b/Makefile Mon Sep 14 12:16:12 2009 +0300
@@ -4,22 +4,46 @@
$(error Home env var not set!)
endif
-.PHONY: all install install-all
+.PHONY: all install preinstall install-all preinstall-all update-dot-emacs-pre update-dot-emacs-post
all: install
-install: .emacs .emacs-my .emacs-pre .emacs-post
+install: preinstall update-dot-emacs-pre update-dot-emacs-post
+
+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
-install-all: .emacs .emacs-my .emacs-pre .emacs-post
+install-all: preinstall-all update-dot-emacs-pre update-dot-emacs-post
+
+preinstall-all: .emacs .emacs-my .emacs-pre .emacs-post
for file in $^; do \
cp $$file $(HOME)/$$file; \
done
+update-dot-emacs-pre:
+ for file in `cd template-pre; ls *.el`; do \
+ tag=$${file%.el}; \
+ if grep "DO NOT EDIT COMMENT! TAG: $$tag" $(HOME)/.emacs-pre; then \
+ :; \
+ else \
+ cat template-pre/$$file >>$(HOME)/.emacs-pre; \
+ fi; \
+ done
+
+update-dot-emacs-post:
+ for file in `cd template-post; ls *.el`; do \
+ tag=$${file%.el}; \
+ if grep "DO NOT EDIT COMMENT! TAG: $$tag" $(HOME)/.emacs-post; then \
+ :; \
+ else \
+ cat template-post/$$file >>$(HOME)/.emacs-post; \
+ fi; \
+ done
+
dist-tar:
tar cf dot-emacs.tar .emacs .emacs-my