-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
305 lines (276 loc) · 12.5 KB
/
Makefile.in
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
#
# $Id: Makefile.in,v 1.26 2002/02/19 14:27:15 cssbz Exp $
#
SHELL=/bin/sh
# configure will replace the following non-comment line with 'MAKE=make' if
# the make utility being used does not support $(MAKE) (!).
# The $(MAKE) macro is used to recursively call make (see the 'clean' target
# for an example).
@SET_MAKE@
CC = @CC@
CPPFLAGS = @CPPFLAGS@
INSTALL = install
LDFLAGS = @LDFLAGS@
TCL_LIB = @TCL_LIB@
TK_LIB = @TK_LIB@
CURSES_LIB = @CURSES_LIB@
CURSES_LIB_PATH = @CURSES_LIB_PATH@
READLINE_LIB = @READLINE_LIB@
LIBS = @LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
X_LIBS = @X_LIBS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
AW_X_LIBS = @AW_X_LIBS@
DMALLOC_LIB = @DMALLOC_LIB@
OPENGL_LIB = @OPENGL_LIB@
PNG_LIB = @PNG_LIB@
EMBEDDEDTCLTKFRAMEWORKS = @EMBEDDEDTCLTKFRAMEWORKS@
ICON_OBJS = @ICON_OBJS@
# !@!@ This still needs installation and distribution targets. Perhaps also
# make depends.
########################################################################
# Add any C compiler options that *must* be used at the start of the
# definition here, so the user is free to define CFLAGS and override
# any of our settings
ALLCFLAGS = $(CFLAGS)
EDENOBJS = Eden/libeden.a pcre-3.9/pcre.o
MISCOBJS = Misc/libmisc.a
DONALDOBJS = Donald/libdonald.a
EXOBJS = EX/libex.a
SCOUTOBJS = Scout/libscout.a
LSDOBJS = LSD/liblsd.a
SASAMIOBJS = Sasami/libsasami.a
DOSTEOBJS = DOSTE/libdoste.a
TKEDENOBJS = $(EDENOBJS) $(MISCOBJS) $(DONALDOBJS) $(SASAMIOBJS) $(EXOBJS) \
$(SCOUTOBJS) $(ICON_OBJS)
DTKEDENOBJS = $(EDENOBJS) $(MISCOBJS) $(DONALDOBJS) $(SASAMIOBJS) $(EXOBJS) \
$(SCOUTOBJS) $(LSDOBJS)
TTYEDENOBJS = $(EDENOBJS) $(MISCOBJS)
default: help
# NB action lines that start with '@' prevent make from printing the action
# as it is performed.
help::
@echo "Compiling a tkeden variant:"
@echo "Use make tkeden, make dtkeden or make ttyeden."
@echo "Important note: do make clean between making variants."
@echo ""
# on every build, record the working copy revision string
# the following is modified from the Subversion FAQ at
# http://subversion.tigris.org/faq.html#version-value-in-source
# FORCE is explained at
# http://www.gnu.org/software/make/manual/html_node/make_38.html
# "$?" is the exit status of the last command: I am using it here to
# detect if the svnversion command failed, and output something detectably
# messed up to svnversion.h.
#
# Note below that "${NAME}" is expanded by make, and that
# "$${NAME}" is expanded by sh (which is run by make). The major part of
# the rule is effectively all one line (with \ characters at the end of lines)
# so that environment variable settings can be reused on later lines. (make
# invokes each separate line in a separate shell.)
svnversion.h: FORCE
@SVNVER=`svnversion -n .`; \
if [ "$$?" != "0" ]; then \
echo "#define EDEN_SVNVERSION \"r???\"" > svnversion.h; \
else \
echo "#define EDEN_SVNVERSION \"r$${SVNVER}\"" > svnversion.h; \
fi;
FORCE:
# tkeden uses Tcl, Tk and X but doesn't use curses
# Note: double colon used here with no dependencies to always force these
# actions to be performed.
# Note: the link line must be in this order - for item A to be able to
# reference item B, they must be specified in the order A B.
# OPENGL_LIB must come before X_LIBS if we are to get the specified GL lib.
tkeden:: svnversion.h
cd Eden; VARIANT=TKEDEN $(MAKE) libeden.a
cd Misc; VARIANT=TKEDEN $(MAKE) libmisc.a
cd Donald; VARIANT=TKEDEN $(MAKE) libdonald.a
cd EX; VARIANT=TKEDEN $(MAKE) libex.a
cd Scout; VARIANT=TKEDEN $(MAKE) libscout.a
cd Sasami; VARIANT=TKEDEN $(MAKE) libsasami.a
# cd DOSTE; VARIANT=TKEDEN $(MAKE) libdoste.a
$(CC) -o $@ $(ALLCFLAGS) $(LDFLAGS) $(TKEDENOBJS) $(TK_LIB) $(TCL_LIB) $(OPENGL_LIB) $(X_LIBS) $(X_PRE_LIBS) $(PNG_LIB) $(AW_X_LIBS) $(X_EXTRA_LIBS) $(LIBS) $(DMALLOC_LIB) nothing.c
# dtkeden uses Tcl, Tk and X but doesn't use curses (same as tkeden)
# Almost all the code needs compiling specially with -DDISTRIB, except the
# code in Misc. Additionally, LSD must be made.
dtkeden:: svnversion.h
cd Eden; VARIANT=DISTRIB $(MAKE) libeden.a
cd Misc; VARIANT=DISTRIB $(MAKE) libmisc.a
cd Donald; VARIANT=DISTRIB $(MAKE) libdonald.a
cd EX; VARIANT=DISTRIB $(MAKE) libex.a
cd Scout; VARIANT=DISTRIB $(MAKE) libscout.a
cd LSD; VARIANT=DISTRIB $(MAKE) liblsd.a
cd Sasami; VARIANT=DISTRIB $(MAKE) libsasami.a
$(CC) -o $@ $(ALLCFLAGS) $(LDFLAGS) $(DTKEDENOBJS) $(TK_LIB) $(TCL_LIB) $(OPENGL_LIB) $(X_LIBS) $(X_PRE_LIBS) $(PNG_LIB) $(AW_X_LIBS) $(X_EXTRA_LIBS) $(LIBS) $(DMALLOC_LIB) nothing.c
# ttyeden uses curses and readline, but not Tcl, Tk or X
ttyeden:: svnversion.h
cd Eden; VARIANT=TTYEDEN $(MAKE) libeden.a
cd Misc; VARIANT=TTYEDEN $(MAKE) libmisc.a
$(CC) -o $@ $(ALLCFLAGS) $(LDFLAGS) $(TTYEDENOBJS) $(CURSES_LIB_PATH) $(READLINE_LIB) $(CURSES_LIB) $(LIBS) $(DMALLOC_LIB) nothing.c
DIRS = Eden Misc EX Scout Donald LSD Sasami
# create the generated sources (using bison etc)...
generate::
TOP=`pwd`; \
for DIR in $(DIRS); do cd $$TOP/$$DIR; \
$(MAKE) INHIBIT_DEPEND=y generate; done
# clean and reallyclean do not remove the compiled executables
# ttyeden, tkeden etc, as the new system requires the compiler to do a
# 'make clean' between making variants.
clean::
TOP=`pwd`; \
for DIR in $(DIRS); do cd $$TOP/$$DIR; \
$(MAKE) INHIBIT_DEPEND=y clean; done
# reallyclean removes the generated (by bison etc) sources as well
# (note that generated sources shouldn't be checked in to SVN)
reallyclean::
TOP=`pwd`; \
for DIR in $(DIRS); do cd $$TOP/$$DIR; \
$(MAKE) INHIBIT_DEPEND=y reallyclean; done
# Create a totally clean source directory that someone would want to
# receive :). Leave the platform-independent generated sources in,
# though (so the receiver doesn't have to have bison etc).
# NB action lines that start with '-' cause make to ignore any errors
# resulting from the action.
maintainerclean::
TOP=`pwd`; \
for DIR in $(DIRS); do cd $$TOP/$$DIR; \
$(MAKE) INHIBIT_DEPEND=y clean; rm Makefile; done
-rm -r tkeden ttyeden dtkeden tkeden.exe dtkeden.exe \
tkeden*.app \
config.cache config.log \
config.status config.h cscope.out Makefile \
core Windist eden-* generic.mk */cscope.out \
a.out.dSYM autom4te.cache \
*~ */*~ */*.d */TAGS
@echo ""
@echo "Suggest you check the list in MAKING.A.RELEASE"
@echo ""
# Make all the .d (dependency) files. TKEDEN is the most common case:
# avoiding using DISTRIB as it causes problems if making tkeden.
depend::
TOP=`pwd`; \
for DIR in $(DIRS); do cd $$TOP/$$DIR; \
VARIANT=TKEDEN $(MAKE) INHIBIT_DEPEND=y depend; done
# To make an application for Mac OS X, we need to make a "bundle" or
# "package": a directory containing the binary, lib-tkeden and some
# informational XML files. The ProjectBuilder application can be used
# to do this, and in fact the template tkeden.app directory which is
# used below was created with ProjectBuilder, but I'd rather keep the
# build process as it is on other platforms, using this Makefile.
#
# Including a version number with a decimal point in the name makes
# the Finder display the .app extension (vis tkeden1.55.app vs
# tkeden.app) and also means that hdiutil creates disk images that
# have names up to the first dot (eg tkeden1). I "fix" this here
# by changing the decimal point to a hyphen... this might cause some
# confusion, but probably best choice overall...
#
# This "macapp" target makes an application that will run on this machine.
# To make an application that can be transported to another machine (eg
# with no dependencies on shared libraries), see the "macdist" target.
#
# Note: if Info.plist contains a reference to dtkeden, and dtkeden isn't
# inside the bundle (eg you didn't compile it), you will get an error "You
# can't open the application (appname) because it may be damaged
# or incomplete."
macapp::
@VERSION=`grep '#define TKEDEN_VERSION ' version.h | \
awk -F'"' '{print $$2}' | sed 's/\./-/'`; \
echo "Version is $${VERSION}..."; \
chmod -R +w "tkeden$$VERSION.app" 2>/dev/null; \
rm -rf "tkeden$$VERSION.app" 2>/dev/null; \
rm "tkeden$${VERSION}.dmg" 2>/dev/null; \
mkdir -p "tkeden$$VERSION.app/Contents/MacOS"; \
mkdir -p "tkeden$$VERSION.app/Contents/Resources/lib-tkeden"; \
cp -p tkeden "tkeden$$VERSION.app/Contents/MacOS/"; \
cp -pR lib-tkeden/* "tkeden$$VERSION.app/Contents/Resources/lib-tkeden/"; \
rm -rf "tkeden$$VERSION.app/Contents/Resources/lib-tkeden/gel/.svn"; \
cp -p htmlwidget-bld/tkhtml.dylib "tkeden$$VERSION.app/Contents/Resources/lib-tkeden/gel/"; \
cp -p MacOSX/tkeden.icns "tkeden$$VERSION.app/Contents/Resources/"; \
cp -p MacOSX/tkeden.app/Contents/PkgInfo "tkeden$$VERSION.app/Contents/"; \
sed -e "s/TKEDENVERSION/$$VERSION (r`svnversion -n .`)/g" \
-e "s/THISYEAR/`date +%Y`/g" \
MacOSX/tkeden.app/Contents/Info.plist \
> "tkeden$$VERSION.app/Contents/Info.plist"; \
chmod -R go+rX "tkeden$$VERSION.app/"; \
echo "Made tkeden$$VERSION.app.";
# This version of the macdist target is massively simplified compared to the previous,
# which I can't get working (Sep 2010). The previous version involved making "embedded"
# versions of the Tcl/Tk frameworks, then copying those into the tkeden(version).app
# bundle, and modifying the tkeden executable to use them. However, as I can't get this
# working again, actually it seems we can leave the tkeden binary to use the default
# Tcl/Tk frameworks (ie the ones bundled with Mac OS X) and this seems to work, on 10.5
# and 10.6. Therefore, just compress tkeden(version).app into a DMG for
# distribution. [Ash]
macdist::
@VERSION=`grep '#define TKEDEN_VERSION ' version.h | \
awk -F'"' '{print $$2}' | sed 's/\./-/'`; \
echo "Version is $${VERSION}..."; \
cp -p ttyeden "ttyeden$${VERSION}"; \
rm "eden-macosx-$${VERSION}.dmg" 2>/dev/null; \
echo "Making eden-macosx-$${VERSION}.dmg..."; \
hdiutil create -volname "eden-macosx-$${VERSION}" -srcfolder "tkeden$${VERSION}.app" -srcfolder "ttyeden$${VERSION}" "eden-macosx-$${VERSION}.dmg"; \
rm "ttyeden$${VERSION}";
# Re-generate each Makefile from its Makefile.in, as long as configure has
# been run.
make::
./config.status
# /cygdrive/c/cygwin/bin/cygncurses5.dll \
# /cygdrive/c/cygwin/bin/cygreadline4.dll \
# lib-tkeden tkeden.exe ttyeden.exe dtkeden.exe Windist
# Make a directory with just the files required for a Windows binary
# distribution.
# NB
# - Use 'cygcheck tkeden.exe' to find which DLLs to copy.
# ... NB unfortunately this doesn't seem to work any more -- cygcheck
# output is empty, whatever the options?? [Ash, 8 June 2005]
# - Give locations in /bin rather than /cygdrive/c/cygwin/bin to avoid
# problems with installations of cygwin in places other than c:
# - Could possibly 'strip Windist/tkeden.exe' and other binaries to remove
# debugging symbols and reduce executable size, but then again, we're over
# a floppy disk in size even after stripping, so probably not worth it...
winapp::
rm -rf Windist
mkdir -p Windist/share/tcl8.4 Windist/Docs
cp -R /bin/cygwin1.dll \
/bin/cygpng12.dll \
/bin/cygz.dll \
/bin/tcl84.dll \
/bin/tk84.dll \
/bin/cygncurses-9.dll \
/bin/cygreadline6.dll \
lib-tkeden tkeden.exe Windist
-cp ttyeden.exe Windist
-cp dtkeden.exe Windist
cp /usr/share/tcl8.4/init.tcl Windist/share/tcl8.4
cp /usr/share/tcl8.4/word.tcl Windist/share/tcl8.4
cp /usr/share/tcl8.4/tclIndex Windist/share/tcl8.4
cp /usr/share/tcl8.4/auto.tcl Windist/share/tcl8.4
cp -R /usr/share/tk8.4 Windist/share
chmod +x Windist/lib-tkeden/gel/tkhtml.dll
./Windows/unix2dos.sh Docs/CHANGE.LOG Windist/Docs/CHANGE.LOG
./Windows/unix2dos.sh Docs/COPYING.TXT Windist/Docs/COPYING.TXT
./Windows/unix2dos.sh Docs/GPL.TXT Windist/Docs/GPL.TXT
./Windows/unix2dos.sh Docs/LICENSE_GLPNG.TXT Windist/Docs/LICENSE_GLPNG.TXT
./Windows/unix2dos.sh Docs/LICENSE_TOGL.TXT Windist/Docs/LICENSE_TOGL.TXT
./Windows/unix2dos.sh Docs/README.TXT Windist/Docs/README.TXT
rm -rf Windist/lib-tkeden/.svn
rm -rf Windist/lib-tkeden/gel/.svn
rm -rf Windist/share/tk8.4/demos
VERSION=`grep '#define TKEDEN_VERSION ' version.h | \
awk -F'"' '{print $$2}'`; \
rm -rf eden-$${VERSION} 2>/dev/null; \
rm eden-$${VERSION}.zip 2>/dev/null; \
mv Windist eden-$${VERSION};
# Make a ZIP file of the Windows distribution.
# NB You must run "make winapp" before running this target.
windist::
VERSION=`grep '#define TKEDEN_VERSION ' version.h | \
awk -F'"' '{print $$2}'`; \
rm eden-$${VERSION}.zip; \
zip -T9r eden-$${VERSION}.zip eden-$${VERSION}
## Make PCRE (Perl-compatible regular expressions) package, used in Eden for
## "regmatch" and other functions
pcre::
cd pcre-3.9; ./configure --disable-shared; make