File: makefile-temp

package info (click to toggle)
bbdb3 3.1.2-7
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,452 kB
  • ctags: 1,103
  • sloc: lisp: 8,515; sh: 552; makefile: 97
file content (203 lines) | stat: -rw-r--r-- 6,891 bytes parent folder | download
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# Cheap BBDB makefile  -*- Makefile -*-
# Copyright (C) 2010-2016 Roland Winkler <winkler@gnu.org>
# 
# This file is part of the Insidious Big Brother Database (aka BBDB),
# 
# BBDB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# BBDB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with BBDB.  If not, see <http://www.gnu.org/licenses/>.

### Commentary:

# This file provides a cheap workaround for (most of) those users
# who like to use the latest BBDB, but do not have autotools installed.
# This file can compile BBDB's lisp code on most systems.  Yet it is not
# intended to be foolproof!
# This file may also come handy for BBDB developers as it knows
# about the proper dependencies of the elisp files, so that it keeps
# the *.elc files consistently up to date.

srcdir = .
prefix = /usr/local
lispdir = $(DESTDIR)/usr/local/share/emacs/site-lisp/bbdb

INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644

RM   = /bin/rm -f
LN_S = /bin/ln -s
CP   = /bin/cp

EMACS = emacs

# Command line flags for Emacs.
EMACSOPT =

# The actual Emacs command run in the targets below.
# --batch implies --no-init-file, yet let's be explicit about what we want
emacs = LC_ALL=C $(EMACS) --batch --no-init-file --no-site-file \
		--directory=./ $(EMACSOPT)
emacs_compile = $(emacs) --funcall batch-byte-compile

# Mu4e is not part of GNU Emacs.  If you want to use BBDB with Mu4e
# then the variable MU4EDIR should point to your mu4e lisp directory.
MU4EDIR =
MU4E = -eval '(unless (string= "$(MU4EDIR)" "") (push "$(MU4EDIR)" load-path))'

# VM is not part of GNU Emacs.  If you want to use BBDB with VM
# then the variable VMDIR should point to your vm/lisp directory.
VMDIR =
VM = -eval '(unless (string= "$(VMDIR)" "") (push "$(VMDIR)" load-path))'

# WL is not part of GNU Emacs.  If you want to use BBDB with WL
# then the variable WLDIR should point to your wl/lisp directory.
WLDIR =
WL = -eval '(unless (string= "$(WLDIR)" "") (push "$(WLDIR)" load-path))'

.SUFFIXES: .elc .el .tar .Z .gz .uu

SRCS =	bbdb.el bbdb-site.el bbdb-com.el bbdb-print.el bbdb-anniv.el \
	bbdb-migrate.el bbdb-snarf.el \
	bbdb-mua.el bbdb-message.el bbdb-rmail.el \
	bbdb-gnus.el bbdb-mhe.el bbdb-mu4e.el bbdb-vm.el bbdb-pgp.el \
	bbdb-sc.el bbdb-wl.el \
	bbdb-ispell.el bbdb-pkg.el

# ELC =	$(patsubst %.el,%.elc,$(SRCS)) # GNU Make
ELC =	bbdb.elc bbdb-site.elc bbdb-com.elc bbdb-print.elc bbdb-anniv.elc \
	bbdb-migrate.elc bbdb-snarf.elc \
	bbdb-mua.elc bbdb-message.elc bbdb-rmail.elc \
	bbdb-gnus.elc bbdb-mhe.elc bbdb-pgp.elc bbdb-sc.elc \
	bbdb-ispell.elc bbdb-wl.elc # bbdb-pkg.elc

all: bbdb

bbdb:	bbdb-loaddefs.el $(ELC)
mu4e:	bbdb-mu4e.elc
vm:	bbdb-vm.elc
wl:	bbdb-wl.elc

bbdb-loaddefs.el: $(SRCS)
#	2011-12-11: We switched from bbdb-autoloads.el to bbdb-loaddefs.el.
#	If the user still has an old bbdb-autoloads.el in the BBDB
#	lisp directory (and keeps loading it from the emacs init file),
#	we might get strange error messages that things fail.
#	So we throw an error if these old files are found.
	@if test -f bbdb-autoloads.el -o -f bbdb-autoloads.elc; then \
	  (echo "*** ERROR: Old file(s) \`bbdb-autoloads.el(c)' found ***" ; \
	  echo "*** Delete these files; do not load them from your init file ***") && \
	  false ; \
	fi
	-$(RM) $@;
	@echo "(provide 'bbdb-loaddefs)" > $@;
	@echo "(if (and load-file-name (file-name-directory load-file-name))" >> $@;
	@echo "    (add-to-list 'load-path (file-name-directory load-file-name)))" >> $@;
	@echo "" >> $@;
#	Generated autoload-file must have an absolute path,
#	$(srcdir) can be relative.
	$(emacs) --load autoload \
		--eval '(setq generated-autoload-file "'`pwd`/$@'")' \
		--eval '(setq make-backup-files nil)' \
		--funcall batch-update-autoloads `pwd`

.el.elc:
	$(emacs_compile) $<

# Not perfect, but better than nothing:  If we do not have / do not use
# autotools, we simply copy bbdb-site.el.in to bbdb-site.el.
bbdb-site.el: bbdb-site.el.in
	$(CP) $< $@
bbdb-site.elc: bbdb-site.el
	$(emacs_compile) $(@:.elc=.el)
bbdb-pkg.el: bbdb-pkg.el.in
	$(CP) $< $@

bbdb.elc: bbdb.el bbdb-site.elc
	$(emacs_compile) $(@:.elc=.el)

bbdb-com.elc: bbdb-com.el bbdb.elc
	$(emacs_compile) $(@:.elc=.el)
bbdb-mua.elc: bbdb-mua.el bbdb-com.elc
	$(emacs) -eval '(unless (string= "$(VMDIR)" "") (push "$(VMDIR)" load-path) (load "vm" t t))' \
	 -eval '(unless (string= "$(MU4EDIR)" "") (push "$(MU4EDIR)" load-path) (load "mu4e" t t))' \
	 -eval '(unless (string= "$(WLDIR)" "") (push "$(WLDIR)" load-path) (load "wl" t t))' \
	 --funcall batch-byte-compile $(@:.elc=.el)
bbdb-rmail.elc: bbdb-rmail.el bbdb-mua.elc
	$(emacs_compile) $(@:.elc=.el)
bbdb-gnus.elc: bbdb-gnus.el bbdb-mua.elc
	$(emacs_compile) $(@:.elc=.el)
bbdb-mhe.elc: bbdb-mhe.el bbdb-mua.elc
	$(emacs_compile) $(@:.elc=.el)
bbdb-mu4e.elc: bbdb-mu4e.el bbdb-mua.elc
	$(emacs) $(MU4E) --funcall batch-byte-compile $(@:.elc=.el)
bbdb-wl.elc: bbdb-wl.el bbdb-mua.elc
	$(emacs_compile) $(@:.elc=.el)
bbdb-vm.elc: bbdb-vm.el bbdb-mua.elc
	$(emacs) $(VM) --funcall batch-byte-compile $(@:.elc=.el)
bbdb-sc.elc: bbdb-sc.el bbdb-mua.elc
	$(emacs_compile) $(@:.elc=.el)

bbdb-print.elc: bbdb-print.el bbdb-com.elc
	$(emacs_compile) $(@:.elc=.el)
bbdb-migrate.elc: bbdb-migrate.el bbdb.elc
	$(emacs_compile) $(@:.elc=.el)
bbdb-anniv.elc: bbdb-anniv.el bbdb-com.elc
	$(emacs_compile) $(@:.elc=.el)
bbdb-ispell.elc: bbdb-ispell.el bbdb.elc
	$(emacs_compile) $(@:.elc=.el)
bbdb-snarf.elc: bbdb-snarf.el bbdb-com.elc
	$(emacs_compile) $(@:.elc=.el)

install-el: all
	$(INSTALL) -d -m 0755 "$(lispdir)/"
	for elc in *.elc; do \
	    el=`basename $$elc c`; \
	    if test -f "$(srcdir)/$$el"; then \
	        echo "Install $$el in $(lispdir)/"; \
	        $(INSTALL_DATA) "${srcdir}/$$el" "$(lispdir)/"; \
	    fi; \
        done;
	for el in bbdb-loaddefs.el; do \
	    echo "Install $$el in $(lispdir)/"; \
	    $(INSTALL_DATA) $$el "$(lispdir)/"; \
        done;

install-elc: all
	$(INSTALL) -d -m 0755 "$(lispdir)/"
	for elc in bbdb-loaddefs.el *.elc; do \
	    echo "Install $$elc in $(lispdir)/"; \
	    $(INSTALL_DATA) $$elc "$(lispdir)/"; \
        done;

uninstall:
	for elc in *.elc; do \
	  $(RM) "$(lispdir)/$$elc"; \
	done
	for el in *.el; do \
	  $(RM) "$(lispdir)/$$el"; \
	done

# Assorted clean-up targets
clean:
	-$(RM) bbdb*.elc TAGS

distclean: clean

maintainer-clean: distclean
	-$(RM) bbdb-loaddefs.el  # Generated file
	-$(RM) Makefile

extraclean: maintainer-clean
	-$(RM) *~ \#*

TAGS: $(SRCS)
	etags $(SRCS)