File: do-self-rep.sh

package info (click to toggle)
asis 2014-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,064 kB
  • ctags: 37
  • sloc: ada: 146,541; makefile: 364; sh: 50; xml: 48; csh: 10
file content (24 lines) | stat: -rwxr-xr-x 987 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash -ve
#  v = verbose (echo lines as read)
#  e = stop on errors

# Called from Makefile. The single argument is the name of the Ada file. The
# file processed is stage/2/self_rep/$1.self_rep.ada. These files are created
# by xml2gnat. Each contains a program called Self_Replicate which (if all the
# translations are working properly) should print a copy of itself. This script
# builds and runs the program, and compares the output with its own source
# code.

echo "Doing  do-self-rep"

# Need to delete previous version, because they all have the same name, and
# often have the same timestamp.
rm -f self_replicate self_replicate.out obj/self_replicate.ali obj/self_replicate.o

# Generate stage/2/self_rep/self_replicate.adb:
gnatchop -w -gnat2012 stage/2/self_rep/$1.self_rep.ada stage/2/self_rep

# Build, run, compare output:
gnatmake -P self_rep.gpr self_replicate.adb
./self_replicate > self_replicate.out
diff stage/2/self_rep/self_replicate.adb self_replicate.out