diff options
author | 2012-12-05 00:44:09 +0100 | |
---|---|---|
committer | 2012-12-05 00:44:09 +0100 | |
commit | 6278e2e634b05027d31220afd328a9f7fe77c6f1 (patch) | |
tree | 3dbec6a3880ca980694def0d737a477b68254691 /dotfiles.mk | |
parent | fa717d86a07d009ab324a40cd8dbf539e61a9da3 (diff) | |
parent | 15adc911da3f5b527c74b6bb67d677898d6a173e (diff) | |
download | dotfiles-6278e2e634b05027d31220afd328a9f7fe77c6f1.tar.gz dotfiles-6278e2e634b05027d31220afd328a9f7fe77c6f1.zip |
Merge remote-tracking branch 'origin/master' into phoenix
Conflicts:
.emacs.d/site-lisp/oni.el
Diffstat (limited to 'dotfiles.mk')
-rw-r--r-- | dotfiles.mk | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/dotfiles.mk b/dotfiles.mk new file mode 100644 index 0000000..6d33f72 --- /dev/null +++ b/dotfiles.mk @@ -0,0 +1,55 @@ +LOAD_PATH=. /usr/share/emacs/site-lisp $(HOME)/.emacs.d/site-lisp +EMACS=emacs $(addprefix -L ,$(LOAD_PATH)) + +FG_YEL=\033[0;33m +FG_GRE=\033[0;32m +FG_RED=\033[0;31m +CLR_RE=\033[0;00m + +compile = $(EMACS) -Q -batch -eval "(byte-compile-file \"$(1)\")" +define newer = +$(shell if [ "$(1)" -nt "$(DESTDIR)/$(1)" ]; then echo "newer"; fi) +endef + +install-objects=$(addprefix install-,$(objects)) +uninstall-objects=$(addprefix uninstall-,$(objects)) +check-objects=$(addprefix check-,$(objects)) + +install-modules=$(addprefix install-,$(modules)) +uninstall-modules=$(addprefix uninstall-,$(modules)) +check-modules=$(addprefix check-,$(modules)) + +.PHONY: all install uninstall check uninstall $(modules) \ + $(install-objects) $(uninstall-objects) $(check-objects) \ + $(install-modules) $(uninstall-modules) $(check-modules) +all: $(modules) $(objects) +install: $(install-modules) $(install-objects) +check: $(check-modules) $(check-objects) +uninstall: $(uninstall-modules) $(uninstall-objects) + +$(modules): %: + @echo $(MAKEFILES) + @$(MAKE) -C $* + +$(install-objects): install-%: % + $(if $(call newer,$*),install -pDm 644 "$*" "$(DESTDIR)/$*") + +$(install-modules): install-%: + @$(MAKE) -C $* install + +$(uninstall-objects): uninstall-%: + $(if $(call newer,$*),rm -f "$(DESTDIR)/$*") + +$(uninstall-modules): uninstall-%: + @$(MAKE) -C $* uninstall + +$(check-objects): check-%: + @$(if $(call newer,$*), \ + echo -e "$(FG_YEL)$* $(FG_GRE)newer$(CLR_RE)!", \ + echo -e "$(FG_YEL)$* $(FG_RED)not newer$(CLR_RE).") + +$(check-modules): check-%: + @$(MAKE) -C $* check + +$(filter %.elc,$(objects)): %.elc: %.el + $(call compile,$^) |