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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

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