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