Annotation of capa/capa51/pProj/try.sh, revision 1.12
1.1 albertel 1: #!/bin/sh
1.8 albertel 2: # shell script to help automate genration of lexer parser files (OBSOLETE)
3: # Copyright (C) 1992-2000 Michigan State University
4: #
5: # The CAPA system is free software; you can redistribute it and/or
1.10 albertel 6: # modify it under the terms of the GNU General Public License as
1.8 albertel 7: # published by the Free Software Foundation; either version 2 of the
8: # License, or (at your option) any later version.
9: #
10: # The CAPA system is distributed in the hope that it will be useful,
11: # but WITHOUT ANY WARRANTY; without even the implied warranty of
12: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.10 albertel 13: # General Public License for more details.
1.8 albertel 14: #
1.10 albertel 15: # You should have received a copy of the GNU General Public
1.8 albertel 16: # License along with the CAPA system; see the file COPYING. If not,
17: # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1.9 albertel 18: # Boston, MA 02111-1307, USA.
19: #
20: # As a special exception, you have permission to link this program
21: # with the TtH/TtM library and distribute executables, as long as you
22: # follow the requirements of the GNU GPL in regard to all of the
23: # software in the executable aside from TtH/TtM.
1.1 albertel 24:
25: VER=5.1
26: BUGFIX=0
27: TEST_DIR=testing7
28: CC="cc" # -DDMALLOC -DDMALLOC_FUNC_CHECK"
29:
30: #FLEX="/usr/user1/capadvt/BIN/flex -Cfa -s"
1.6 albertel 31: FLEX="flex -Cfa -s"
32: #FLEX="/usr/user1/capadvt/BIN/flex -Cfa -s"
1.1 albertel 33: #YACC="/usr/bin/byacc"
1.6 albertel 34: #YACC="/usr/user1/capadvt/BIN/bison"
35: YACC="bison"
1.1 albertel 36: MV="mv"
37:
38:
39: #echo "${CC}"
40: ARCH=`uname`
41: #echo "${ARCH}"
42: # have to put " around the multiple line string
43:
44: PAR_OBJ="${ARCH}/capaCommon.o ${ARCH}/capaLexerFun.o \
45: ${ARCH}/capaParserFun.o ${ARCH}/capaFunction.o ${ARCH}/capaParserUtils.o \
46: ${ARCH}/capaMapExpr.o ${ARCH}/capaUnit.o ${ARCH}/com.o ${ARCH}/linpack.o ${ARCH}/ranlib.o \
47: ${ARCH}/capaCgiUtils.o ${ARCH}/capaRQO.o ${ARCH}/capaFormulaLexer.o ${ARCH}/capaFormulaParser.o \
48: ${ARCH}/capaSubjective.o"
49:
50: #echo "OBJ:${PAR_OBJ}"
51:
52:
53: prefix=""
54: CCFLAG="-g -DUSE_DYNAMIC_SYMBOLS"
55:
1.12 ! albertel 56: PLIBS="-ll -lm -lcurses "
1.1 albertel 57:
58:
59:
60: if [ ${ARCH} = "AIX" ]
61: then
62: CCFLAG="-O3 -DAIX"
1.12 ! albertel 63: fi
! 64:
! 65: if [ ${ARCH} = "Linux" ]
! 66: then
! 67: CCFLAG="-g -DUSE_DYNAMIC_SYMBOLS -DCAPA_VER=\"${VER}.${BUGFIX}\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y'`\""
1.1 albertel 68: fi
69:
70: if [ ${ARCH} = "OSF1" ]
71: then
72: #CCFLAG="-O3 -Olimit 1024 -DUSE_DYNAMIC_SYMBOLS -DUSE_DYNAMIC_LEXBUFS"
73: CCFLAG="-O3 -Olimit 2048 -DUSE_DYNAMIC_SYMBOLS -DCAPA_VER=\"${VER}.${BUGFIX}\" -DCOMPILE_DATE=\"`date +'%b-%d-%Y'`\""
74: fi
75:
76: if [ ${ARCH} = "NEXTSTEP" ]
77: then
78: CCFLAG="-arch i386 -arch m68k"
79: fi
80:
81: if [ ${ARCH} = "SunOS" ]
82: then
83: CCFLAG="-xO3"
84: fi
85:
86: if [ ${ARCH} = "HP-UX" ]
87: then
88: CCFLAG="-O -Ae -Dhpux"
89: fi
90:
91: if [ ${ARCH} = "IRIX" ]
92: then
93: CCFLAG="-O2 -DIRIX"
94: fi
95:
96:
97: # echo "ALL: $*"
98: # echo "ONE: $1"
99: # echo "TWO: $2"
100:
1.4 albertel 101: compileUnits()
102: {
103:
104: ofile="${ARCH}/capaUnit.o"
105: cfile="capaUnit.c"
106: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
107: echo $cmd
108: $cmd
109: }
110:
1.1 albertel 111: lexCAPA()
112: {
113: echo "${FLEX} capaLexerDef.flex"
114: #
115: ${FLEX} capaLexerDef.flex
116:
117: echo "mv lex.yy.c capaLexerFun.c"
118: mv lex.yy.c capaLexerFun.c
119:
120: ofile="${ARCH}/capaLexerFun.o"
121: cfile="capaLexerFun.c"
122: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
123: echo $cmd
124: $cmd
125: }
126:
127: lexCAPAdmalloc()
128: {
129: echo "${FLEX} capaLexerDef.flex"
130: #
131: ${FLEX} capaLexerDef.flex
132:
133: echo "mv lex.yy.c capaLexerFun.c"
134: mv lex.yy.c capaLexerFun.c
135:
136: ofile="${ARCH}/capaLexerFun.o"
137: cfile="capaLexerFun.c"
138: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
139: echo $cmd
140: $cmd
141: }
142:
1.5 albertel 143: lexdbug()
1.1 albertel 144: {
145: echo "${FLEX} capaLexerDef.flex"
146: #
147: ${FLEX} capaLexerDef.flex
148:
149: echo "mv lex.yy.c capaLexerFun.c"
150: mv lex.yy.c capaLexerFun.c
151:
152: ofile="${ARCH}/capaLexerFun.o"
153: cfile="capaLexerFun.c"
154: cmd="${CC} $CCFLAG -DLEX_DBUG -c $cfile -o $ofile"
155: echo $cmd
156: $cmd
157: }
158:
159: yaccCAPA()
160: {
161: echo "${YACC} capaGrammarDef.y
162: # -ocapaParserFun.c"
163: #
164: ${YACC} -d capaGrammarDef.y
1.4 albertel 165: # mv y.tab.c capaParserFun.c
166: echo "mv capaGrammarDef.tab.c capaParserFun.c"
167: mv capaGrammarDef.tab.c capaParserFun.c
1.1 albertel 168:
169: ofile="${ARCH}/capaParserFun.o"
170: cfile="capaParserFun.c"
171: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
172: echo $cmd
173: $cmd
174: }
175:
176: yaccCAPAdmalloc()
177: {
178: echo "${YACC} capaGrammarDef.y
179: # -ocapaParserFun.c"
180: #
181: ${YACC} -d capaGrammarDef.y
182: echo "mv y.tab.c capaParserFun.c"
183: mv y.tab.c capaParserFun.c
184:
185: ofile="${ARCH}/capaParserFun.o"
186: cfile="capaParserFun.c"
187: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
188: echo $cmd
189: $cmd
190: }
191:
1.5 albertel 192: yaccdbug()
1.1 albertel 193: {
194: echo "${YACC} capaGrammarDef.y -ocapaParserFun.c"
195: #
196: ${YACC} -d capaGrammarDef.y
197:
198: #-ocapaParserFun.c
199:
1.5 albertel 200: # echo "mv y.tab.c capaParserFun.c"
201: # mv y.tab.c capaParserFun.c
202: # echo "mv y.tab.h capaToken.h"
203: # mv y.tab.h capaToken.h
1.1 albertel 204:
1.5 albertel 205: echo "mv capaGrammarDef.tab.c capaParserFun.c"
206: mv capaGrammarDef.tab.c capaParserFun.c
1.1 albertel 207:
208: ofile="${ARCH}/capaParserFun.o"
209: cfile="capaParserFun.c"
210: cmd="${CC} $CCFLAG -DYACC_DBUG -c $cfile -o $ofile"
211: echo $cmd
212: $cmd
213: }
214:
215: formulaParser()
216: {
217:
1.2 albertel 218: echo "${YACC} -p fml_ -d capaFormula.y"
1.1 albertel 219: ${YACC} -b fma -p fml_ -d capaFormula.y
220:
221: echo "MV fma.tab.c capaFormulaParser.c"
222: echo "MV fma.tab.h capaFormula.h"
223:
224: ${MV} fma.tab.c capaFormulaParser.c
225: ${MV} fma.tab.h capaFormula.h
226:
227: ofile="${ARCH}/capaFormulaParser.o"
228: cfile="capaFormulaParser.c"
229: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
230: echo $cmd
231: $cmd
232:
233: }
234:
235: formulaDbug()
236: {
237:
238: echo "YACC -p fml_ -d capaFormula.y"
239: ${YACC} -b fma -p fml_ -d capaFormula.y
240:
241: echo "MV fma.tab.c capaFormulaParser.c"
242: echo "MV fma.tab.h capaFormula.h"
243:
244: ${MV} fma.tab.c capaFormulaParser.c
245: ${MV} fma.tab.h capaFormula.h
246:
247: ofile="${ARCH}/capaFormulaParser.o"
248: cfile="capaFormulaParser.c"
249: cmd="${CC} $CCFLAG -DFML_DBUG -c $cfile -o $ofile"
250: echo $cmd
251: $cmd
252:
253: ofile="${ARCH}/capaParserUtils.o"
254: cfile="capaParserUtils.c"
255: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
256: echo $cmd
257: $cmd
258: }
259:
260:
261:
262: symboldbug()
263: {
264: echo "${YACC} capaGrammarDef.y "
265: #
266: ${YACC} capaGrammarDef.y
267:
268: echo "mv y.tab.c capaParserFun.c"
269: #
270: mv y.tab.c capaParserFun.c
271:
272: ofile="${ARCH}/capaParserFun.o"
273: cfile="capaParserFun.c"
274: cmd="${CC} $CCFLAG -DSYMBOL_DBUG -c $cfile -o $ofile"
275: echo $cmd
276: $cmd
277: ofile="${ARCH}/capaParserUtils.o"
278: cfile="capaParserUtils.c"
279: cmd="${CC} $CCFLAG -DSYMBOL_DBUG -c $cfile -o $ofile"
280: echo $cmd
281: $cmd
282: # ofile="${ARCH}/capaFunction.o"
283: # cfile="capaFunction.c"
284: # cmd="${CC} $CCFLAG -DSYMBOL_DBUG -c $cfile -o $ofile"
285: # echo $cmd
286: # $cmd
287: }
288:
289: dynamicsymbol()
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 -DUSE_DYNAMIC_SYMBOLS -c $cfile -o $ofile"
302: echo $cmd
303: $cmd
304: ofile="${ARCH}/capaParserUtils.o"
305: cfile="capaParserUtils.c"
306: cmd="${CC} $CCFLAG -DUSE_DYNAMIC_SYMBOLS -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: arraysymbol()
317: {
318: echo "${FLEX} capaLexerDef.flex"
319: #
320: ${FLEX} capaLexerDef.flex
321:
322: echo "mv lex.yy.c capaLexerFun.c"
323: #
324: mv lex.yy.c capaLexerFun.c
325:
326: ofile="${ARCH}/capaLexerFun.o"
327: cfile="capaLexerFun.c"
328: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
329: echo $cmd
330: $cmd
331: ofile="${ARCH}/capaParserUtils.o"
332: cfile="capaParserUtils.c"
333: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
334: echo $cmd
335: $cmd
336: ofile="${ARCH}/capaCommon.o"
337: cfile="capaCommon.c"
338: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
339: echo $cmd
340: $cmd
341: }
342:
343: CAPAParserUtilsdbug()
344: {
345: ofile="${ARCH}/capaParserUtils.o"
346: cfile="capaParserUtils.c"
347: cmd="${CC} $CCFLAG -DPARSER_DBUG -c $cfile -o $ofile"
348: echo $cmd
349: $cmd
350: }
351:
1.5 albertel 352: Ranlib()
353: {
354: ofile="${ARCH}/ranlib.o"
355: cfile="ranlib.c"
356: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
357: echo $cmd
358: $cmd
359: }
360:
1.1 albertel 361: CAPAParserUtils()
362: {
363: ofile="${ARCH}/capaParserUtils.o"
364: cfile="capaParserUtils.c"
365: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
366: echo $cmd
367: $cmd
368: }
369:
370: CAPAFunction()
371: {
372: ofile="${ARCH}/capaFunction.o"
373: cfile="capaFunction.c"
374: cmd="${CC} $CCFLAG -c $cfile -o $ofile"
375: echo $cmd
376: $cmd
377: }
378: createCAPAlib()
379: {
380:
381: if [ -f ${ARCH}/libcapa${VER}.a ]
382: then
383: rm ${ARCH}/libcapa${VER}.a
384: fi
385:
386: echo "ar q ${ARCH}/libcapa${VER}.a ${PAR_OBJ}"
387:
388: ar q ${ARCH}/libcapa${VER}.a ${PAR_OBJ}
389:
390: }
391:
392: compileLexTest()
393: {
394: if [ -f ${TEST_DIR}/testL ]
395: then
396: rm ${TEST_DIR}/testL
397: fi
398:
399: (cd ${TEST_DIR}; make testL)
400:
401: }
402:
403: compileParseTest()
404: {
405: if [ -f ${TEST_DIR}/testP ]
406: then
407: rm ${TEST_DIR}/testP
408: fi
409:
410: (cd ${TEST_DIR}; make testP)
411:
412: }
413:
414: compileParseTestDmalloc()
415: {
416: if [ -f ${TEST_DIR}/testP ]
417: then
418: rm ${TEST_DIR}/testP
419: fi
420:
421: (cd ${TEST_DIR}; make testPdmalloc)
422:
423: }
424:
425: compileLoginTest()
426: {
427: if [ -f ${TEST_DIR}/testLogin ]
428: then
429: rm ${TEST_DIR}/testLogin
430: fi
431:
1.11 albertel 432: ofile="${ARCH}/capaCommon.o"
433: cfile="capaCommon.c"
434: cmd="${CC} $CCFLAG -DCOMMON_DBUG -c $cfile -o $ofile"
435: echo $cmd
436: $cmd
437:
438: createCAPAlib
439:
1.1 albertel 440: ofile="${ARCH}/capaLoginTest.o"
441: cfile="capalogin.c"
442: cmd="${CC} $CCFLAG -DLOGIN_DBUG -c $cfile -o $ofile"
443: echo $cmd
444: $cmd
445:
1.11 albertel 446: cmd="${CC} $CCFLAG ${ARCH}/libcapa${VER}.a $ofile -L${ARCH} -lcapa${VER} ${PLIBS} -o ${TEST_DIR}/testLogin"
1.1 albertel 447: echo $cmd
448: $cmd
449:
450: }
451:
452: compileFormulaTest()
453: {
454: if [ -f ${TEST_DIR}/testFormula ]
455: then
456: rm ${TEST_DIR}/testFormula
457: fi
458:
459: ofile="${ARCH}/capaTestFormula.o"
460: cfile="${TEST_DIR}/tformula_main.c"
461: cmd="${CC} $CCFLAG -DLOGIN_DBUG -I. -I.. -c $cfile -o $ofile"
462: echo $cmd
463: $cmd
464:
465: cmd="${CC} $CCFLAG ${ARCH}/libcapa${VER}.a $ofile -L${ARCH} -lcapa${VER} ${PLIBS} -o
466: ${TEST_DIR}/testFormula"
467: echo $cmd
468: $cmd
469:
470: }
471:
472: for i in $* ; do
473: case "$i" in
474: *FP)
475: formulaParser
476: ;;
477: *LD)
478: lexCAPAdmalloc
479: ;;
1.5 albertel 480: *X|*x)
481: lexdbug
482: ;;
483: *L|*l)
1.3 albertel 484: lexCAPA
1.1 albertel 485: ;;
1.5 albertel 486: *P|*p)
487: yaccdbug
1.1 albertel 488: ;;
1.5 albertel 489: *Y|*y)
490: yaccCAPA
1.1 albertel 491: ;;
1.5 albertel 492: *R|*r)
493: Ranlib
1.1 albertel 494: ;;
495: *PD)
496: CAPAParserUtilsdbug
497: ;;
1.5 albertel 498: *PU|*pu)
1.1 albertel 499: CAPAParserUtils
500: ;;
501: *SS)
502: symboldbug
503: ;;
504: *DS)
505: dynamicsymbol
506: ;;
507: *AS)
508: arraysymbol
509: ;;
510: *D)
511: formulaDbug
512: ;;
513: *F|*f)
1.5 albertel 514: CAPAFunction
1.4 albertel 515: ;;
516: *lib|*Lib)
517: createCAPAlib
518: ;;
1.5 albertel 519: *PT|*pt)
520: compileParseTest
1.11 albertel 521: ;;
522: *Lo|*lo)
523: compileLoginTest
1.5 albertel 524: ;;
1.1 albertel 525: esac
526: done
527:
528: exit 0
529:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>