Changeset 1642
- Timestamp:
- 08/11/09 11:53:16 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/EnumDefinitions/SynchronizeMatlabEnum.sh
r1296 r1642 7 7 echo "Synchronizong with Matlab's Enums..." 8 8 cat EnumDefinitions.cpp | grep "return" | grep "int" | awk '{ printf "line%so %s\n", NR, $0 }' | sed -e "s/(void){//" > temp 9 cat <<END > AnalysisTypeAsEnum.m 10 function string=AnalysisTypeAsEnum(enum) 11 %ANALYSISASENUM - get analysis type from Enum 12 % 13 % file generated by src/c/SynchronizeMatlabEnum 14 % to be synchronized with the corresponding C Enum 15 % located in src/c/EnumDefinitions 16 % 17 % Usage: 18 % string=AnalysisTypeAsEnum(enum) 19 END 9 20 10 21 #get number of lines in temp … … 20 31 21 32 #write corresponding Matlab file 22 cat <<END > `echo $NAME.m`33 cat <<END > $(echo $NAME.m) 23 34 function macro=$(echo $NAME)() 24 35 %$(echo `echo $NAME | sed -e "s/[a-z]/\U&/g"`) - Enum of $(echo `echo $NAME | sed -e "s/Enum//"`) 25 36 % 37 % file generated by src/c/SynchronizeMatlabEnum 26 38 % to be synchronized with the corresponding C Enum 27 39 % located in src/c/EnumDefinitions 28 40 % 29 41 % Usage: 30 % macro=$ (echo $NAME)()42 % macro=$NAME() 31 43 32 macro=$(echo $ENUM) 44 macro=$ENUM 45 END 46 47 #update AnalysisTypeAsEnum 48 cat <<END >> AnalysisTypeAsEnum.m 49 50 if enum==$NAME(), 51 string='$(echo `echo $NAME | sed -e "s/AnalysisEnum//g" | awk {'print tolower($_)'}`)'; 52 end 33 53 END 34 54 … … 39 59 40 60 #clean up 61 mv AnalysisTypeAsEnum.m $ISSM_DIR/src/m/shared/ 41 62 rm temp
Note:
See TracChangeset
for help on using the changeset viewer.