Makefile 5.38 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!
#

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

David Byers's avatar
David Byers committed
43
44
FTPDIR=/home/davby/www-pub
#FTPDIR = /usr/ftp/pub/lyskom/elisp-client
David Byers's avatar
David Byers committed
45
46
LISPDIR = /usr/gnu/share/emacs/site-lisp
LANGUAGES = swedish english
47

David Byers's avatar
David Byers committed
48
49
SHELL = /bin/sh
RM = /bin/rm -f
David Byers's avatar
David Byers committed
50
EMACS=xemacs
David Byers's avatar
David Byers committed
51
EMACS-BATCH = $(EMACS) -batch
52
53
GENERIC-CLEAN = *~ *.o core
GENERIC-DIST-CLEAN = TAGS
Linus Tolke's avatar
Linus Tolke committed
54

55
56
57
TARGET=lyskom.elc
TARGET-EL=$(TARGET:%.elc=%.el)

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

HEADER = 	defvar.el \
David Byers's avatar
David Byers committed
98
		feature.el \
David Byers's avatar
David Byers committed
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
		vars.el \
		macros.el \
		compatibility.el \
		language.el

MISC =		envcheck.el \
		lpath.el

DISTFILES =     Makefile \
		README \
		COPYING

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

Per Cederqvist's avatar
.    
Per Cederqvist committed
115

116
all: $(TARGET)
117

118
vars.el: vars.el.in Makefile
119
	rm -f vars.el
120
	sed 's/@@CLIENTVERSION@@/$(CLIENTVERSION)/' < vars.el.in > vars.el
121
	chmod 444 vars.el
122

123
%.elc: %.el header.el
124
	$(EMACS-BATCH)  -l ./lpath.el -l ./header.el -f batch-byte-compile $<
125
126
127
128
129

header.el: $(HEADER)
	cat $(HEADER) > header.el

fast: $(HEADER-ELC) $(SOURCES-ELC)
130
	cat $(HEADER-ELC) $(SOURCES-ELC) > $(TARGET)
131

132
133
$(TARGET-EL): $(HEADER) $(SOURCES)
	cat $(HEADER) $(SOURCES) > $(TARGET-EL)
134

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

138
139
check: $(TARGET-EL)
	$(EMACS-BATCH) -l ./lpath.el -l ./$(TARGET-EL)  -l ./check-strings.el \
David Byers's avatar
David Byers committed
140
			-f lyskom-check-strings
141

142
.PHONY: verbose
David Byers's avatar
David Byers committed
143
144
.PHONY: verbose-el

145
verbose: verbose-el $(TARGET)
146

David Byers's avatar
David Byers committed
147
verbose-el: $(HEADER) $(SOURCES)
148
	@echo "Building lyskom.el"
149
	@echo "" > $(TARGET-EL)
David Byers's avatar
David Byers committed
150
151
	@for i in $(HEADER) $(SOURCES) ; do \
		echo '(eval-when-compile (message "Compiling %s" "'$$i'"))' \
152
153
			>> $(TARGET-EL) ;\
		cat $$i >> $(TARGET-EL) ; \
154
155
	done 

Per Cederqvist's avatar
.    
Per Cederqvist committed
156

David Byers's avatar
David Byers committed
157
158
TAGS: $(HEADER) $(SOURCES)
	etags $(HEADER) $(SOURCES)
Per Cederqvist's avatar
.    
Per Cederqvist committed
159

160
161
install: $(TARGET) $(TARGET-EL)
	cp $(TARGET-EL) $(TARGET) $(LISPDIR)
162

Joel Rosdahl's avatar
Joel Rosdahl committed
163
164
release: release-files release-cleanup release-move

165
release-files: $(HEADER) $(SOURCES) $(DISTSRC) $(MISC) $(TARGET-EL)
David Byers's avatar
David Byers committed
166
167
168
169
170
	mkdir lyskom-$(CLIENTVERSION)
	cp $(HEADER) $(SOURCES) $(MISC) lyskom-$(CLIENTVERSION)
	for i in $(DISTFILES) ; do \
		cp distribution-$$i lyskom-$(CLIENTVERSION)/$$i ; \
	done
David Byers's avatar
Bugfix    
David Byers committed
171
172
173
	for i in $(DOCFILES) ; do \
		cp ../doc/$$i lyskom-$(CLIENTVERSION)/$$i ; \
	done
David Byers's avatar
David Byers committed
174
	chmod -R u+rw,g+r,o+r lyskom-$(CLIENTVERSION)
David Byers's avatar
David Byers committed
175
176
	tar cvf lyskom-$(CLIENTVERSION).tar lyskom-$(CLIENTVERSION)
	gzip -9 lyskom-$(CLIENTVERSION).tar
Joel Rosdahl's avatar
Joel Rosdahl committed
177
178
179
180
181
182
183

release-cleanup:
	$(RM) -rf lyskom-$(CLIENTVERSION) lyskom-elisp-client-$(DEBIANCLIENTVERSION)

release-move: release-files
	if [ -d $(FTPDIR) ]; then \
		mv lyskom-$(CLIENTVERSION).tar.gz $(FTPDIR) ; \
184
		mv $(TARGET-EL) $(FTPDIR)/lyskom-$(CLIENTVERSION).el ; \
Joel Rosdahl's avatar
Joel Rosdahl committed
185
186
187
188
189
190
191
192
193
194
195
196
197
	else \
		echo "Flyttade inte release-filerna till $(FTPDIR)." ; \
	fi

debian-package: release-files debian-build release-cleanup

debian-build: release-files
	cp -R debian lyskom-$(CLIENTVERSION)
	$(RM) -rf lyskom-$(CLIENTVERSION)/debian/CVS
	perl -pi -e 's/\((.+)\)/($(DEBIANCLIENTVERSION)-1)/ if (1..1)' lyskom-$(CLIENTVERSION)/debian/changelog
	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
198

199
clean:
200
	$(RM) *.el.gz *.elc.gz $(TARGET-EL)
David Byers's avatar
David Byers committed
201
202
	$(RM) -rf lyskom-$(CLIENTVERSION) \
		  lyskom-$(CLIENTVERSION).tar \
Joel Rosdahl's avatar
Joel Rosdahl committed
203
204
		  lyskom-$(CLIENTVERSION).tar.gz \
		  lyskom-elisp-client-$(DEBIANCLIENTVERSION)
205
	$(RM) *~ *.elc $(GENERIC-CLEAN)
Joel Rosdahl's avatar
Joel Rosdahl committed
206
	$(RM) -r build-stamp lyskom-elisp-client*
Per Cederqvist's avatar
.    
Per Cederqvist committed
207

Linus Tolke's avatar
Linus Tolke committed
208
distclean: clean
209
	$(RM) $(GENERIC-DIST-CLEAN) vars.el