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