File: nrnocmodl.in

package info (click to toggle)
neuron 8.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,760 kB
  • sloc: cpp: 149,571; python: 58,465; ansic: 50,329; sh: 3,510; xml: 213; pascal: 51; makefile: 35; sed: 5
file content (72 lines) | stat: -rwxr-xr-x 1,238 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
libdir=@libdir@
LIBOBJDIR=${libdir}
MAKEFILEDIR=${bindir}
ARCH=@host_cpu@
MODSUBDIR=@modsubdir@

if [ ! -d $MODSUBDIR ]
then
	echo "Creating $MODSUBDIR directory for .o files."
	echo
	mkdir $MODSUBDIR
fi

if test $# -gt 0 ; then
	files=$*
else
	files=`echo *.mod`
fi

files=`echo "$files" | sed s/\.mod//g`

if test "$files" = '*' ; then
	files=""
fi

cd $MODSUBDIR
for i in $files; do
    rm -f $i.mod
    ln -s ../$i.mod .
done

MODOBJS=
if [ `echo "\n"` ]
then
	newline="\n"
else
	newline="\\\\n"
fi

echo '#include <stdio.h>
#include "hocdec.h"
#if defined(__cplusplus)
extern "C"
#endif
modl_reg(){
	NOT_PARALLEL_SUB(fprintf(stderr, "Additional mechanisms from files'$newline'");)
' > mod_func.cpp

for i in $files
do
	echo 'NOT_PARALLEL_SUB(fprintf(stderr," '$i'.mod");)' >>mod_func.cpp
done
echo 'NOT_PARALLEL_SUB(fprintf(stderr, "'$newline'");)' >>mod_func.cpp

for i in $files
do
	echo _"$i"_reg"();" >> mod_func.cpp
	MODOBJS="$MODOBJS $i.o"
done
echo "}" >> mod_func.cpp

echo '
#if defined(__cplusplus)
}
#endif' >> mod_func.cpp

make -f $MAKEFILEDIR/nrnoc_makefile "MODOBJFILES=$MODOBJS" special &&
  echo "Successfully created $MODSUBDIR/special"