source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks/utilities/create_cpped_version.sh

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100755
File size: 968 bytes
Line 
1#!/bin/sh
2## create_cpped_version.sh for in /Users/pouchet
3##
4## Made by Louis-Noel Pouchet
5## Contact: <pouchet@cse.ohio-state.edu>
6## License: /LICENSE.OSU.txt
7##
8## Started on Mon Oct 31 16:20:01 2011 Louis-Noel Pouchet
9## Last update Mon Oct 31 20:42:35 2011 Louis-Noel Pouchet
10##
11
12if [ $# -lt 1 ]; then
13 echo "Usage: create_cpped_version.sh <file.c> [gcc -E flags]";
14 exit 1;
15fi;
16args="$2";
17file="$1";
18head -n 12 $file > .__poly_top.c;
19tail -n +12 $file > .__poly_bottom.c;
20filename=`echo "$file" | sed -e "s/\(.*\).c/\1/1"`;
21filenameorig=`basename $file`;
22benchdir=`dirname "$file"`;
23gcc -E .__poly_bottom.c -I $benchdir $args 2>/dev/null > .__tmp_poly.c
24sed -e "/^[ ]*;[ ]*$/d" .__tmp_poly.c | sed -e "s~.__poly_bottom.c~$filenameorig~g" > .__poly_bottom.c;
25cat .__poly_top.c > $filename.preproc.c;
26echo "#include <polybench.h>\n" >> $filename.preproc.c;
27cat .__poly_bottom.c >> $filename.preproc.c;
28rm -f .__tmp_poly.c .__poly_bottom.c .__poly_top.c;
29
Note: See TracBrowser for help on using the repository browser.