-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (37 loc) · 1.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cwd := $(shell pwd)
emacs ?= emacsclient
emacsflags := -q -a ''
version := $(shell date +%s)
tar_version := $(version).0
package := discover-my-major-$(tar_version).tar
pkg := discover-my-major-pkg.el
sources := $(filter-out %-pkg.el, $(wildcard *.el))
tar = $(cwd)/$(shell ls -t *.tar | head -1)
all: package
package : $(package)
$(package) : $(sources) $(pkg)
@echo
@echo Creating the package for package.el...
@rm -f *.tar
@rm -rf discover-my-major-*/
@mkdir -p discover-my-major-$(tar_version)
@cp -f $(sources) $(pkg) discover-my-major-$(tar_version)
@tar cf $(package) discover-my-major-$(tar_version)
@rm -rf discover-my-major-$(tar_version)
@rm -f $(pkg)
@echo \"$(package)\" created.
@echo
install : package
@echo
@echo Installing the Emacs package...
@$(emacs) $(emacsflags) --eval '(package-install-file "$(tar)")'
@echo
@echo \"$(tar)\" installed.
@echo
$(pkg) : $(sources)
@echo
@echo Creating the pkg file...
@rm -f $(pkg)
@echo \(define-package \"discover-my-major\" \"$(version)\" \"Discover key bindings and their meaning for the current Emacs major mode\" \'\(\(makey \"0.2\"\)\)\) > $(pkg)
@echo \"$(pkg)\" created.
@echo