Makefile 6.98 KB
Newer Older
David Kågedal's avatar
David Kågedal committed
1
# -*- Makefile -*-
Linus Tolke's avatar
Linus Tolke committed
2
# $Id$
3
# Copyright (C) 1991, 1996  Lysator Academic Computer Association.
Linus Tolke's avatar
Linus Tolke committed
4
5
6
7
8
#
# This file is part of the LysKOM server.
# 
# LysKOM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by 
9
# the Free Software Foundation; either version 2, or (at your option) 
Linus Tolke's avatar
Linus Tolke committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# any later version.
# 
# LysKOM 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 LysKOM; see the file COPYING.  If not, write to
# Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
# or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, 
# MA 02139, USA.
#
# Please mail bug reports to bug-lyskom@lysator.liu.se. 
#
25
26
# $Id$
#
Per Cederqvist's avatar
.    
Per Cederqvist committed
27

28

David Byers's avatar
David Byers committed
29
30
31
32
33
34
35
36
37
38
# ======================================================================
# Useful targets: all, lyskom.el lyskom.elc check verbose TAGS release
# clean distclean install
# ======================================================================

#
# NOTE: If you change this file, don't forget to change the distribution 
# makefile too!
#

Joel Rosdahl's avatar
Joel Rosdahl committed
39
CLIENTVERSION = 0.46.1
40
DOCFILES=NEWS-0.46 NEWS-0.46.1
Joel Rosdahl's avatar
Joel Rosdahl committed
41
DEBIANCLIENTVERSION = $(shell echo $(CLIENTVERSION) | tr - .)
42

Kent Engström's avatar
Kent Engström committed
43
44
45
REDHATCLIENTVERSION = $(shell echo $(CLIENTVERSION) | tr - .)
RPMROOT = /usr/src/redhat

David Byers's avatar
David Byers committed
46
FTPDIR=/home/davby/www-pub
47
#REMOTEDIR=sanna.lysator.liu.se:/lysator/ftp/pub/lyskom/elisp-client
David Byers's avatar
David Byers committed
48
#FTPDIR = /usr/ftp/pub/lyskom/elisp-client
David Byers's avatar
David Byers committed
49
50
LISPDIR = /usr/gnu/share/emacs/site-lisp
LANGUAGES = swedish english
51
52
DEFAULTLISPDIR=/usr/local/share/emacs/site-lisp
DEFAULTPREFIX=/usr/local
53

David Byers's avatar
David Byers committed
54
55
SHELL = /bin/sh
RM = /bin/rm -f
David Byers's avatar
David Byers committed
56
EMACS=xemacs
David Byers's avatar
David Byers committed
57
EMACS-BATCH = $(EMACS) -batch
58
59
GENERIC-CLEAN = *~ *.o core
GENERIC-DIST-CLEAN = TAGS
Linus Tolke's avatar
Linus Tolke committed
60

61
62
63
TARGET=lyskom.elc
TARGET-EL=$(TARGET:%.elc=%.el)

64
LANGUAGE-EL=$(LANGUAGES:=-strings.el)
David Byers's avatar
David Byers committed
65
66
67
68
69
SOURCES	 = 	$(LANGUAGE-EL) \
		komtypes.el \
		clienttypes.el \
		deferred-insert.el \
		utilities.el \
70
		completing-read.el \
71
		command.el \
David Byers's avatar
David Byers committed
72
		buffers.el \
73
		aux-items.el \
74
		mime.el \
David Byers's avatar
David Byers committed
75
76
77
78
79
80
81
		prefetch.el \
		startup.el \
		reading.el \
		internal.el \
		services.el \
		parse.el \
		cache.el \
David Byers's avatar
David Byers committed
82
		view-mode.el \
David Byers's avatar
David Byers committed
83
84
85
86
87
88
89
90
91
		commands1.el \
		commands2.el \
		review.el \
		edit-text.el \
		filter.el \
		filter-edit.el \
		lyskom-buttons.el \
		view-text.el \
		async.el \
92
		mship-edit.el \
David Byers's avatar
David Byers committed
93
94
95
96
97
98
99
100
		prioritize.el \
		flags.el \
		messages.el \
		ansaphone.el \
		remote-control.el \
		menus.el slow.el \
		elib-string.el \
		option-edit.el \
David Byers's avatar
David Byers committed
101
		talkback.el \
David Byers's avatar
David Byers committed
102
103
		lyskom-rest.el

David Byers's avatar
David Byers committed
104
105
HEADER = 	header.el \
		defvar.el \
David Byers's avatar
David Byers committed
106
		feature.el \
David Byers's avatar
David Byers committed
107
108
109
110
111
112
		vars.el \
		macros.el \
		compatibility.el \
		language.el

MISC =		envcheck.el \
113
114
		lpath.el \
		autoconf.el
David Byers's avatar
David Byers committed
115

116
117
118
119
DISTFILES =     README \
		COPYING \
		Makefile.in \
		configure.in
David Byers's avatar
David Byers committed
120
121
122
123

DISTSRC = $(DISTFILES:%=distribution-%)
HEADER-ELC = $(HEADER:%.el=%.elc)
SOURCES-ELC = $(SOURCES:%.el=%.elc)
124

Per Cederqvist's avatar
.    
Per Cederqvist committed
125

126
all: $(TARGET)
127

128
vars.el: vars.el.in Makefile
129
	rm -f vars.el
130
131
132
133
134
	if test -d CVS -a x$(DO_RELEASE) = x; then \
		sed "s/@@CLIENTVERSION@@/$(CLIENTVERSION) (from CVS; built `date +%Y-%m-%d`)/g" < vars.el.in > vars.el ; \
	else \
		sed 's/@@CLIENTVERSION@@/$(CLIENTVERSION)/g' < vars.el.in > vars.el ; \
	fi
135
	chmod 444 vars.el
136

David Byers's avatar
David Byers committed
137
138
%.elc: %.el _header.el
	$(EMACS-BATCH)  -l ./lpath.el -l ./_header.el -f batch-byte-compile $<
139

David Byers's avatar
David Byers committed
140
141
_header.el: $(HEADER)
	cat $(HEADER) > _header.el
142
143

fast: $(HEADER-ELC) $(SOURCES-ELC)
144
	cat $(HEADER-ELC) $(SOURCES-ELC) > $(TARGET)
145

146
147
$(TARGET-EL): $(HEADER) $(SOURCES)
	cat $(HEADER) $(SOURCES) > $(TARGET-EL)
148

149
$(TARGET): $(TARGET-EL)
150
	$(EMACS-BATCH) -l ./lpath.el -f batch-byte-compile $(TARGET-EL)
David Kågedal's avatar
David Kågedal committed
151

152
153
check: $(TARGET-EL)
	$(EMACS-BATCH) -l ./lpath.el -l ./$(TARGET-EL)  -l ./check-strings.el \
David Byers's avatar
David Byers committed
154
			-f lyskom-check-strings
155

156
.PHONY: verbose
David Byers's avatar
David Byers committed
157
158
.PHONY: verbose-el

159
verbose: verbose-el $(TARGET)
160

David Byers's avatar
David Byers committed
161
verbose-el: $(HEADER) $(SOURCES)
162
	@echo "Building lyskom.el"
163
	@echo "" > $(TARGET-EL)
David Byers's avatar
David Byers committed
164
165
	@for i in $(HEADER) $(SOURCES) ; do \
		echo '(eval-when-compile (message "Compiling %s" "'$$i'"))' \
166
167
			>> $(TARGET-EL) ;\
		cat $$i >> $(TARGET-EL) ; \
168
169
	done 

Per Cederqvist's avatar
.    
Per Cederqvist committed
170

David Byers's avatar
David Byers committed
171
172
TAGS: $(HEADER) $(SOURCES)
	etags $(HEADER) $(SOURCES)
Per Cederqvist's avatar
.    
Per Cederqvist committed
173

174
175
install: $(TARGET) $(TARGET-EL)
	cp $(TARGET-EL) $(TARGET) $(LISPDIR)
176

177
release: release-files release-move
Joel Rosdahl's avatar
Joel Rosdahl committed
178

179
180
181
182
183
release-files: clean
	$(MAKE) do-release-files DO_RELEASE=1

do-release-files: $(HEADER) $(SOURCES) $(DISTSRC) $(MISC)
	mkdir -p lyskom-$(CLIENTVERSION)
David Byers's avatar
David Byers committed
184
185
	cp $(HEADER) $(SOURCES) $(MISC) lyskom-$(CLIENTVERSION)
	for i in $(DISTFILES) ; do \
186
187
	    sed 's/@@CLIENTVERSION@@/$(CLIENTVERSION)/g' < distribution-$$i \
					> lyskom-$(CLIENTVERSION)/$$i; \
David Byers's avatar
David Byers committed
188
	done
David Byers's avatar
Bugfix    
David Byers committed
189
190
191
	for i in $(DOCFILES) ; do \
		cp ../doc/$$i lyskom-$(CLIENTVERSION)/$$i ; \
	done
192
	sed -e "s/#CLIENTVERSION#/$(CLIENTVERSION)/" -e "s/#REDHATCLIENTVERSION#/$(REDHATCLIENTVERSION)/" <lyskom-elisp-client.spec >lyskom-$(CLIENTVERSION)/lyskom-elisp-client-$(REDHATCLIENTVERSION).spec
193
194
195
196
	( cd lyskom-$(CLIENTVERSION); \
	autoconf ; \
	./configure --prefix=$(DEFAULTPREFIX) --with-lispdir=$(DEFAULTLISPDIR) ; \
	make lyskom-$(CLIENTVERSION).el )
David Byers's avatar
David Byers committed
197
	chmod -R u+rw,g+r,o+r lyskom-$(CLIENTVERSION)
David Byers's avatar
David Byers committed
198
199
	tar cvf lyskom-$(CLIENTVERSION).tar lyskom-$(CLIENTVERSION)
	gzip -9 lyskom-$(CLIENTVERSION).tar
200
	zip -R9y lyskom-$(CLIENTVERSION).zip 'lyskom-$(CLIENTVERSION)/*'
Joel Rosdahl's avatar
Joel Rosdahl committed
201

202
203
204
205
206
207
208
release-move: 
	if [ ! -z "$(REMOTEDIR)" ] ; then \
	    scp lyskom-$(CLIENTVERSION).tar.gz $(REMOTEDIR); \
	    scp lyskom-$(CLIENTVERSION).zip $(REMOTEDIR); \
	else \
		echo "Kopierade inte release-filerna till remote-system." ; \
	fi
Joel Rosdahl's avatar
Joel Rosdahl committed
209
210
	if [ -d $(FTPDIR) ]; then \
		mv lyskom-$(CLIENTVERSION).tar.gz $(FTPDIR) ; \
211
		mv lyskom-$(CLIENTVERSION).zip $(FTPDIR) ; \
Joel Rosdahl's avatar
Joel Rosdahl committed
212
213
214
215
	else \
		echo "Flyttade inte release-filerna till $(FTPDIR)." ; \
	fi

216
debian-package: release-files debian-build
Joel Rosdahl's avatar
Joel Rosdahl committed
217
218
219
220

debian-build: release-files
	cp -R debian lyskom-$(CLIENTVERSION)
	$(RM) -rf lyskom-$(CLIENTVERSION)/debian/CVS
Joel Rosdahl's avatar
Joel Rosdahl committed
221
	sed '1s/(.*)/($(DEBIANCLIENTVERSION)-1)/' <debian/changelog >lyskom-$(CLIENTVERSION)/debian/changelog
222
	sed 's/@@CLIENTVERSION@@/$(CLIENTVERSION)/g' <debian/rules >lyskom-$(CLIENTVERSION)/debian/rules
Joel Rosdahl's avatar
Joel Rosdahl committed
223
224
225
	mv lyskom-$(CLIENTVERSION) lyskom-elisp-client-$(DEBIANCLIENTVERSION)
	cp lyskom-$(CLIENTVERSION).tar.gz lyskom-elisp-client_$(DEBIANCLIENTVERSION).orig.tar.gz
	cd lyskom-elisp-client-$(DEBIANCLIENTVERSION) && dpkg-buildpackage
226

227
redhat-packages: release-files redhat-build
Kent Engström's avatar
Kent Engström committed
228
229
230
231
232

redhat-build: release-files
	cp lyskom-$(CLIENTVERSION).tar.gz $(RPMROOT)/SOURCES/
	sed -e "s/#CLIENTVERSION#/$(CLIENTVERSION)/" -e "s/#REDHATCLIENTVERSION#/$(REDHATCLIENTVERSION)/" <lyskom-elisp-client.spec >$(RPMROOT)/SPECS/lyskom-elisp-client-$(REDHATCLIENTVERSION).spec
	rpm -ba $(RPMROOT)/SPECS/lyskom-elisp-client-$(REDHATCLIENTVERSION).spec
233

234
clean:
235
	$(RM) *.el.gz *.elc.gz $(TARGET-EL)
David Byers's avatar
David Byers committed
236
237
	$(RM) -rf lyskom-$(CLIENTVERSION) \
		  lyskom-$(CLIENTVERSION).tar \
Joel Rosdahl's avatar
Joel Rosdahl committed
238
		  lyskom-$(CLIENTVERSION).tar.gz \
239
		  lyskom-$(CLIENTVERSION).zip \
Joel Rosdahl's avatar
Joel Rosdahl committed
240
		  lyskom-elisp-client-$(DEBIANCLIENTVERSION)
241
	$(RM) vars.el *.elc $(GENERIC-CLEAN)
242
243
	$(RM) -r build-stamp lyskom-elisp-client*.gz lyskom-elisp-client*.deb \
		lyskom-elisp-client*.dsc lyskom-elisp-client*.changes