Revision 1388 trunk/scripts/admb/admb

admb (revision 1388)
151 151
  rm -vf classdef.tmp xxdata.tmp xxhtop.tmp xxhtopm.tmp xxglobal.tmp xxtopm.tmp 
152 152
  rm -vf xxalloc.tmp xxalloc1.tmp xxalloc2.tmp xxalloc3.tmp xxalloc4.tmp xxalloc5.tmp xxalloc6.tmp header.tmp 
153 153
  rm -vf tfile1 tfile2 tfile3 tfile4 tfile5
154
  rm -f $model.cpp $model.htp $model.o $model
154
  rm -f $model.cpp $model.htp $model.obj $model.o $model
155 155

  
156 156
  CMD="$parser $debug $dll $model"
157
  echo -e \\n\*\*\* Parsing tpl file: $model.tpl\\n$CMD
157
  echo -e \\n\*\*\* Parse tpl: $model.tpl\\n$CMD
158 158
  eval $CMD
159 159

  
160 160
  if [ ! -f $model.cpp -o ! -f $model.htp ]; then
......
172 172
    exit 1
173 173
  fi
174 174

  
175
  CMD="$CXX -c $CXXFLAGS $file"
176
  echo -e \\n\*\*\* Compiling source file: $file\\n$CMD
175
  fileobj=${file%.*}.obj
176
  CMD="$CXX -c $CXXFLAGS -o$fileobj $file"
177
  echo -e \\n\*\*\* Compile $file:\\n$CMD
177 178
  eval $CMD
178 179

  
179
  if [[ ! -f ${file%.*}.o ]]; then
180
  if [[ ! -f $fileobj ]]; then
180 181
    echo -e "\\nError: Could not compile $file\\n"
181 182
    exit 1
182 183
  fi
183
  tplobjs="$tplobjs ${file%.*}.o"
184
  tplobjs="$tplobjs $fileobj"
184 185
done
185 186

  
186 187
for file in $srcs
......
189 190
    echo -e "\\nError: $file not found\\n"
190 191
    exit 1
191 192
  fi
192
  CMD="$CXX -c $CXXFLAGS $file"
193
  echo -e \\n\*\*\* Compiling source file: $file\\n$CMD
193
  fileobj=${file%.*}.obj
194
  CMD="$CXX -c $CXXFLAGS -o$fileobj $file"
195
  echo -e \\n\*\*\* Compile $file: \\n$CMD
194 196
  eval $CMD
195
  if [[ ! -f ${file%.*}.o ]]; then
197
  if [[ ! -f $fileobj ]]; then
196 198
    echo -e "\\nError: Could not compile $file\\n"
197 199
    exit 1
198 200
  fi
199
  objs="${file%.*}.o $objs"
201
  if [ ! -z "$objs" ]; then
202
    objs="$fileobj $objs"
203
  else
204
    objs="$fileobj"
205
  fi
200 206
done
201 207

  
202 208
if [ ! -z "$compileonly" ]; then
......
204 210
  if [ ! -z "$objs" ]; then
205 211
    objects=$objs
206 212
  fi
207
  echo -e "\\nSuccessfully compiled \"$objects\".\\n"
213
  echo -e "\\nCompiled $objects.\\n"
208 214
  exit 0
209 215
fi 
210 216

  
......
216 222
    model=${file%.*}
217 223
  fi
218 224
  if [ ! -z  "$dll" ]; then
219
    CMD="$CXX $LDFLAGS -o $model.so"
225
    CMD="$CXX $LDFLAGS -o$model.so"
220 226
  else
221
    CMD="$CXX $LDFLAGS -o $model"
227
    CMD="$CXX $LDFLAGS -o$model"
222 228
  fi
223 229
  CMD="$CMD $file $objs"
224 230
  if [[ "$library" == "opt" ]]; then
......
226 232
  else
227 233
    CMD="$CMD \"$ADMB_HOME\"/contrib/lib/libcontrib.a \"$ADMB_HOME\"/lib/libadmb.a"
228 234
  fi
229
  echo -e \\n\*\*\* Linking files: $file $objs\\n$CMD
235
  echo -e \\n\*\*\* Linking $file $objs:\\n$CMD
230 236
  eval $CMD
231 237
  if [[ -z $dll ]]; then 
232 238
    if [[ ! -f $model ]]; then 
......
253 259
    if [ "$extension" = "o" -o "$extension" = "obj" ]; then
254 260
      listobjs="$listobjs $file"
255 261
    else
256
      listobjs="$listobjs ${file%.*}.o"
262
      listobjs="$listobjs ${file%.*}.obj"
257 263
    fi
258 264
    if [ -z  "$outputfilebasename" ]; then
259 265
      outputfilebasename="`basename $file`"
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff