home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sa104os2.zip / SATHR104.ZIP / SATHER / MAKEFILE < prev    next >
Text File  |  1995-02-18  |  8KB  |  221 lines

  1. # Copyright (C) International Computer Science Institute, 1994.  COPYRIGHT  
  2. # NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY and is subject 
  3. # to the terms of the SATHER LIBRARY GENERAL PUBLIC LICENSE contained in    
  4. # the file "Doc/License" of the Sather distribution.  The license is also   
  5. # available from ICSI, 1947 Center St., Suite 600, Berkeley CA 94704, USA.  
  6. # -----> Please email comments to "sather-bugs@icsi.berkeley.edu". <-----
  7.  
  8. # Be sure to read the file Doc/Installation!
  9. #
  10. # You'll need to set these variables to be appropriate to your system.
  11. #
  12. # CFLAGS is only used during the bootstrap; CC options for regular
  13. # compiles must be specified in System/CONFIG.pro.
  14. #
  15. # CS is the executable name.
  16. #
  17. # Set SHOME to an absolute path to the directory this Makefile is in (in
  18. # other words, the top level sather directory)!!
  19. #
  20. # Don't forget to edit (or at least inspect) the file System/CONFIG.pro.
  21.  
  22. CPP= icc /Q /Pcde
  23. CC= icc 
  24. CFLAGS= /Q /O /B/STACK:200000 /B/ALIGN:32
  25. CS= cs
  26. CSDEBUG= csdb
  27. SHOME= f:\sather
  28. TEST= test
  29. GC_MKFL= Makefile.ibm
  30. SYS_MKFL= Makefile.ibm
  31. BOOT_MKFL= Makefile.ibm
  32.  
  33. DIST_NAME= Sa104os2.zip
  34. INNER_NAME = Sathr104.zip
  35.  
  36. !IFDEF verbose
  37. RED=
  38. MAK=
  39. VERB= -verbose
  40. !ELSE
  41. !IFDEF silent
  42. !CMDSWITCHES +S
  43. RED= >nul
  44. MAK= /S
  45. VERB=
  46. !ELSE
  47. RED=
  48. MAK=
  49. VERB=
  50. !ENDIF
  51. !ENDIF
  52.  
  53. SYSTEM= MakeGCLib MakeBaseLib System\MACROS System\CONFIG
  54. BOOTCS= $(SHOME)\Boot\$(CS)
  55.  
  56. COMP_FILES=  Compiler\am.sa Compiler\am_out.sa Compiler\be.sa Compiler\call.sa Compiler\cs.sa Compiler\elt.sa Compiler\global.sa Compiler\ident.sa Compiler\ifc.sa Compiler\impl.sa Compiler\inline.sa Compiler\options.sa
  57. COMP_FILES2= Compiler\parse.sa Compiler\prog.sa Compiler\sig.sa Compiler\tp.sa Compiler\tr.sa Compiler\trans.sa
  58.  
  59. LIB_FILES=  Library\abstract.sa Library\aref.sa Library\array.sa Library\array2.sa Library\aval.sa Library\bool.sa Library\char.sa Library\cpx.sa Library\err.sa Library\file.sa Library\flist.sa Library\flt.sa
  60. LIB_FILES2= Library\flt_othr.sa Library\fltd.sa Library\fmap.sa Library\fqset.sa Library\fset.sa Library\fstr.sa Library\glob.sa Library\in.sa Library\int.sa Library\inti.sa Library\mat.sa Library\misc.sa
  61. LIB_FILES3= Library\next.sa Library\out.sa Library\rat.sa Library\rnd.sa Library\str.sa Library\str_curs.sa Library\sys.sa Library\test.sa Library\tup.sa Library\unix.sa Library\vec.sa
  62.  
  63. # Make the boot compiler and give it a workout on itself and some test cases
  64. all: env_off $(SYSTEM) $(BOOTCS) Compiler\$(CS).exe
  65.  
  66. # Make the boot compiler and give it a workout on itself (debug_mode) and some test cases
  67. alldebug: env_off $(SYSTEM) $(BOOTCS) Compiler\$(CSDEBUG).exe
  68.  
  69. # Make and test everything
  70. testall: all fixedpoint_test
  71.  
  72. system_stuff: $(SYSTEM)
  73.  
  74. env_off:
  75.     set SATHER_COMMANDS=
  76.  
  77. # The compiler which ends up in Compiler\ is the "fast" executable,
  78. # which means that checking is turned off and optimizations are on.
  79.  
  80. Compiler\$(CS).exe: $(BOOTCS).exe $(COMP_FILES) $(COMP_FILES2) $(COMP_FILES3) $(LIB_FILES) $(LIB_FILES2) $(LIB_FILES3)
  81.     cd Compiler
  82.     $(BOOTCS) -home $(SHOME) -com cs.prm -o $(CS) -fast -only_reachable $(VERB)
  83.     cd ..\Test
  84.     ..\Compiler\$(CS) -home $(SHOME) -com tests.prm -o $(TEST) $(VERB)
  85.     .\$(TEST) > test.log
  86.     cd ..
  87.  
  88. Compiler\$(CSDEBUG).exe: $(BOOTCS).exe $(COMP_FILES) $(COMP_FILES2) $(COMP_FILES3) $(LIB_FILES) $(LIB_FILES2) $(LIB_FILES3)
  89.     cd Compiler
  90.     $(BOOTCS) -home $(SHOME) -com cs.prm -o $(CSDEBUG) -check all -debug -only_reachable -output_C -deterministic $(VERB)
  91.     cd ..\Test
  92.     ..\Compiler\$(CSDEBUG) -home $(SHOME) -com tests.prm -o $(TEST) $(VERB)
  93.     .\$(TEST) > test.log
  94.     cd ..
  95.  
  96. $(BOOTCS):
  97.     cd Boot\cs.cod
  98.     nmake -nologo $(MAK) -f $(BOOT_MKFL) CC=$(CC) CS=$(BOOTCS) CFLAGS="$(CFLAGS)" RED="$(RED)"
  99.     cd ..\..
  100.  
  101. # The next four rules just make the stuff in System\
  102.  
  103. System\MACROS: System\MACROS.pro
  104.     $(CPP) System\MACROS.pro > System\MACROS
  105.  
  106. System\CONFIG: System\CONFIG.pro
  107.     $(CPP) System\CONFIG.pro > System\CONFIG
  108.  
  109. MakeBaseLib:
  110.     cd System
  111.     nmake -nologo $(MAK) -f $(SYS_MKFL) CC=$(CC) CFLAGS="$(CFLAGS)" RED="$(RED)"
  112.     cd ..
  113.  
  114. MakeGCLib:
  115.     cd System\GC
  116.     nmake -nologo $(MAK) -f $(GC_MKFL) CC=$(CC) RED="$(RED)"
  117.     cd ..\..
  118.  
  119. # There are two tests.  The first is the test classes in the library,
  120. # which is pretty straightforward.  The second is a full fixed-point
  121. # compilation of the compiler, which can take quite a while.
  122.  
  123. quick_test:
  124.     cd Test
  125.     ..\Compiler\$(CS) -home $(SHOME) -com tests.prm -o $(TEST) $(VERB)
  126.     .\$(TEST) > test.log
  127.     cd ..
  128.  
  129. db_quick_test:
  130.     cd Test
  131.     ..\Compiler\$(CSDEBUG) -home $(SHOME) -com tests.prm -o $(TEST) $(VERB)
  132.     .\$(TEST) > test.log
  133.     cd ..
  134.  
  135. # The fixed-point test does the following:
  136. #
  137. #    1. Compile using Compiler/cs.
  138. #    2. Compile using result.
  139. #    3. Compile using _that_ result.
  140. #    4. Compare C files generated by (2) and (3).
  141. #    5. Clean up.
  142. #
  143. # This can take quite a long time so I've removed it from the things
  144. # that occur by default during a build.
  145.  
  146. fixedpoint_test:
  147.     cd Test
  148.     if exist cs1.cod    ..\System\deltree /y /f cs1.cod $(RED)
  149.     if exist cs2.cod    ..\System\deltree /y /f cs2.cod $(RED)
  150.     if exist cs3.cod    ..\System\deltree /y /f cs3.cod $(RED)
  151.     if exist *.exe      del *.exe
  152.     ..\Compiler\$(CS) -com ..\Compiler\cs.prm -home $(SHOME) -output_C -o cs3 -O -deterministic -check all $(VERB)
  153.     rename cs3.exe cs2.exe
  154.     rename cs3.cod cs1.cod
  155.     cs2 -com ..\Compiler\cs.prm -home $(SHOME) -output_C -o cs3 -O -deterministic -check all $(VERB)
  156.     rename cs2.exe cs1.exe
  157.     rename cs3.exe cs2.exe
  158.     rename cs3.cod cs2.cod
  159.     cs2 -com ..\Compiler\cs.prm -home $(SHOME) -output_C -o cs3 -O -deterministic -check all $(VERB)
  160.     cd ..
  161.     @echo If all went well, the files in $(SHOME)\Test\cs2.cod are identical to
  162.     @echo                   the files in $(SHOME)\Test\cs3.cod.
  163.     @echo Consider executing "nmake fixedpoint_clean" after comparing these files.
  164.  
  165. fixedpoint_clean:
  166.     cd Test
  167.     if exist cs1.cod    ..\System\deltree /y /f cs1.cod $(RED)
  168.     if exist cs2.cod    ..\System\deltree /y /f cs2.cod $(RED)
  169.     if exist cs3.cod    ..\System\deltree /y /f cs3.cod $(RED)
  170.     if exist *.exe      del *.exe
  171.     cd ..
  172.  
  173. clean:
  174.     if exist *.log             del *.log
  175.     cd Test
  176.     if exist $(TEST).cod       ..\System\deltree /y /f $(TEST).cod $(RED)
  177.     if exist cs1.cod           ..\System\deltree /y /f cs1.cod $(RED)
  178.     if exist cs2.cod           ..\System\deltree /y /f cs2.cod $(RED)
  179.     if exist cs3.cod           ..\System\deltree /y /f cs3.cod $(RED)
  180.     if exist *.exe             del *.exe
  181.     if exist *.log             del *.log
  182.     cd ..\Compiler
  183.     if exist $(CS).cod         ..\System\deltree /y /f $(CS).cod $(RED)
  184.     if exist $(CSDEBUG).cod    ..\System\deltree /y /f $(CSDEBUG).cod $(RED)
  185.     if exist $(CSDEBUG).exe    del $(CSDEBUG).exe
  186.     if exist *.log             del *.log
  187.     cd ..\System
  188.     if exist *.obj             del *.obj
  189.     if exist *.bak             del *.bak
  190.     if exist *.log             del *.log
  191.     cd GC
  192.     if exist *.obj             del *.obj
  193.     if exist *.exe             del *.exe
  194.     if exist *.bak             del *.bak
  195.     if exist *.p               del *.p
  196.     if exist *.log             del *.log
  197.     if exist Cord\*.obj        del Cord\*.obj
  198.     if exist Cord\*.exe        del Cord\*.exe
  199.     cd ..\..\Boot
  200.     if exist *.exe             del *.exe
  201.     if exist $(CS).cod\*.obj   del $(CS).cod\*.obj
  202.     if exist *.log             del *.log
  203.     cd ..
  204.  
  205.  
  206. # You'll never want to do these
  207.  
  208. distribution: clean make_zip
  209.  
  210. make_zip:
  211.     if exist Compiler\cs.exe     del Compiler\cs.exe
  212.     cd ..
  213.     if exist $(DIST_NAME)        del $(DIST_NAME)
  214.     if exist $(INNER_NAME)       del $(INNER_NAME)
  215.     d:\dosutil\pkzip -ex -r -P $(INNER_NAME) sather\*.*
  216.     d:\dosutil\pkunzip -t $(INNER_NAME)
  217.     d:\dosutil\pkzip $(DIST_NAME) $(INNER_NAME) $(SHOME)\Readme.1st $(SHOME)\file_id.diz
  218.     d:\dosutil\pkunzip -t $(DIST_NAME)
  219.     del $(INNER_NAME)
  220.     cd $(SHOME)
  221.