![]() ![]() | ![]() |
- new random distribution functions
1: #!/bin/sh 2: 3: VER=5.1 4: BUGFIX=0 5: TEST_DIR=testing7 6: CC="cc" # -DDMALLOC -DDMALLOC_FUNC_CHECK" 7: 8: #FLEX="/usr/user1/capadvt/BIN/flex -Cfa -s" 9: #FLEX="flex -Cfa -s" 10: FLEX="/usr/user1/capadvt/BIN/flex -Cfa -s" 11: #YACC="/usr/bin/byacc" 12: YACC="/usr/user1/capadvt/BIN/bison" 13: MV="mv" 14: 15: 16: #echo "${CC}" 17: ARCH=`uname` 18: #echo "${ARCH}" 19: # have to put " around the multiple line string 20: 21: PAR_OBJ="${ARCH}/capaCommon.o ${ARCH}/capaLexerFun.o \ 22: ${ARCH}/capaParserFun.o ${ARCH}/capaFunction.o ${ARCH}/capaParserUtils.o \ 23: ${ARCH}/capaMapExpr.o ${ARCH}/capaUnit.o ${ARCH}/com.o ${ARCH}/linpack.o ${ARCH}/ranlib.o \ 24: ${ARCH}/capaCgiUtils.o ${ARCH}/capaRQO.o ${ARCH}/capaFormulaLexer.o ${ARCH}/capaFormulaParser.o \ 25: ${ARCH}/capaSubjective.o" 26: 27: #echo "OBJ:${PAR_OBJ}" 28: 29: 30: prefix="" 31: CCFLAG="-g -DUSE_DYNAMIC_SYMBOLS" 32: 33: PLIBS="-ll -lm -lcurses -ltermcap" 34: 35: 36: 37: if [ ${ARCH} = "AIX" ] 38: then 39: CCFLAG="-O3 -DAIX" 40: fi 41: 42: if [ ${ARCH} = "OSF1" ] 43: then 44: #CCFLAG="-O3 -Olimit 1024 -DUSE_DYNAMIC_SYMBOLS -DUSE_DYNAMIC_LEXBUFS" 45: CCFLAG="-O3 -Olimit 2048 -DUSE_DYNAMIC_SYMBOLS -DCAPA_VER=\"${VER}.${BUGFIX}\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y'`\"" 46: fi 47: 48: if [ ${ARCH} = "NEXTSTEP" ] 49: then 50: CCFLAG="-arch i386 -arch m68k" 51: fi 52: 53: if [ ${ARCH} = "SunOS" ] 54: then 55: CCFLAG="-xO3" 56: fi 57: 58: if [ ${ARCH} = "HP-UX" ] 59: then 60: CCFLAG="-O -Ae -Dhpux" 61: fi 62: 63: if [ ${ARCH} = "IRIX" ] 64: then 65: CCFLAG="-O2 -DIRIX" 66: fi 67: 68: 69: # echo "ALL: $*" 70: # echo "ONE: $1" 71: # echo "TWO: $2" 72: 73: compileUnits() 74: { 75: 76: ofile="${ARCH}/capaUnit.o" 77: cfile="capaUnit.c" 78: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 79: echo $cmd 80: $cmd 81: } 82: 83: lexCAPA() 84: { 85: echo "${FLEX} capaLexerDef.flex" 86: # 87: ${FLEX} capaLexerDef.flex 88: 89: echo "mv lex.yy.c capaLexerFun.c" 90: mv lex.yy.c capaLexerFun.c 91: 92: ofile="${ARCH}/capaLexerFun.o" 93: cfile="capaLexerFun.c" 94: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 95: echo $cmd 96: $cmd 97: } 98: 99: lexCAPAdmalloc() 100: { 101: echo "${FLEX} capaLexerDef.flex" 102: # 103: ${FLEX} capaLexerDef.flex 104: 105: echo "mv lex.yy.c capaLexerFun.c" 106: mv lex.yy.c capaLexerFun.c 107: 108: ofile="${ARCH}/capaLexerFun.o" 109: cfile="capaLexerFun.c" 110: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 111: echo $cmd 112: $cmd 113: } 114: 115: lexdbug() 116: { 117: echo "${FLEX} capaLexerDef.flex" 118: # 119: ${FLEX} capaLexerDef.flex 120: 121: echo "mv lex.yy.c capaLexerFun.c" 122: mv lex.yy.c capaLexerFun.c 123: 124: ofile="${ARCH}/capaLexerFun.o" 125: cfile="capaLexerFun.c" 126: cmd="${CC} $CCFLAG -DLEX_DBUG -c $cfile -o $ofile" 127: echo $cmd 128: $cmd 129: } 130: 131: yaccCAPA() 132: { 133: echo "${YACC} capaGrammarDef.y 134: # -ocapaParserFun.c" 135: # 136: ${YACC} -d capaGrammarDef.y 137: # mv y.tab.c capaParserFun.c 138: echo "mv capaGrammarDef.tab.c capaParserFun.c" 139: mv capaGrammarDef.tab.c capaParserFun.c 140: 141: ofile="${ARCH}/capaParserFun.o" 142: cfile="capaParserFun.c" 143: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 144: echo $cmd 145: $cmd 146: } 147: 148: yaccCAPAdmalloc() 149: { 150: echo "${YACC} capaGrammarDef.y 151: # -ocapaParserFun.c" 152: # 153: ${YACC} -d capaGrammarDef.y 154: echo "mv y.tab.c capaParserFun.c" 155: mv y.tab.c capaParserFun.c 156: 157: ofile="${ARCH}/capaParserFun.o" 158: cfile="capaParserFun.c" 159: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 160: echo $cmd 161: $cmd 162: } 163: 164: yaccdbug() 165: { 166: echo "${YACC} capaGrammarDef.y -ocapaParserFun.c" 167: # 168: ${YACC} -d capaGrammarDef.y 169: 170: #-ocapaParserFun.c 171: 172: # echo "mv y.tab.c capaParserFun.c" 173: # mv y.tab.c capaParserFun.c 174: # echo "mv y.tab.h capaToken.h" 175: # mv y.tab.h capaToken.h 176: 177: echo "mv capaGrammarDef.tab.c capaParserFun.c" 178: mv capaGrammarDef.tab.c capaParserFun.c 179: 180: ofile="${ARCH}/capaParserFun.o" 181: cfile="capaParserFun.c" 182: cmd="${CC} $CCFLAG -DYACC_DBUG -c $cfile -o $ofile" 183: echo $cmd 184: $cmd 185: } 186: 187: formulaParser() 188: { 189: 190: echo "${YACC} -p fml_ -d capaFormula.y" 191: ${YACC} -b fma -p fml_ -d capaFormula.y 192: 193: echo "MV fma.tab.c capaFormulaParser.c" 194: echo "MV fma.tab.h capaFormula.h" 195: 196: ${MV} fma.tab.c capaFormulaParser.c 197: ${MV} fma.tab.h capaFormula.h 198: 199: ofile="${ARCH}/capaFormulaParser.o" 200: cfile="capaFormulaParser.c" 201: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 202: echo $cmd 203: $cmd 204: 205: } 206: 207: formulaDbug() 208: { 209: 210: echo "YACC -p fml_ -d capaFormula.y" 211: ${YACC} -b fma -p fml_ -d capaFormula.y 212: 213: echo "MV fma.tab.c capaFormulaParser.c" 214: echo "MV fma.tab.h capaFormula.h" 215: 216: ${MV} fma.tab.c capaFormulaParser.c 217: ${MV} fma.tab.h capaFormula.h 218: 219: ofile="${ARCH}/capaFormulaParser.o" 220: cfile="capaFormulaParser.c" 221: cmd="${CC} $CCFLAG -DFML_DBUG -c $cfile -o $ofile" 222: echo $cmd 223: $cmd 224: 225: ofile="${ARCH}/capaParserUtils.o" 226: cfile="capaParserUtils.c" 227: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 228: echo $cmd 229: $cmd 230: } 231: 232: 233: 234: symboldbug() 235: { 236: echo "${YACC} capaGrammarDef.y " 237: # 238: ${YACC} capaGrammarDef.y 239: 240: echo "mv y.tab.c capaParserFun.c" 241: # 242: mv y.tab.c capaParserFun.c 243: 244: ofile="${ARCH}/capaParserFun.o" 245: cfile="capaParserFun.c" 246: cmd="${CC} $CCFLAG -DSYMBOL_DBUG -c $cfile -o $ofile" 247: echo $cmd 248: $cmd 249: ofile="${ARCH}/capaParserUtils.o" 250: cfile="capaParserUtils.c" 251: cmd="${CC} $CCFLAG -DSYMBOL_DBUG -c $cfile -o $ofile" 252: echo $cmd 253: $cmd 254: # ofile="${ARCH}/capaFunction.o" 255: # cfile="capaFunction.c" 256: # cmd="${CC} $CCFLAG -DSYMBOL_DBUG -c $cfile -o $ofile" 257: # echo $cmd 258: # $cmd 259: } 260: 261: dynamicsymbol() 262: { 263: echo "${FLEX} capaLexerDef.flex" 264: # 265: ${FLEX} capaLexerDef.flex 266: 267: echo "mv lex.yy.c capaLexerFun.c" 268: # 269: mv lex.yy.c capaLexerFun.c 270: 271: ofile="${ARCH}/capaLexerFun.o" 272: cfile="capaLexerFun.c" 273: cmd="${CC} $CCFLAG -DUSE_DYNAMIC_SYMBOLS -c $cfile -o $ofile" 274: echo $cmd 275: $cmd 276: ofile="${ARCH}/capaParserUtils.o" 277: cfile="capaParserUtils.c" 278: cmd="${CC} $CCFLAG -DUSE_DYNAMIC_SYMBOLS -c $cfile -o $ofile" 279: echo $cmd 280: $cmd 281: ofile="${ARCH}/capaCommon.o" 282: cfile="capaCommon.c" 283: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 284: echo $cmd 285: $cmd 286: } 287: 288: arraysymbol() 289: { 290: echo "${FLEX} capaLexerDef.flex" 291: # 292: ${FLEX} capaLexerDef.flex 293: 294: echo "mv lex.yy.c capaLexerFun.c" 295: # 296: mv lex.yy.c capaLexerFun.c 297: 298: ofile="${ARCH}/capaLexerFun.o" 299: cfile="capaLexerFun.c" 300: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 301: echo $cmd 302: $cmd 303: ofile="${ARCH}/capaParserUtils.o" 304: cfile="capaParserUtils.c" 305: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 306: echo $cmd 307: $cmd 308: ofile="${ARCH}/capaCommon.o" 309: cfile="capaCommon.c" 310: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 311: echo $cmd 312: $cmd 313: } 314: 315: CAPAParserUtilsdbug() 316: { 317: ofile="${ARCH}/capaParserUtils.o" 318: cfile="capaParserUtils.c" 319: cmd="${CC} $CCFLAG -DPARSER_DBUG -c $cfile -o $ofile" 320: echo $cmd 321: $cmd 322: } 323: 324: Ranlib() 325: { 326: ofile="${ARCH}/ranlib.o" 327: cfile="ranlib.c" 328: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 329: echo $cmd 330: $cmd 331: } 332: 333: CAPAParserUtils() 334: { 335: ofile="${ARCH}/capaParserUtils.o" 336: cfile="capaParserUtils.c" 337: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 338: echo $cmd 339: $cmd 340: } 341: 342: CAPAFunction() 343: { 344: ofile="${ARCH}/capaFunction.o" 345: cfile="capaFunction.c" 346: cmd="${CC} $CCFLAG -c $cfile -o $ofile" 347: echo $cmd 348: $cmd 349: } 350: createCAPAlib() 351: { 352: 353: if [ -f ${ARCH}/libcapa${VER}.a ] 354: then 355: rm ${ARCH}/libcapa${VER}.a 356: fi 357: 358: echo "ar q ${ARCH}/libcapa${VER}.a ${PAR_OBJ}" 359: 360: ar q ${ARCH}/libcapa${VER}.a ${PAR_OBJ} 361: 362: } 363: 364: compileLexTest() 365: { 366: if [ -f ${TEST_DIR}/testL ] 367: then 368: rm ${TEST_DIR}/testL 369: fi 370: 371: (cd ${TEST_DIR}; make testL) 372: 373: } 374: 375: compileParseTest() 376: { 377: if [ -f ${TEST_DIR}/testP ] 378: then 379: rm ${TEST_DIR}/testP 380: fi 381: 382: (cd ${TEST_DIR}; make testP) 383: 384: } 385: 386: compileParseTestDmalloc() 387: { 388: if [ -f ${TEST_DIR}/testP ] 389: then 390: rm ${TEST_DIR}/testP 391: fi 392: 393: (cd ${TEST_DIR}; make testPdmalloc) 394: 395: } 396: 397: compileLoginTest() 398: { 399: if [ -f ${TEST_DIR}/testLogin ] 400: then 401: rm ${TEST_DIR}/testLogin 402: fi 403: 404: ofile="${ARCH}/capaLoginTest.o" 405: cfile="capalogin.c" 406: cmd="${CC} $CCFLAG -DLOGIN_DBUG -c $cfile -o $ofile" 407: echo $cmd 408: $cmd 409: 410: cmd="${CC} $CCFLAG -Wall ${ARCH}/libcapa${VER}.a $ofile -L${ARCH} -lcapa${VER} ${PLIBS} -o ${TEST_DIR}/testLogin" 411: echo $cmd 412: $cmd 413: 414: } 415: 416: compileFormulaTest() 417: { 418: if [ -f ${TEST_DIR}/testFormula ] 419: then 420: rm ${TEST_DIR}/testFormula 421: fi 422: 423: ofile="${ARCH}/capaTestFormula.o" 424: cfile="${TEST_DIR}/tformula_main.c" 425: cmd="${CC} $CCFLAG -DLOGIN_DBUG -I. -I.. -c $cfile -o $ofile" 426: echo $cmd 427: $cmd 428: 429: cmd="${CC} $CCFLAG ${ARCH}/libcapa${VER}.a $ofile -L${ARCH} -lcapa${VER} ${PLIBS} -o 430: ${TEST_DIR}/testFormula" 431: echo $cmd 432: $cmd 433: 434: } 435: 436: for i in $* ; do 437: case "$i" in 438: *FP) 439: formulaParser 440: ;; 441: *LD) 442: lexCAPAdmalloc 443: ;; 444: *X|*x) 445: lexdbug 446: ;; 447: *L|*l) 448: lexCAPA 449: ;; 450: *P|*p) 451: yaccdbug 452: ;; 453: *Y|*y) 454: yaccCAPA 455: ;; 456: *R|*r) 457: Ranlib 458: ;; 459: *PD) 460: CAPAParserUtilsdbug 461: ;; 462: *PU|*pu) 463: CAPAParserUtils 464: ;; 465: *SS) 466: symboldbug 467: ;; 468: *DS) 469: dynamicsymbol 470: ;; 471: *AS) 472: arraysymbol 473: ;; 474: *D) 475: formulaDbug 476: ;; 477: *F|*f) 478: CAPAFunction 479: ;; 480: *lib|*Lib) 481: createCAPAlib 482: ;; 483: *PT|*pt) 484: compileParseTest 485: ;; 486: esac 487: done 488: 489: exit 0 490: