NCBI C++ Toolkit Cross Reference

C++/compilers/msvc800_prj/install.sh


  1 #! /bin/sh
  2 # $Id: install.sh 152079 2009-02-11 12:47:14Z ivanov $
  3 # Authors:  Denis Vakatov    (vakatov@ncbi.nlm.nih.gov)
  4 #           Anton Lavrentiev (lavr@ncbi.nlm.nih.gov)
  5 #
  6 # Deploy sources, headers, libraries and executables for the further use
  7 # by the "external" users' projects
  8 
  9 
 10 # Cmd.-line args  -- source and destination
 11 script="$0"
 12 builddir="$1"
 13 target="$2"
 14 compiler="${3:-msvc800}"
 15 compiler="${compiler}_prj"
 16 
 17 # Real number of argument is 2.
 18 # The 3th argument do not used here (32|64-bit architecture),
 19 # but is needed for master installation script.
 20 if test -n "$4" ; then
 21   echo "USAGE:  `basename $script` [build_dir] [install_dir]"
 22 fi
 23 
 24 
 25 error()
 26 {
 27   echo "[`basename $script`] ERROR:  $1"
 28   exit 1
 29 }
 30 
 31 
 32 makedir()
 33 {
 34   test -d "$1"  ||  mkdir $2 "$1"  ||  error "Cannot create \"$1\""
 35 }
 36 
 37 
 38 echo "[`basename $script`] NCBI C++:  \"$builddir\" to \"$target\"..."
 39 
 40 
 41 # Derive the destination dirs
 42 docdir="$target"/doc
 43 scriptdir="$target"/scripts
 44 incdir="$target"/include
 45 srcdir="$target"/src
 46 libdir="$target"/lib
 47 bindir="$target"/bin
 48 cldir="$target"/compilers
 49 logdir="$target"/logs
 50 tmpdir="$target"/tmp
 51 
 52 
 53 install()
 54 {
 55     test -d "$1"  ||  return;
 56     makedir "$2" -p
 57     tmp_cwd=`pwd`
 58     cd "$1"
 59     find . -type f |
 60     grep -v '/\.svn/' > "$tmpdir"/flist
 61     tar cf - -T "$tmpdir"/flist | (cd "$2" ; tar xf - )
 62     cd "$tmp_cwd"
 63 }
 64 
 65 
 66 
 67 # Check
 68 test -d "$builddir"  ||  error "Absent build dir \"$builddir\""
 69 
 70 
 71 # Reset the public directory
 72 test -d "$target"  &&  find "$target" -type f -exec rm -f {} \; >/dev/null 2>&1
 73 makedir "$target" -p
 74 makedir "$tmpdir" -p
 75 
 76 
 77 # Documentation
 78 echo "[`basename $script`] Installing documentation..."
 79 install "$builddir/doc" "$docdir"
 80 
 81 # Scripts
 82 echo "[`basename $script`] Installing scripts..."
 83 install "$builddir/scripts" "$scriptdir"
 84 
 85 # Include dir
 86 echo "[`basename $script`] Installing include files..."
 87 install "$builddir/include" "$incdir"
 88 
 89 # Source dir
 90 echo "[`basename $script`] Installing source files..."
 91 install "$builddir/src" "$srcdir"
 92 
 93 # Build logs
 94 echo "[`basename $script`] Installing build logs..."
 95 install "$builddir/logs" "$logdir"
 96 
 97 rm -rf "$tmpdir"
 98 
 99 
100 # Libraries
101 echo "[`basename $script`] Installing libraries..."
102 for i in 'Debug' 'Release' ; do
103   for j in '' 'DLL' ; do
104     for b in 'static' 'dll' ; do
105 
106       if test -d "$builddir"/compilers/$compiler/$b/lib/$i$j ; then
107         makedir "$libdir/$b/$i$j" -p
108         cd "$builddir"/compilers/$compiler/$b/lib/$i$j
109         cp -p *.lib "$libdir/$b/$i$j"
110       fi
111       if test "$b"=='dll' ; then
112         if test -d "$builddir"/compilers/$compiler/$b/bin/$i$j ; then
113           makedir "$libdir/$b/$i$j" -p
114           cd "$builddir"/compilers/$compiler/$b/bin/$i$j
115           cp -p *.lib *.dll *.exp "$libdir/$b/$i$j"
116         fi
117       fi
118     done
119   done
120 done
121 
122 
123 # Executables
124 echo "[`basename $script`] Installing executables..."
125 makedir "$bindir" -p
126 for i in 'DLL' '' ; do
127   if test -d "$builddir"/compilers/$compiler/static/bin/Release$i ; then
128     cd "$builddir"/compilers/$compiler/static/bin/Release$i
129     if ls *.exe >/dev/null 2>&1 ; then
130       cp -p *.exe *.dll *.exp "$bindir"
131       break
132     fi
133   fi
134 done
135 
136 
137 # Install additional files (scripts and etc) into binary directory
138 cp -p "$builddir"/src/app/blast/legacy_blast.pl "$bindir"
139 
140 
141 # Gbench public installation
142 echo "[`basename $script`] Installing Gbench..."
143 for i in ReleaseDLL DebugDLL; do
144   if test -d "$builddir"/compilers/$compiler/dll/bin/"$i" ; then
145     cp -pr "$builddir"/compilers/$compiler/dll/bin/$i/gbench "$bindir"
146     break
147   fi
148 done
149 
150 
151 # Compiler dir (copy all .pdb and configurable files files for debug purposes)
152 echo "[`basename $script`] Installing .pdb files..."
153 makedir "$cldir" -p
154 pdb_files=`find "$builddir"/compilers -type f -a \( -name '*.pdb' -o  -name '*.c' -o  -name '*.cpp' \) 2>/dev/null`
155 cd "$cldir"
156 for pdb in $pdb_files ; do
157   rel_dir=`echo $pdb | sed -e "s|$builddir/compilers/||" -e 's|/[^/]*$||'`
158   makedir "$rel_dir" -p
159   cp -pr "$pdb" "$rel_dir"
160 done
161 
162 # Compiler dir (other common stuff)
163 makedir "$cldir"/$compiler/static -p
164 makedir "$cldir"/$compiler/dll -p
165 cp -p "$builddir"/compilers/$compiler/*        "$cldir"/$compiler
166 cp -p "$builddir"/compilers/$compiler/static/* "$cldir"/$compiler/static
167 cp -p "$builddir"/compilers/$compiler/dll/*    "$cldir"/$compiler/dll
168 
169 # Copy info files
170 cp -p "$builddir"/*_info "$target"
171 
172 exit 0

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.