Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2009
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.48 KB | None | 0 0
  1. DU_NUM=du4
  2. RO_PATH=public-ro/mlc
  3. RO_PATH_DU=${RO_PATH}/${DU_NUM}
  4. RW_PATH=public-rw/SWI098
  5. RW_PATH_DU=${RW_PATH}/${DU_NUM}
  6. MLSY=`cd ${RO_PATH_DU}/tests/; ls *.mls`
  7. EDITOR=vim
  8.  
  9. CFLAGS+=-Wall -I${RO_PATH_DU}/h/ -I${RW_PATH}/${DU_NUM}/ -I${RO_PATH}/h/ -I${RO_PATH}/common/h/ -Ipublic-ro/common/h/ -I.
  10.  
  11. program: ${DU_NUM}.o ${DU_NUM}g.o ${DU_NUM}baseerrtab.o duseemptyerrtab.o duerr.o flex.o fac1.o fac2.o fac3.o fac4.o fac5.o dutables.o sem.o x1.o x2.o x3.o
  12.     ${CXX} ${LDFLAGS} -o program ${DU_NUM}.o ${DU_NUM}baseerrtab.o flex.o duseemptyerrtab.o duerr.o ${DU_NUM}g.o fac1.o fac2.o fac3.o fac4.o fac5.o dutables.o sem.o x1.o x2.o x3.o
  13.  
  14. fac1.o: ${RO_PATH}/../common/src/labeled_icblock.cpp
  15.     ${CXX} ${CPPFLAGS} ${CFLAGS} -c -o $@ ${RO_PATH}/../common/src/labeled_icblock.cpp
  16. fac2.o:
  17.     ${CXX} ${CPPFLAGS} ${CFLAGS} -c -o $@ ${RO_PATH}/../common/src/flat_icblock.cpp
  18. fac3.o: ${RO_PATH}/../common/src/ic_instr.cpp
  19.     ${CXX} ${CPPFLAGS} ${CFLAGS} -c -o $@ ${RO_PATH}/../common/src/ic_instr.cpp
  20. fac4.o: ${RO_PATH}/../common/src/uid_gen.cpp
  21.     ${CXX} ${CPPFLAGS} ${CFLAGS} -c -o $@ ${RO_PATH}/../common/src/uid_gen.cpp
  22. fac5.o: ${RO_PATH}/../common/src/abstract_ic.cpp
  23.     ${CXX} ${CPPFLAGS} ${CFLAGS} -c -o $@ ${RO_PATH}/../common/src/abstract_ic.cpp
  24.  
  25. # x
  26. sem.o: ${RW_PATH_DU}/du4sem.cpp
  27.     ${CXX} ${CPPFLAGS} ${CFLAGS} -c -o $@ ${RW_PATH_DU}/du4sem.cpp
  28. x1.o: ${RW_PATH_DU}/gen_aifactory.cpp
  29.     ${CXX} ${CPPFLAGS} ${CFLAGS} -c -o $@ ${RW_PATH_DU}/gen_aifactory.cpp
  30. x2.o: ${RW_PATH_DU}/gen_icfactory.cpp
  31.     ${CXX} ${CPPFLAGS} ${CFLAGS} -c -o $@ ${RW_PATH_DU}/gen_icfactory.cpp
  32. x3.o: ${RW_PATH_DU}/gen_icinstrtab.cpp
  33.     ${CXX} ${CPPFLAGS} ${CFLAGS} -c -o $@ ${RW_PATH_DU}/gen_icinstrtab.cpp
  34.  
  35. ## du
  36.  
  37. ${DU_NUM}.o: ${RO_PATH_DU}/h/${DU_NUM}.h ${RO_PATH_DU}/h/${DU_NUM}tok.h ${RO_PATH}/h/duerr.h ${RO_PATH_DU}/src/${DU_NUM}.cpp
  38.         ${CXX} ${CPPFLAGS} ${CFLAGS} -o $@ -c ${RO_PATH_DU}/src/${DU_NUM}.cpp  
  39.  
  40. ${DU_NUM}baseerrtab.o: ${RO_PATH_DU}/h/dubaseerr.h ${RO_PATH_DU}/src/${DU_NUM}baseerrtab.cpp
  41.         ${CXX} ${CPPFLAGS} ${CFLAGS} -o $@ -c ${RO_PATH_DU}/src/${DU_NUM}baseerrtab.cpp
  42.  
  43. ##${DU_NUM}tok.o: ${RO_PATH_DU}/h/${DU_NUM}tok.h ${RO_PATH_DU}/src/${DU_NUM}tok.cpp
  44. ##      ${CXX} ${CPPFLAGS} ${CFLAGS} -o $@ -c ${RO_PATH_DU}/src/${DU_NUM}tok.cpp
  45.  
  46.  
  47. ## mlc
  48.  
  49. duerr.o: ${RO_PATH}/h/duerr.h ${RO_PATH}/src/duerr.cpp
  50.         ${CXX} ${CPPFLAGS} ${CFLAGS} -o $@ -c ${RO_PATH}/src/duerr.cpp
  51.  
  52. duseemptyerrtab.o: ${RO_PATH}/h/duerr.h  ${RO_PATH}/src/dusememptyerrtab.cpp
  53.         ${CXX} ${CPPFLAGS} ${CFLAGS} -o $@ -c ${RO_PATH}/src/dusememptyerrtab.cpp
  54.  
  55. dutables.o: ${RO_PATH}/h/duerr.h ${RO_PATH}/h/dutables.h ${RO_PATH}/src/dutables.cpp
  56.     ${CXX} ${CPPFLAGS} ${CFLAGS} -o $@ -c ${RO_PATH}/src/dutables.cpp
  57.  
  58.  
  59. ##
  60. ## Syntactic analyzer via bison
  61. ##
  62.  
  63. ${DU_NUM}g.o: ${DU_NUM}g.cpp ${RO_PATH_DU}/h/${DU_NUM}.h ${RO_PATH}/h/duerr.h
  64.     ${CXX} ${CPPFLAGS} ${CFLAGS} -o $@ -c $<
  65.  
  66. ${DU_NUM}g.cpp: ${RW_PATH_DU}/${DU_NUM}g.y
  67.     bison --report=all --warnings=all -d -o $@ $<
  68.  
  69. ${DU_NUM}g.hpp: ${DU_NUM}g.cpp
  70.  
  71.  
  72.  
  73. ## flex
  74.  
  75. flex.o: flex.cpp ${RO_PATH}/h/duerr.h ${RO_PATH_DU}/h/${DU_NUM}.h ${RO_PATH_DU}/h/${DU_NUM}tok.h
  76.         ${CXX} ${CPPFLAGS} ${CFLAGS} -o $@ -c flex.cpp
  77.  
  78. flex.cpp: ${RW_PATH_DU}/${DU_NUM}l.lex
  79.         flex -Cf -b -p -p -o $@ $<
  80.  
  81.  
  82.  
  83. ## Clean up
  84.  
  85. clean:
  86.     rm -f flex.cpp *.o program *.out lex.backup *.output *.cpp *.hpp *.backup tags *.out *.diff
  87.    
  88. ## tests
  89.  
  90. check: program tests
  91.  
  92. check_view: program tests_view
  93.    
  94. tests:
  95.     @for i in ${MLSY}; do \
  96.     MLSIK=$${i%.mls*}; \
  97.     ./program ${RO_PATH_DU}/tests/$$MLSIK.mls xyz.out > $$MLSIK.out; \
  98.     dos2unix -u $$MLSIK.out; \
  99.     dos2unix -u ${RO_PATH_DU}/tests/$$MLSIK.out; \
  100.     if diff -u ${RO_PATH_DU}/tests/$$MLSIK.out $$MLSIK.out > $$MLSIK.diff; then \
  101.     echo $$MLSIK " OK ;)"; \
  102.     else \
  103.     echo "problem, nefunguje vse jak ma. rozdil ve vysledcich je v souboru :" $$MLSIK ".diff";\
  104.     fi; \
  105.     done; \
  106.     echo "!!! Pozor -- vystupni soubor z prekladace se nekontroluje, jen jeho standardni vystup!"
  107.    
  108. tests_view:
  109.     @for i in ${MLSY}; do \
  110.     MLSIK=$${i%.mls*}; \
  111.     ./program ${RO_PATH_DU}/tests/$$MLSIK.mls xyz.out > $$MLSIK.out; \
  112.     dos2unix -u $$MLSIK.out; \
  113.     dos2unix -u ${RO_PATH_DU}/tests/$$MLSIK.out; \
  114.     if diff -u ${RO_PATH_DU}/tests/$$MLSIK.out $$MLSIK.out > $$MLSIK.diff; then \
  115.     echo $$MLSIK " OK ;)"; \
  116.     else \
  117.     echo "problem, nefunguje vse jak ma. rozdil ve vysledcich je v souboru :" $$MLSIK ".diff";\
  118.     CHYBOVE_SOUBORY=`echo ${RO_PATH_DU}/tests/$$MLSIK.mls $$CHYBOVE_SOUBORY`;\
  119.     CHYBOVE_SOUBORY=`echo $$MLSIK.diff $$CHYBOVE_SOUBORY`; \
  120.     fi; \
  121.     done;\
  122.     ${EDITOR} $$CHYBOVE_SOUBORY &
  123.  
  124.        
  125.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement