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