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