| [968] | 1 | #!/bin/csh | 
|---|
| [1834] | 2 | # $Id: mkmflien,v 1.12 2001-12-19 18:34:11 ansari Exp $ | 
|---|
| [218] | 3 |  | 
|---|
| [968] | 4 | # WARNING : mkmflien has to be runned FROM Mgr/ | 
|---|
| [1493] | 5 | # usage : mkmflien [-copy] [dir_dest] | 
|---|
| [968] | 6 | #  -copy : includes are copied (if not they are linked) | 
|---|
| [1493] | 7 | #  -clean : after copy/link file are deleted if not existing (empty link) | 
|---|
| [968] | 8 | #  dir_dest : link/copy to dir_dest/ | 
|---|
|  | 9 | #             default : $DPCDEVREP/Include | 
|---|
| [218] | 10 |  | 
|---|
| [968] | 11 | ####################### | 
|---|
|  | 12 | #### Decodage arguments | 
|---|
|  | 13 | ####################### | 
|---|
|  | 14 | unset dst | 
|---|
|  | 15 | set cpln = "ln -sf" | 
|---|
| [1493] | 16 | unset clln | 
|---|
| [968] | 17 | if( $?DPCDEVREP ) then | 
|---|
|  | 18 | set dst = $DPCDEVREP/Include | 
|---|
|  | 19 | endif | 
|---|
|  | 20 |  | 
|---|
|  | 21 | while( $#argv > 0 ) | 
|---|
|  | 22 | if( "$1" == "-copy" ) then | 
|---|
|  | 23 | set cpln = "cp" | 
|---|
| [1493] | 24 | else if( "$1" == "-clean" ) then | 
|---|
|  | 25 | set clln | 
|---|
| [968] | 26 | else | 
|---|
|  | 27 | set dst = $1 | 
|---|
|  | 28 | endif | 
|---|
|  | 29 | shift | 
|---|
|  | 30 | end | 
|---|
|  | 31 |  | 
|---|
|  | 32 | if( ! $?dst ) then | 
|---|
|  | 33 | echo "Variable DPCDEVREP must be set" | 
|---|
|  | 34 | echo "OR you must give a directory for linking/copying" | 
|---|
|  | 35 | exit -1 | 
|---|
|  | 36 | endif | 
|---|
|  | 37 |  | 
|---|
| [218] | 38 | ############################################################# | 
|---|
|  | 39 | #### repertoire contenant les liens a creer pour les includes | 
|---|
|  | 40 | ############################################################# | 
|---|
|  | 41 | if ( ! -d $dst/ ) then | 
|---|
|  | 42 | echo repertoire $dst inconnu | 
|---|
|  | 43 | exit -1 | 
|---|
|  | 44 | endif | 
|---|
|  | 45 |  | 
|---|
| [968] | 46 | ######################################################### | 
|---|
|  | 47 | #### repertoire contenant les repertoires du code+include | 
|---|
|  | 48 | ######################################################### | 
|---|
|  | 49 | pushd ../. > /dev/null | 
|---|
|  | 50 | set src = `pwd | sed 's?/tmp_mnt??'` | 
|---|
|  | 51 | set src = `echo $src | sed 's?/.automount/dapservfic/root??'` | 
|---|
|  | 52 | popd       > /dev/null | 
|---|
| [915] | 53 |  | 
|---|
| [218] | 54 | ######################################################### | 
|---|
|  | 55 | ### Les includes a mettre dans Include pour les Makefiles | 
|---|
|  | 56 | ######################################################### | 
|---|
| [968] | 57 | if( -d $src/Mgr ) then | 
|---|
|  | 58 | cd $src/Mgr/. | 
|---|
|  | 59 | echo $cpln from Mgr | 
|---|
|  | 60 | set FILE = ( Makefile.h Makefile.slb MakefileUser.h ) | 
|---|
|  | 61 | pushd $dst/. > /dev/null | 
|---|
|  | 62 | rm -f $FILE | 
|---|
|  | 63 | foreach f ( $FILE ) | 
|---|
|  | 64 | if( -e $src/Mgr/$f ) then | 
|---|
|  | 65 | $cpln $src/Mgr/$f ./ | 
|---|
|  | 66 | endif | 
|---|
|  | 67 | end | 
|---|
|  | 68 | popd       > /dev/null | 
|---|
|  | 69 | endif | 
|---|
| [218] | 70 |  | 
|---|
| [968] | 71 | ############################################# | 
|---|
| [218] | 72 | ####  Les includes de Blitz++ lien ds Include | 
|---|
| [968] | 73 | ############################################# | 
|---|
| [248] | 74 | if( -d $src/Blitz ) then | 
|---|
| [968] | 75 | cd $src/Blitz/. | 
|---|
|  | 76 | foreach d ( blitz blitz/meta blitz/array ) | 
|---|
|  | 77 | if( -d $d ) then | 
|---|
|  | 78 | echo $cpln from Blitz/$d | 
|---|
|  | 79 | if( ! -d $dst/$d ) mkdir $dst/$d | 
|---|
|  | 80 | pushd $d > /dev/null | 
|---|
|  | 81 | set FILE = ( *.h *.cc ) | 
|---|
|  | 82 | popd     > /dev/null | 
|---|
|  | 83 | pushd $dst/$d/. > /dev/null | 
|---|
|  | 84 | rm -f $FILE | 
|---|
|  | 85 | $cpln $src/Blitz/$d/*.h ./ | 
|---|
|  | 86 | $cpln $src/Blitz/$d/*.cc ./ | 
|---|
|  | 87 | popd       > /dev/null | 
|---|
|  | 88 | endif | 
|---|
|  | 89 | end | 
|---|
| [218] | 90 | endif | 
|---|
|  | 91 |  | 
|---|
|  | 92 | #################################################### | 
|---|
|  | 93 | ####  Les includes du code C++ a mettre dans Include | 
|---|
|  | 94 | #################################################### | 
|---|
| [1834] | 95 | foreach d (`cat ../Mgr/libdirs` `cat ../Mgr/extlibdirs` `cat ../Mgr/PIlibdirs`   ) | 
|---|
| [218] | 96 | if ( -d $src/$d ) then | 
|---|
| [968] | 97 | cd $src/$d/. | 
|---|
|  | 98 | echo $cpln from $d | 
|---|
|  | 99 | set FILE = ( *.h ) | 
|---|
|  | 100 | pushd $dst/. > /dev/null | 
|---|
|  | 101 | rm -f $FILE | 
|---|
|  | 102 | $cpln $src/$d/*.h ./ | 
|---|
| [1261] | 103 | popd         > /dev/null | 
|---|
| [218] | 104 | endif | 
|---|
|  | 105 | end | 
|---|
|  | 106 |  | 
|---|
| [1261] | 107 | ###################################### | 
|---|
|  | 108 | ####  Le cas particulier de machdefs.h | 
|---|
|  | 109 | ###################################### | 
|---|
| [1603] | 110 | if ( -e $src/BaseTools/machdefs_mkmf.h ) then | 
|---|
|  | 111 | echo $cpln from BaseTools/machdefs_mkmf.h | 
|---|
|  | 112 | $cpln $src/BaseTools/machdefs_mkmf.h $dst/machdefs.h | 
|---|
| [1261] | 113 | endif | 
|---|
|  | 114 |  | 
|---|
| [1493] | 115 | ############################### | 
|---|
|  | 116 | ####  Nettoyage des liens vides | 
|---|
|  | 117 | ############################### | 
|---|
|  | 118 | if( $?clln ) then | 
|---|
|  | 119 | foreach f ( $dst/*.h ) | 
|---|
|  | 120 | if( ! -e $f ) then | 
|---|
|  | 121 | echo remove empty link : $f | 
|---|
|  | 122 | rm -f $f | 
|---|
|  | 123 | endif | 
|---|
|  | 124 | end | 
|---|
|  | 125 | endif | 
|---|
|  | 126 |  | 
|---|
| [218] | 127 | exit 0 | 
|---|