Makefile rewrite

This commit is contained in:
Henrik Lissner 2016-03-25 13:37:48 -04:00
parent 8080551cd8
commit 1cb60f0342

View file

@ -1,39 +1,35 @@
EMACS=emacs EMACS=emacs
CACHE_DIR="private/cache/`hostname`/`emacs --version | grep -o '2[0-9]\.[0-9]'`"
REPO_URL="https://github.com/hlissner"
all: update all: update
update: autoloads update: autoloads _update bootstrap.elc
@echo "Updating repo"
@git pull 2>&1 | sed 's/^/ /'
@echo "Updating outdated plugins"
@cask install 2>&1 | sed 's/^/ /'
@cask update 2>&1 | sed 's/^/ /'
@echo "Compiling certain scripts"
@$(EMACS) -Q --batch -f batch-byte-compile bootstrap.el 2>&1 | sed 's/^/ /'
clean: clean-files clean-elc
snippets:
[ -d private/snippets ] || git clone https://github.com/hlissner/emacs-snippets private/snippets
autoloads: autoloads:
@echo "Generating autoloads" @$(EMACS) --script scripts/generate-autoloads.el 2>&1
@$(EMACS) --script scripts/generate-autoloads.el 2>&1 | sed 's/^/ /'
compile: autoloads compile: autoloads bootstrap.elc
@echo "Byte-compiling .emacs.d" @$(EMACS) --batch -f batch-byte-compile 2>&1 {core,modules,modules/contrib,private}/*.el {core,modules}/defuns/*.el
@$(EMACS) --script scripts/byte-compile.el | sed 's/^/ /'
clean-files: snippets:
@echo "Cleaning derelict emacs files" @[ -d private/snippets ] || git clone $(REPO_URL)/emacs-snippets private/snippets
@rm -rf auto-save-list recentf places ido.last async-bytecomp.log elpa tramp
@rm -rf projectile-bookmarks.eld projectile.cache company-statistics-cache.el
@rm -rf var semanticdb anaconda-mode
clean-elc:
@echo "Cleaning *.elc"
@rm -f *.elc {core,modules,private,contrib}/*.elc {core,modules}/lib/*.elc
clean-wg: clean:
@echo "Removing default session" @rm -rf auto-save-list recentf places ido.last async-bytecomp.log elpa tramp projectile-bookmarks.eld projectile.cache company-statistics-cache.el var semanticdb anaconda-mode
@rm -f "private/cache/`hostname`/`emacs --version | grep -o '2[0-9]\.[0-9]'`/wg-default" @rm -f *.elc {core,modules,private,contrib}/*.elc {core,modules}/defuns/*.elc
reset:
@rm -fr $(CACHE_DIR)/{ltxpng,pcache,undo}
@mkdir -p $(CACHE_DIR)/{ltxpng,pcache,undo}
rm -f "$(CACHE_DIR)/workgroups/*"
%.elc: %.el
@$(EMACS) --batch -f batch-byte-compile 2>&1 $<
_update:
@cask update 2>&1
.PHONY: all