-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
executable file
·55 lines (45 loc) · 1.28 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/make
#
# Makefile for GEBEN
EMACS = emacs
CP = cp -p
RM = rm -f
INSTALL = install
.el.elc:
$(EMACS) -Q --batch --eval "(add-to-list 'load-path \".\")" --eval '(byte-compile-file "$<")'
SRCS = dbgp.el geben.el
OBJS = $(SRCS:%.el=%.elc)
IMGDIR = tree-widget/geben
IMGS = $(wildcard $(IMGDIR)/*.png)
GUESS-SITELISP := $(shell $(EMACS) -Q --batch --eval ' \
(let (tbl) \
(mapc (lambda (path) \
(if (string-match "^\\(.*/site-lisp\\)\\b/?" path) \
(let* ((spath (match-string 1 path)) \
(pair (assoc spath tbl))) \
(if pair \
(setcdr pair (1+ (cdr pair))) \
(setq tbl (cons (cons spath 1) tbl)))))) \
load-path) \
(princ (or (car (car (sort tbl (lambda (a b) \
(> (cdr a) (cdr b)))))) \
"")))')
ifndef SITELISP
SITELISP := $(GUESS-SITELISP)
ifeq ($(SITELISP), nil)
$(error Cannot find appropriate site-lisp directory.)
endif
endif
DEST = $(SITELISP)/geben
DEST-IMG = $(DEST)/tree-widget/geben
.PHONY: all
all: $(OBJS)
.PHONY: install
install: all
$(INSTALL) -m 755 -d $(DEST)
$(INSTALL) -m 644 $(SRCS) $(OBJS) $(DEST)
$(INSTALL) -m 755 -d $(DEST-IMG)
$(INSTALL) -m 644 $(IMGS) $(DEST-IMG)
.PHONY: clean
clean:
$(RM) $(OBJS)