/[ascend]/trunk/pygtk/interface/Makefile.in
ViewVC logotype

Contents of /trunk/pygtk/interface/Makefile.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 347 - (show annotations) (download)
Thu Mar 2 00:28:11 2006 UTC (14 years, 6 months ago) by johnpye
File size: 5913 byte(s)
Adding missing files for ./configure build of PyGTK GUI
1 SOURCE_ROOT = ../..
2
3 CXX = g++
4 CC = gcc
5
6 SO_SUFF = @SO_SUFF@
7 PLATFORM_CPPFLAGS = @PLATFORM_CPPFLAGS@
8
9 CXXFLAGS = -c -g
10
11 LD = libtool --mode=link gcc
12 LD_CXX = libtool --mode=link g++
13
14 # -lieee -ldl
15 LDFLAGS = -g -lm -lstdc++
16
17 # Are you on a dual processor machine?
18 _smp_mflags = -j2
19
20 CLASSES = library type module symchar \
21 instance instanceinterfacedata \
22 method name \
23 reporter simulation set units dimensions extmethod \
24 variable relation \
25 solver curve plot \
26 solverparameters solverparameter solverparameteriterator \
27 solverstatus solverreporter \
28 incidencematrix
29
30 OBJS = $(CLASSES:%=%.o)
31 HDRS = $(CLASSES:%=%.h)
32
33 all:
34 @echo "SO SUFF: $(SO_SUFF)"
35 @echo "OS TYPE: $(OSTYPE)"
36
37 ASCEND_CPPFLAGS = -I../../base/generic -I../../base/generic/solver -I../../base/generic/compiler -I../../base/generic/utilities -I../../base/generic/general -I../../base/generic/packages
38
39 #-------------------------
40 # Linking with ASCEND
41
42 USE_JAM_LIBS = 1
43
44 ARDIR = $(SOURCE_ROOT)/base/autotools/archive
45 ASC_BUILD_LIBS = cd $(SOURCE_ROOT)/base/autotools; make libs
46
47 # Libs now are named the same way on both autotools and jam builds...
48 ASC_LIBS_STEM = compiler packages solver utilities general
49 ASC_LIBS = $(ASC_LIBS_STEM:%=$(ARDIR)/libasc%.a)
50
51 $(ASC_LIBS): libs
52
53 .PHONY: libs
54
55 libs:
56 @echo $(ASC_LIBS)
57 $(ASC_BUILD_LIBS)
58
59 #------------------
60 # PYTHON STUFF
61
62 USE_PYTHON := 1
63
64 ifeq ($(USE_PYTHON),1)
65 ifeq ($(OSTYPE),msys)
66 PYTHON_VERSION := 24
67 PYTHON_ROOT := /c/Python$(PYTHON_VERSION)
68 PYTHON_CPPFLAGS := -I$(PYTHON_ROOT)/include
69 PYTHON_LDFLAGS := -L$(PYTHON_ROOT)/libs -lpython$(PYTHON_VERSION)
70 else
71 ifeq ($(TERM),cygwin)
72 PYTHON_VERSION := 24
73 PYTHON_ROOT := /cygdrive/c/Python$(PYTHON_VERSION)
74 PYTHON_CPPFLAGS := -I$(PYTHON_ROOT)/include
75 PYTHON_LDFLAGS := -L$(PYTHON_ROOT)/libs -lpython24
76 else
77 PYTHON_VERSION := $(shell python -V 2>&1 | sed s/Python\ // | sed s/^\\\([0-9][0-9]*\\.[0-9][0-9]*\\\).*/\\1/ )
78 PYTHON_CPPFLAGS := -I/usr/include/python$(PYTHON_VERSION)
79 PYTHON_LDFLAGS := -lpython$(PYTHON_VERSION)
80 endif
81 endif
82 endif
83
84 ifeq ($(USE_PYTHON),1)
85 ASCXX_CPPFLAGS := $(ASCEND_CPPFLAGS) $(PYTHON_CPPFLAGS) -DASCXX_USE_PYTHON
86 ASCXX_PYTHON_LDFLAGS := $(PYTHON_LDFLAGS)
87 else
88 ASCXX_CPPFLAGS := $(ASCEND_CPPFLAGS)
89 ASCXX_PYTHON_LDFLAGS :=
90 endif
91
92 clean:
93 -rm *$(SO_SUFF) *.so *.dll
94 -rm *.o
95 -rm *_wrap.cxx
96 -rm *_wrap.c
97 -rm *_wrap.o
98 -rm ascend.py
99 -rm main
100 -rm *.pyc
101 -rmdir .libs
102
103 cleanall: clean
104 cd $(SOURCE_ROOT)/jam; \
105 jam clean;
106
107
108 #------------------------
109 # SWIG targets
110
111 SWIG_MODULE = ascend
112
113 ifeq ($(OSTYPE),msys)
114 SWIG=~/swigwin-1.3.28/swig
115 SWIG_LIB = $(shell $(SWIG) -swiglib)
116 SWIG_VERSION = $(shell $(SWIG) -version | grep "^SWIG Version " | sed s/SWIG\ Version\ \\\([0-9][0-9]*\\\(\\.[0-9][0-9]*\\\)*\\\).*/\\1/)
117 SWIG_INCLUDES = -I$(SWIG_LIB)
118 else
119 SWIG=swig
120 SWIG_VERSION = $(shell $(SWIG) -version | grep "^SWIG Version " | sed s/SWIG\ Version\ \\\([0-9][0-9]*\\\(\\.[0-9][0-9]*\\\)*\\\).*/\\1/)
121 SWIG_INCLUDES =
122 endif
123
124 # optimize for SWIG 1.3.28 and newer
125 SWIG_MAJOR = $(shell echo $(SWIG_VERSION) | sed s/^\\\([0-9]*\\\).*/\\1/)
126 SWIG_MINOR = $(shell echo $(SWIG_VERSION) | sed s/^[0-9]*\\.\\\([0-9]*\\\).*/\\1/)
127 SWIG_PATCH = $(shell echo $(SWIG_VERSION) | sed s/^[0-9]*\\.[0-9]*\\.\\\([0-9]*\\\).*/\\1/)
128
129 SWIG_FEATURES =
130 ifeq ($(SWIG_MAJOR),1)
131 ifeq ($(SWIG_MINOR),3)
132 ifeq ($(shell test $(SWIG_PATCH) -ge 28 && echo 1),1)
133 SWIG_FEATURES="-O"
134 endif
135 endif
136 endif
137
138 SWIGFLAGS = -c++ -python $(SWIG_INCLUDES)
139 SWIG_CFLAGS = -c -fPIC
140 SWIG_CPPFLAGS = $(ASCXX_CPPFLAGS) $(PLATFORM_CPPFLAGS)
141
142 SWIG_OBJS = $(SWIG_MODULE:%=%_wrap.o)
143 SWIG_PY = $(SWIG_MODULE:%=%.py)
144
145 LIB = _ascend$(SO_SUFF)
146
147 all: $(LIB)
148
149 SWIGS = plot.i solver.i
150
151 # FIXME add ' $(ASC_LIBS)' to deps once Jam build is fixed:
152 %_wrap.cxx %.py: %.i $(SWIGS) $(HDRS)
153 @echo "SWIG = $(SWIG), VERSION = $(SWIG_VERSION)"
154 SWIG_FEATURES=$(SWIG_FEATURES) $(SWIG) $(SWIGFLAGS) $<
155
156 .precious: $(SWIG_MODULE:%=%_wrap.cxx)
157 .precious: _ascend$(SO_SUFF)
158
159 %_wrap.o: %_wrap.cxx
160 $(CC) $(SWIG_CFLAGS) -o $@ $^ $(SWIG_CPPFLAGS)
161
162 $(LIB): $(ASC_LIBS) $(OBJS) $(SWIG_OBJS) $(SWIG_PY)
163 @echo "OS TYPE = $(OSTYPE)"
164 @echo "SO_SUFF = $(SO_SUFF)"
165 @echo "CREATING LIBRARY FILE '$(LIB)'"
166 $(LD) -module -shared -o $@ $(ASC_LIBS) $(OBJS) $(SWIG_OBJS) $(LDFLAGS) $(ASCXX_PYTHON_LDFLAGS)
167
168
169 #--------------------------
170 # Pure C++ tests (no swigging required)
171
172 CPPFLAGS := $(ASCXX_CPPFLAGS) $(PLATFORM_CPPFLAGS)
173
174 main: main.o $(OBJS) $(ASC_LIBS)
175 $(LD) -o $@ $^ $(LDFLAGS) $(ASCXX_PYTHON_LDFLAGS)
176
177 #------------------------
178 # Trying to debug this GDPITA '3' problem, bug #178
179
180 testsolverinit.o: testsolverinit.cpp
181 $(CXX) -c $(CPPFLAGS) $(CFLAGS) -o $@ $^
182
183 testsolverinit: testsolverinit.o $(OBJS) $(ASC_LIBS)
184 $(LD) -o $@ $^ $(LDFLAGS) $(ASCXX_PYTHON_LDFLAGS)
185
186
187 #------------------------
188 # Trying to fix implementation of external functions
189
190 testextfn.o: testextfn.cpp
191 $(CXX) -c $(CPPFLAGS) $(CFLAGS) -o $@ $^
192
193 testextfn: testextfn.o $(OBJS) $(ASC_LIBS)
194 $(LD) -o $@ $^ $(LDFLAGS) $(ASCXX_PYTHON_LDFLAGS)
195
196
197 #------------------------
198 # Testing the Python module
199
200 test: $(LIB)
201 # @echo "Does module include 'do_solve_eval' symbol?"
202 # nm $(LIB) | grep "do_solve_eval" | egrep -v "U"
203 # @echo "Does module include 'system_build' symbol?"
204 # nm $(LIB) | grep "system_build" | egrep -v "U"
205 @echo "Can python load the $(LIB) file?"
206 python -c "import _ascend"
207 python librarytest.py
208
209
210 #--------------------------
211 # tarfile
212
213 tar: clean
214 pushd $(SOURCE_ROOT) && \
215 tar jcvf pygtk.tar.bz2 pygtk/ && \
216 popd
217 mv ../../pygtk.tar.bz2 .
218
219 #--------------------------
220 # storing a patch
221
222 patch: clean
223 pushd $(SOURCE_ROOT)/base && \
224 svn diff > ../pygtk/interface/ascend-base.patch && \
225 popd
226 pushd $(SOURCE_ROOT)/tcltk98 && \
227 svn diff > ../pygtk/interface/ascend-tcltk98.patch && \
228 popd
229
230 #---------------------------
231 patchapplybase: clean
232 pushd $(SOURCE_ROOT)/base && \
233 patch -p0 < ../pygtk/interface/ascend-base.patch && \
234 popd
235

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22