/[webpac]/trunk/openisis/tcl/Makefile
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/openisis/tcl/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 239 - (show annotations)
Mon Mar 8 17:49:13 2004 UTC (17 years, 7 months ago) by dpavlin
File size: 6888 byte(s)
including openisis 0.9.0 into webpac tree

1 #
2 #/*
3 # openisis - an open implementation of the CDS/ISIS database
4 # Version 0.8.x (patchlevel see file Version)
5 # Copyright (C) 2001-2003 by Erik Grziwotz, erik@openisis.org
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #
21 # see README for more information
22 #EOH */
23 #
24 #
25 # $Id: Makefile,v 1.21 2003/06/10 11:00:56 kripke Exp $
26 # the Makefile
27 #
28
29
30
31 # make
32 # make ORATCL=3.3
33 # make ORATCL=4.1
34 # make PGLIB=/opt/postgres/lib
35
36
37 # make.tcltk is basically a compilation of the t*Config.sh scripts
38 # it's created using
39 # ./configure <your-Tcl-installation>
40 # see maketcltk for hints on building the tcl/tk
41 #
42 # ./configure /opt/TclTk/8.4.2.t.so
43 # ./configure /opt/TclTk/8.3.5.t.so
44 #
45 # for the binary distribution, we build statics like:
46 # ./configure /opt/TclTk/8.3.5.a/lib
47 #
48 # actually used are:
49 # TCL_SHARED_BUILD 0 or 1
50 # TCL_DL_LIBS e.g. -ldl
51 # TCL_LD_FLAGS e.g. -rdynamic to enable explit loading of extensions
52 # TCL_DL_LIBS e.g. -ldl for the same reason
53 # TCL_LIB_SPEC e.g. -L/opt/TclTk/8.3.5.t.so/lib -ltcl8.3
54 # TCL_LD_SEARCH_FLAGS e.g. -Wl,-rpath,${LIB_RUNTIME_DIR}
55 # TCL_LIBS e.g. -lpthread -lieee -lm
56 # TCL_DEFS lots of -Defines like -D_REENTRANT=1 or -DSTATIC_BUILD=1
57 # TK_LIB_SPEC -L/opt/TclTk/8.3.5.t.so/lib -ltk8.3
58 # TK_LIBS -L/usr/X11R6/lib -lX11 -ldl -lpthread -lieee -lm
59
60 ifeq (,$(WIN32))
61 include make.tcltk
62 else
63 # ./configure -mingw /opt/TclTk/8.3.5.w.a
64 include make.tcltk.mingw
65 endif
66
67 # mingw build leaves many options unset (newer configure cares)
68 ifeq (,$(TCL_LIB_SPEC))
69 TCL_LIB_SPEC=$(TCL_PREFIX)/lib/$(TCL_LIB_FILE)
70 endif
71 ifeq (,$(TK_LIB_SPEC))
72 TK_LIB_SPEC=$(TK_PREFIX)/lib/$(TK_LIB_FILE)
73 endif
74 # 8.4 only ?
75 ifeq ($(TCL_INCLUDE_SPEC),)
76 TCL_INCLUDE_SPEC=-I$(TCL_PREFIX)/include
77 endif
78
79
80 MT=$(findstring TCL_THREADS,$(TCL_DEFS))
81 ifeq (,$(MT))
82 O=sto
83 MKDEF=
84 else
85 O=mto
86 MKDEF=MT=1
87 OITS=bin/oits
88 endif
89
90 BIN=bin
91 EXE=
92 RUN=
93 GUI=
94 ifneq ($(WIN32),)
95 include ../make.mingw
96 O=win
97 MKDEF=WIN32=1
98 BIN=win
99 EXE=.exe
100 RUN=wine --
101 GUI=-mwindows
102 tclsubdir=win
103 endif
104
105 ifneq ($(TK_VERSION),)
106 WISISH=$(BIN)/wisish$(EXE)
107 else
108 WISISH=
109 endif
110 TARGETS=$(BIN)/isish$(EXE) lib/pkgIndex.tcl $(BIN)/tspr$(EXE) $(OITS) $(WISISH)
111 OBJS=$(BIN)/openisistcl.o
112
113
114 # standard make defines
115 CC=gcc
116 RANLIB=ranlib
117
118
119
120
121 ifeq (solaris,$(OSTYPE))
122 # for nanosleep; others are in TCL_LIBS
123 SYSLIBS=-lrt
124 endif
125
126
127 ifneq ($(TKHTML),NO) # ... wisish needs it
128 TKHDEF=-DTKHTML=20
129 ifeq (1,$(TCL_SHARED_BUILD))
130 TKHLINK=-ltkhtml
131 else
132 TKHLINK=$(TCL_PREFIX)/lib/libtkhtml.a
133 endif
134 endif
135 ifneq ($(TIX),)
136 TIXDEF=-DTIX=$(TIX)
137 TIXLINK=-ltix$(TIX)
138 endif
139 ifneq ($(ORATCL),)
140 ORADEF=-DORATCL=$(ORATCL)
141 ORALINK=-loratcl$(ORATCL) -L$(ORACLE_HOME)/lib
142 ORAPATH=:$(ORACLE_HOME)/lib
143 endif
144 ifneq ($(PGLIB),)
145 PGDEF=-DPGTCL
146 PGLINK=-lpgtcl -L$(PGLIB)
147 PGPATH=:$(PGLIB)
148 endif
149
150 # referenced by TCL_LD_SEARCH_FLAGS in make.tcl
151 LIB_RUNTIME_DIR=$(TCL_PREFIX)/lib$(ORAPATH)$(PGPATH)
152
153 # DBG=
154 ifeq ($(NDEBUG),)
155 DBG=-g
156 else
157 DBG=-DNDEBUG
158 endif
159
160
161 # note that -O is necessary for -Wuninitialized warnings
162 # java needs long long
163 # -fstack-check ???
164 CFLAGS=-O2 -Wall -W -Wshadow -pedantic -Wno-long-long \
165 $(DBG) $(TCL_DEFS) $(TKHDEF) $(TIXDEF) $(ORADEF) $(PGDEF) \
166 -I.. $(TCL_INCLUDE_SPEC)
167
168
169 # DB to use -- define DB for db/DB/DB, or DBDIR for other path
170 ifeq ($(DB),)
171 DB=cds
172 endif
173 ifeq ($(DBDIR),)
174 DBDIR=db/$(DB)/$(DB)
175 endif
176
177 # standard default target
178 all: $(TARGETS)
179
180 .PHONY: all clean test
181 # do not delete intermediates
182 .PRECIOUS:
183
184 clean:
185 rm -rf *.o *.a *.so *.dll *.tmp *.exe \
186 bin win Makefile.old testout.txt
187
188 lib/pkgIndex.tcl: openIsis.tcl
189 @- [ -d lib ] || mkdir lib
190 @- [ -h lib/openIsis.tcl ] || ln -s ../openIsis.tcl lib/.
191 echo "pkg_mkIndex lib" | tclsh
192
193 ifeq (,$(MT))
194 $(BIN)/oits$(EXE):
195 : please use a threaded build of Tcl
196 exit 1
197 else
198 $(BIN)/oits$(EXE): $(BIN)/oits.o $(OBJS) ../mto/libopenisis.a ../mto/liboisrv.a
199 @- [ -d $(BIN) ] || mkdir $(BIN)
200 $(CC) $(TCL_LD_FLAGS) -o $@ $^ \
201 $(TCL_LIB_SPEC) $(TCL_DL_LIBS) \
202 $(ORALINK) $(PGLINK) \
203 $(TCL_LD_SEARCH_FLAGS) \
204 $(TCL_LIBS) $(SYSLIBS)
205 endif
206
207 $(BIN)/isish$(EXE): $(BIN)/isish.o $(OBJS) ../$(O)/libopenisis.a
208 @- [ -d $(BIN) ] || mkdir $(BIN)
209 $(CC) $(TCL_LD_FLAGS) -o $@ $^ \
210 $(TCL_LIB_SPEC) $(TCL_DL_LIBS) \
211 $(ORALINK) $(PGLINK) \
212 $(TCL_LD_SEARCH_FLAGS) \
213 $(TCL_LIBS) $(SYSLIBS)
214
215 $(BIN)/tspr$(EXE): $(BIN)/tspr.o $(OBJS) ../$(O)/libopenisis.a
216 @- [ -d $(BIN) ] || mkdir $(BIN)
217 $(CC) $(TCL_LD_FLAGS) -o $@ $^ \
218 $(TCL_LIB_SPEC) $(TCL_DL_LIBS) \
219 $(ORALINK) $(PGLINK) \
220 $(TCL_LD_SEARCH_FLAGS) \
221 $(TCL_LIBS) $(SYSLIBS)
222
223 $(BIN)/wisish$(EXE): $(BIN)/wisish.o $(OBJS) ../$(O)/libopenisis.a
224 @- [ -d $(BIN) ] || mkdir $(BIN)
225 $(CC) $(TCL_LD_FLAGS) $(GUI) -o $@ $^ \
226 $(TCL_LIB_SPEC) $(TCL_DL_LIBS) $(TK_LIB_SPEC) $(TKHLINK) \
227 $(ORALINK) $(PGLINK) \
228 $(TIXLINK) \
229 $(TCL_LD_SEARCH_FLAGS) \
230 $(TK_LIBS) $(SYSLIBS)
231
232 test: $(BIN)/isish$(EXE)
233 $(RUN) $(BIN)/isish$(EXE) test/test1.tcl
234 $(RUN) $(BIN)/isish$(EXE) test/test2.tcl
235 $(RUN) $(BIN)/isish$(EXE) test/testrec.tcl
236 $(RUN) $(BIN)/isish$(EXE) test/teststb.tcl
237
238 run: $(BIN)/wisish$(EXE)
239 $(RUN) $(BIN)/wisish$(EXE) tisis ../db/cds/cds
240
241 install: all
242 strip $(BIN)/*
243 cp $(BIN)/* $(TCL_PREFIX)/bin
244 [ -d $(TCL_PREFIX)/lib/openIsis ] || mkdir $(TCL_PREFIX)/lib/openIsis
245 cp openIsis.tcl lib/pkgIndex.tcl $(TCL_PREFIX)/lib/openIsis
246 cp tisis detail.tsp list.tsp $(TCL_PREFIX)
247
248 ../$(O)/libopenisis.a:
249 @ $(MAKE) -C .. $(MKDEF) mto/libopenisis.a
250
251 ../$(O)/liboisrv.a:
252 @ $(MAKE) -C .. $(MKDEF) mto/liboisrv.a
253
254
255 $(BIN)/%.o: %.c
256 @- [ -d $(BIN) ] || mkdir $(BIN)
257 $(CC) -c $(CPPFLAGS) $(MTFLAGS) $(CFLAGS) -o $@ $<
258
259 # please do not try to make deps w/o sed, gcc and mv ...
260 deps:
261 sed -n -e '1,/^# generated deps/p' Makefile >Makefile.tmp
262 gcc -I. -I.. -MM `../lscvs |grep '\.c$$' |sort` | \
263 sed -e '/^[^ ]/s/^/$$(BIN)\//' >>Makefile.tmp
264 mv -f Makefile Makefile.old
265 mv Makefile.tmp Makefile
266 -diff Makefile Makefile.old
267
268 # generated deps -- do not edit below this line
269 $(BIN)/isish.o: isish.c ../openisis.h openisistcl.h
270 $(BIN)/oits.o: oits.c ../lsv.h ../loi.h ../openisis.h ../lio.h ../luti.h \
271 ../lll.h ../lses.h ../ldsp.h openisistcl.h
272 $(BIN)/openisistcl.o: openisistcl.c ../openisis.h openisistcl.h ../luti.h \
273 ../loi.h ../ldsp.h
274 $(BIN)/tspr.o: tspr.c ../openisis.h openisistcl.h
275 $(BIN)/wisish.o: wisish.c ../openisis.h openisistcl.h

  ViewVC Help
Powered by ViewVC 1.1.26