forked from massemanet/distel
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
105 lines (82 loc) · 2.41 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
PACKAGE := distel
VERSION := 4.02
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
datadir = ${prefix}/share
infodir = ${prefix}/info
erlc = erlc
emacs = emacs
ELISP_DIR = ${datadir}/distel/elisp
EBIN_DIR = ${datadir}/distel/ebin
ERL_SRC_DIR = ${datadir}/distel/src
########################################
## Main part
ERL_SRC := $(wildcard src/*.erl)
ERL_OBJ := $(patsubst src/%.erl,ebin/%.beam,${ERL_SRC})
ELISP_SRC := elisp/erlext.el
ELISP_OBJ := $(patsubst %.el,%.elc,${ELISP_SRC})
DOC_SRC := doc/distel.texi
INFO_OBJ := doc/distel.info
PS_OBJ := doc/distel.ps
OBJECTS := ${ERL_OBJ} ${ELISP_OBJ} ${C_OBJ} ${INFO_OBJ} ${PS_OBJ}
base: ebin ${ERL_OBJ} ${ELISP_OBJ} ${C_OBJ}
info: ${INFO_OBJ}
postscript: ${PS_OBJ}
all: base info postscript
ebin:
mkdir ebin
erl: ${ERL_OBJ}
########################################
## Rules
## Erlang
ebin/%.beam: src/%.erl
${erlc} -W -o ebin +debug_info $<
## Elisp
elisp/%.elc: elisp/%.el
${emacs} -batch -f batch-byte-compile $<
## Info documentation
doc/distel.info: ${DOC_SRC}
makeinfo -o $@ $<
## Postscript documentation
doc/distel.ps: doc/distel.dvi
dvips -o $@ $<
doc/distel.dvi: ${DOC_SRC}
(cd doc; texi2dvi distel.texi)
########################################
clean:
-rm -f ${OBJECTS} 2>/dev/null
distclean: clean
-rm -f *~ */*~ 2>/dev/null
install: base
@echo "* Installing Emacs Lisp Library"
install -m 775 -d ${ELISP_DIR} ${EBIN_DIR} ${ERL_SRC_DIR}
install -m 775 elisp/*.el elisp/*.elc ${ELISP_DIR}
@echo
@echo "* Installing Erlang Library"
install -m 775 ebin/*.beam ${EBIN_DIR}
install -m 775 src/*.erl ${ERL_SRC_DIR}
@echo
@echo "*** Successfully installed. See README for usage instructions."
@echo
info_install: info
@echo "* Installing Info documentation"
cp doc/distel.info ${infodir}
# NB: Debian's not-GNU-compatible install-info needs "--section Emacs Emacs"
install-info --info-dir=${infodir} --section Emacs \
${infodir}/distel.info
dist: always distclean
cd .. && ln -sf ${PACKAGE} ${PACKAGE}-${VERSION}
cd .. && (find ${PACKAGE}-${VERSION} -follow -type f | \
egrep -v '(^attic/)|/CVS/|\.cvsignore|\.rej|\.orig|\#' | \
xargs tar czf ${PACKAGE}-${VERSION}.tar.gz)
rm ../${PACKAGE}-${VERSION}
wc:
@echo "* Emacs Lisp"
@wc -l */*.el | sort -nr
@echo "* Erlang"
@wc -l */*.erl | sort -nr
@echo "* C"
@wc -l */*.c | sort -nr
.INTERMEDIATE: doc/distel.dvi
.PHONY: always