1#!/usr/local/bin/bash
2
3rm -f model.c
4rm -f $2
5
6echo "Creating model.c file from $1 ..."
7mod $1
8
9shopt -s extglob
10
11if test $2;
12 then target=$2;
13 else target=mcsim.${1%.mod?('el')};
14fi;
15
16if test -f model.c; then \
17
18	echo; \
19	echo "Compiling and linking model for debugging ..."; \
20	@CC@ -DDEBUG -g -I@prefix@/include model.c @prefix@/share/mcsim/sim/*.c -o $target @LIBS@ -Wall; \
21
22fi;
23
24if test -f $target; then \
25
26	echo "Created executable $target with debugging symbols"; \
27	echo; \
28
29fi;
30