aboutsummaryrefslogtreecommitdiff
path: root/Makefile.in
blob: 75a8865a0825ee58346579f879b5685ec96a3abb (plain)
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
#
#  Copyright (c) 1993 - 1999 CENA, Patrick Lecoanet --
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This code 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this code; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#
VPATH = @srcdir@
srcdir = @srcdir@

SHELL = /bin/sh

CC = @CC@
RANLIB = @RANLIB@

INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL = @INSTALL@

# PERL PATHS
INSTALLARCHLIB = @INSTALLARCHLIB@
INSTALLPRIVLIB = @INSTALLPRIVLIB@
INSTALLMAN1DIR = @INSTALLMAN1DIR@
INSTALLMAN3DIR = @INSTALLMAN3DIR@

PERLCONFIG = INSTALLDIRS=perl INSTALLMAN1DIR=$(INSTALLMAN1DIR) INSTALLMAN3DIR=$(INSTALLMAN3DIR) INSTALLPRIVLIB=$(INSTALLPRIVLIB) INSTALLARCHLIB=$(INSTALLARCHLIB)

INSTALL_PERL = install_perl

prefix = $(HOME)
exec_prefix = $(prefix)

bindir = $(exec_prefix)/bin/$(ARCH)
libdir = $(exec_prefix)/lib/$(ARCH)
incdir = $(prefix)/include
mandir = $(prefix)/man/man3
LDFLAGS = -L. @LDFLAGS@ @X_LIBS@ @LOCAL_X_LIBS@
# Should be tested in configure. It doesn't work
# on some systems.
SHARED_LIB_CFLAGS = @sharedlib_cflags@
SHARED_TK_LDFLAGS = @sharedlib_buildflags@
TCL_TK_VER = 8.0
TK_INCLUDE_PATH=/usr/include/tcl$(TCL_TK_VER)
SHARED_TK_LIBS = @X_LIBS@ @LOCAL_X_LIBS@ @XMU@ -lXext -lX11 @X_EXTRA_LIBS@ -lm
ZINC_VER = @ZINC_VER@
ZINC_MAJOR = @ZINC_MAJOR@
CFLAGS = -Wall $(SHARED_LIB_CFLAGS)
CPPFLAGS =  @DEFS@ @X_CFLAGS@ $(DFLAGS) -I$(TK_INCLUDE_PATH) -I$(srcdir) -DBUILD_LIBRARY
#
# Linux
#PTKLIB = /usr/lib/perl5/i386-linux/5.004/Tk/pTk
#SITEPERL = /usr/local/lib/site_perl
#
# Solaris
#PTKLIB = /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Tk/pTk
#SITEPERL = /usr/local/lib/perl5/site_perl
#
# Auto
PTKLIB = @TKLIB@/pTk
PTKCFLAGS = -DPTK -I$(PTKLIB)
#
# Define this to use the polygon clipper.
GPC=libgpc.so
#GPC=
#
# Define this to use OpenGL
#
#GLX=-lgle -lGLU -lGL
GLX=

#
# Recognized compilation time flags are :
#
#	PROFILE		ask for profile support
#	OM		include code for internal overlap manager
#	GLX		include code that need GL support.
#	SHAPE		include code for reshaping windows.
#	GPC		include code for composing polygons.
#
ifeq ($(strip $(GPC)),'')
DFLAGS = -DOM -DSHAPE
else
#DFLAGS= -DOM -DSHAPE -DGPC -DGLX
DFLAGS= -DOM -DSHAPE -DGPC
endif
#DFLAGS = -DTCL_MEM_DEBUG

#
# This set for cc under HP-UX
#
#
#------- Nothing to be modified by users below this line (hopefully ;-) ) ----------------
#
TODO=Mosaic.c 
cfiles = Track.c Tabular.c Reticle.c Map.c Rectangle.c Arc.c Curve.c	\
	Bezier.c Item.c PostScript.c MapInfo.c Attrs.c Draw.c Geo.c List.c	\
	perfos.c version.c Transfo.c Group.c Icon.c Text.c Image.c Color.c	\
	Window.c
tkcfiles = tkZinc.c
omcfiles = OverlapMan.c
hfiles = MapInfo.h List.h perfos.h patchlvl.h Types.h Transfo.h	\
	Attrs.h Item.h PostScript.h Draw.h Image.h Geo.h	\
	OverlapMan.h WidgetInfo.h Track.h
dfiles = Copyright
projfiles = ChangeLog mkinstalldirs
confiles = configure configure.in acaux.m4 config.h.in Makefile.in install-sh
afiles = $(cfiles) $(tkcfiles) $(hfiles) $(tfiles) $(dfiles) $(projfiles) $(confiles)
rtlfiles = $(hfiles) $(tkhfiles) $(tfiles) $(dfiles) $(confiles) $(bins) $(tklibs)

tkobjs = $(cfiles:%.c=tk/%.o) $(tkcfiles:%.c=tk/%.o)
tkgobjs = $(cfiles:%.c=tk/%.g) $(tkcfiles:%.c=tk/%.g)
tkpgobjs = $(cfiles:%.c=tk/%.pg) $(tkcfiles:%.c=tk/%.pg)
ptkobjs = $(cfiles:%.c=ptk/%.o) $(tkcfiles:%.c=ptk/%.o)
ptkgobjs = $(cfiles:%.c=ptk/%.g) $(tkcfiles:%.c=ptk/%.g)
omobjs = $(omcfiles:%.c=tk/%.o)
omgobjs = $(omcfiles:%.c=tk/%.g)

tklibs = tkzinc$(ZINC_VER).$(ZINC_MAJOR).so
ptklibs = libptkzinc$(ZINC_VER).$(ZINC_MAJOR).so

fontbins = $(fonts:.bdf=.pcf)

.SUFFIXES: .g .bdf .pcf

tk/%.o: %.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -O -c $< -o $@
tk/%.g: %.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -g -c $< -o $@
tk/%.pg: %.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -pg -c $< -o $@

ptk/%.o: %.c
	$(CC) $(CFLAGS) $(CPPFLAGS) $(PTKCFLAGS) -O -c $< -o $@
ptk/%.g: %.c
	$(CC) $(CFLAGS) $(CPPFLAGS) $(PTKCFLAGS) -g -c $< -o $@

.bdf.pcf:
	bdftopcf $*.bdf >$*.pcf

ptkzinc: libptkzinc$(ZINC_VER).$(ZINC_MAJOR).so Perl/Makefile_nodebug
	(cd Perl; make "LD_RUN_PATH=@X_LIBS@")
ptkzinc_debug: libptkzinc_debug$(ZINC_VER).$(ZINC_MAJOR).so Perl/Makefile_debug
	(cd Perl; make "LD_RUN_PATH=@X_LIBS@")
testptk: ptkzinc
	(cd Perl; make test "FULLPERL=PERL_DL_NONLAZY=0 perl")
Perl/Makefile_nodebug:
	(cd Perl; perl Makefile.PL ptkzinc$(ZINC_VER).$(ZINC_MAJOR) $(PERLCONFIG))
Perl/Makefile_debug:
	(cd Perl; perl Makefile.PL ptkzinc$(ZINC_VER).$(ZINC_MAJOR)_debug $(PERLCONFIG))

libptkzinc$(ZINC_VER).$(ZINC_MAJOR).so: ptk $(ptkobjs) libom.so $(GPC)
	$(CC) $(SHARED_TK_LDFLAGS) -o $@ $(ptkobjs) $(SHARED_TK_LIBS) -L. -lom $(GPC) $(GLX) 
libptkzinc_debug$(ZINC_VER).$(ZINC_MAJOR).so: ptk $(ptkgobjs) libom_debug.so $(GPC)
	$(CC) $(SHARED_TK_LDFLAGS) -o $@ $(ptkgobjs) $(SHARED_TK_LIBS)  -L. -lom_debug $(GPC) $(GLX)

tkzinc: tkzinc$(ZINC_VER).$(ZINC_MAJOR).so
tkzinc$(ZINC_VER).$(ZINC_MAJOR).so: tk $(tkobjs) libom.so $(GPC)
	$(CC) $(SHARED_TK_LDFLAGS) -o $@ $(SHARED_TK_LIBS) -L. -ltk$(TCL_TK_VER) -ltcl$(TCL_TK_VER) -lom $(GPC) $(GLX) $(tkobjs)
tkzinc_debug: tkzinc_debug$(ZINC_VER).$(ZINC_MAJOR).so
tkzinc_debug$(ZINC_VER).$(ZINC_MAJOR).so: tk $(tkgobjs) libom_debug.so $(GPC)
	$(CC) $(SHARED_TK_LDFLAGS) -o $@ $(SHARED_TK_LIBS) -L.  -ltk$(TCL_TK_VER) -ltcl$(TCL_TK_VER) -lom_debug $(GPC) $(GLX) $(tkgobjs)
tkzinc_profile: tkzinc_profile.a libom.so
	$(CC) -pg -o zincwish $(SHARED_TK_LIBS) -L.  -ltk$(TCL_TK_VER) -ltcl$(TCL_TK_VER) -lom tkAppInit.c tkzinc_profile.a -o zincwish
tkzinc_profile.a: tk $(tkpgobjs) libom_debug.so
	ar rv $@ $(tkpgobjs)

libom.so: tk $(omobjs)
	$(CC) $(SHARED_TK_LDFLAGS) -o $@ $(omobjs) -lm
libom_debug.so: tk $(omgobjs)
	$(CC) $(SHARED_TK_LDFLAGS) -o $@ $(omgobjs) -lm

libgpc.so: tk gpc/gpc.c gpc/gpc.h
	$(CC) $(SHARED_TK_LDFLAGS) $(SHARED_LIB_CFLAGS) -o $@ gpc/gpc.c -lm

tk:
	-mkdir tk

ptk:
	-mkdir ptk

doc: doc/refman.ps doc/refman.html

doc/refman.html:
	(cd doc; latex2html refman.tex)

doc/refman.ps: doc/refman.tex
	(cd doc; latex refman.tex; latex refman.tex; dvips -o refman.ps refman.dvi)

ifeq ($(strip($GPC)),)
install: installtk installptk installom installgpc
else
install: installtk installptk installom
endif

installom: libom.so
	$(INSTALL_DATA) libom.so $(libdir)

installgpc: $(GPC)
	$(INSTALL_DATA) $(GPC) $(libdir)

installtk: installdirs $(tklibs)
	$(INSTALL_DATA) $(tklibs) $(libdir)
	cd $(libdir) && rm -f libtkzinc.so
	for f in $(hfiles); do $(INSTALL_DATA) $$f $(incdir); done

installptk: $(ptklibs)
	$(INSTALL_DATA) $(ptklibs) $(libdir)
	(cd Perl; make; make $(INSTALL_PERL))

installdirs:
	$(srcdir)/mkinstalldirs $(libdir) $(incdir) $(mandir)

#
#------------- Stuff for maintaining ZINC below -----------------------------------
#

VERSION = @ZINC_VERSION@

Makefile:	Makefile.in config.status
	$(SHELL) config.status
config.status:	configure
	$(SHELL) $(srcdir)/configure --no-create
configure:	configure.in
	cd $(srcdir); autoconf
config.h.in:	configure.in
	cd $(srcdir); autoheader; touch config.h.in

dist: zinc$(VERSION).tar.gz
zinc$(VERSION).tar.gz:	temp/zinc$(VERSION)
	cd temp; tar cohf ../zinc$(VERSION).tar zinc$(VERSION)
	-rm -f zinc$(VERSION).tar.gz
	gzip -9 zinc$(VERSION).tar
temp/zinc$(VERSION): $(afiles)
	-rm -rf temp/zinc$(VERSION)
	-mkdir temp
	mkdir temp/zinc$(VERSION)
	cd temp/zinc$(VERSION); for f in $(afiles); do ln -s ../../$$f .; done

ctags:	$(hfiles) $(cfiles) $(tkcfiles) code.doc
	etags $(hfiles) $(cfiles) $(tkcfiles) code.doc

mostlyclean: distclean
clean: distclean
distclean: Perl/Makefile_nodebug
	-rm -f *~ *.bak *.tar *.orig *.rej core a.out tk/*.o tk/*.g ptk/*.o ptk/*.g
	-rm -f *.a *.so* lints tmp*
	-rm -rf *temp
	-rm -rf refman.aux refman.dvi refman.idx refman.lof refman.log refman.lot
	-rm -rf refman.toc refman.ps refman.ilg refman.ind
	(cd Perl; make clean)

depend:
	-$(CPP) $(CPPFLAGS) -MM -I. $(cfiles) $(tkcfiles) > depend.temp
	cat depend.temp | sed -e 's/.o:/.g:/g' > depends
	cat depend.temp >> depends
	rm -f depend.temp
	cat depends | sed -e 's+\(.*\):+tk/\1:+g' > depend.temp
	rm -f depends
	mv depend.temp depends

depends:
	touch depends

include depends