home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / unix / pine4.10.tar.gz / pine4.10.tar / pine4.10 / build.cmd < prev    next >
OS/2 REXX Batch file  |  1996-03-15  |  6KB  |  176 lines

  1. /* rexx */
  2. /* $Id: build.cmd,v 4.1 1996/03/15 18:01:49 mikes Exp $    */
  3. /* ------------------------------------------------------------------------ */
  4. /*                                        */
  5. /*             T H E    P I N E    M A I L   S Y S T E M            */
  6. /*                                        */
  7. /*    David Nugent <davidn@unique.blaze.net.au>                    */
  8. /*    Networks and Distributed Computing                    */
  9. /*    Computing and Communications                        */
  10. /*    University of Washington                            */
  11. /*    Administration Builiding, AG-44                        */
  12. /*    Seattle, Washington, 98195, USA                        */
  13. /*    Internet: lgl@CAC.Washington.EDU                        */
  14. /*              mikes@CAC.Washington.EDU                    */
  15. /*                                        */
  16. /*    Please address all bugs and comments to "pine-bugs@cac.washington.edu"*/
  17. /*                                        */
  18. /*                                        */
  19. /*    Pine and Pico are registered trademarks of the University of        */
  20. /*    Washington.  No commercial use of these trademarks may be made        */
  21. /*    without prior written permission of the University of Washington.     */
  22. /*                                        */
  23. /*    Pine, Pico, and Pilot software and its included text are Copyright    */
  24. /*    1989-1996 by the University of Washington.                */
  25. /*                                        */
  26. /*    The full text of our legal notices is contained in the file called    */
  27. /*    CPYRIGHT, included with this distribution.                */
  28. /*                                        */
  29. /*                                        */
  30. /*    This is a build script (rexx) for PineOS2                    */
  31. /*                                        */
  32. /*                                        */
  33. /* -------------------------------------------------------------------------*/
  34.  
  35. maketarget=''
  36. makeargs=''
  37. PHOME=directory()
  38.  
  39. parse arg args
  40. n=words(args)
  41.  
  42. do while i=0 to n
  43.     arg=word(args,i+1)
  44.  
  45.     select
  46.  
  47.         when arg = 'help' | arg = 'HELP' then do
  48.             SAY 'Usage: build <make-options>'
  49.             SAY ''
  50.             SAY 'See the document doc/pine-ports for a list of other platforms that'
  51.             SAY 'Pine has been ported to and for details about these and other ports.'
  52.             SAY ''
  53.             SAY '<make-options> are generally not needed. They are flags (anything'
  54.             SAY 'beginning with -) and are passed to make. "-n" is probably the most'
  55.             SAY 'useful, as it tells make to just print out what it is going to do and'
  56.             SAY 'not actually do it.'
  57.             SAY ''
  58.             SAY 'The executables built by this are:'
  59.             SAY ''
  60.             SAY ' pine   The Pine mailer. Once compiled this should work just fine on'
  61.             SAY '        your system with no other files than this binary, and no'
  62.             SAY '        modifications to your system.'
  63.             SAY ''
  64.             SAY ' pico   The standalone editor similar to the Pine message composer.'
  65.             SAY '        This is a very simple straight forward text editor.'
  66.             SAY ''
  67.             SAY ''
  68.             SAY 'In general you should be able to just copy the Pine and Pico binaries'
  69.             SAY 'to the place you keep your other local binaries.'
  70.             SAY ''
  71.             exit 1
  72.             end
  73.  
  74.         when substr(arg,1,1) = '-' then do
  75.             makeargs=makeargs arg
  76.             end
  77.  
  78.         when arg = 'clean' | arg = 'CLEAN' then do
  79.             maketarget='clean'
  80.             end
  81.  
  82.         when length(arg) == 3 then do
  83.             if maketarget <> '' then do
  84.                 SAY 'Do not specify a target - this script builds for OS/2 only'
  85.                 exit 1
  86.                 end
  87.             end
  88.  
  89.         otherwise do
  90.             makeargs=makeargs arg
  91.             end
  92.         end
  93.     end
  94.  
  95. if maketarget = '' then maketarget='os2'
  96. SAY 'make args="'makeargs'" target="'maketarget'"'
  97.  
  98. select
  99.  
  100.     when length(maketarget) = 3 then do
  101.         say ''
  102.         savedir=directory(PHOME'\c-client')
  103.         if directory() <> PHOME'\c-client' then do
  104.             call directory PHOME
  105.             'move imap\ANSI\c-client c-client'
  106.             end
  107.         call directory PHOME
  108.         say "Making c-client library & mtest"
  109.         call directory PHOME'\c-client'
  110.         'make -f makefile.'maketarget makeargs
  111.         if rc <> 0 then SAY 'Stop.'
  112.         else do
  113.             say ''
  114.             say "Making Pico"
  115.             call directory PHOME'\pico'
  116.             'make -f makefile.'maketarget makeargs
  117.             if rc <> 0 then SAY 'Stop.'
  118.             else do
  119.                 say ''
  120.                 say "Making Pine".
  121.                 call directory PHOME'\pine'
  122.                 'make -f makefile.'maketarget makeargs
  123.                 if rc <> 0 then SAY 'Stop.'
  124.                 else do
  125.                     call directory PHOME'\bin'
  126.                     if directory() <> PHOME'\bin' then do
  127.                     call directory PHOME
  128.                     'mkdir bin'
  129.                     call directory bin
  130.                     end
  131.                 'rm -f *.exe *.dll *.hlp *.ndx'
  132.                 'cp ../pine/pine.exe .'
  133.                 'cp ../pine/pine.hlp .'
  134.                 'cp ../pine/pine.ndx .'
  135.                 'cp ../c-client/mtest.exe .'
  136.                 'cp ../c-client/c-client.dll .'
  137.                 'cp ../pico/pico.exe .'
  138.                 'cp ../pico/pilot.exe .'
  139.                 'cp ../pico/picolib.dll .'
  140.                 say ''
  141.                 say "Copies of the executables are in bin directory:"
  142.                 'dir'
  143.                 say 'Done.'
  144.                 end
  145.             end
  146.         end
  147.     call directory PHOME
  148.     end
  149.  
  150.     when maketarget = 'clean' then do
  151.         SAY 'Cleaning c-client and imapd'
  152.         call directory PHOME'\c-client'
  153.         'make clean'
  154.         SAY 'Cleaning Pine'
  155.         call directory PHOME'\pine'
  156.         'make -f makefile.ult clean'
  157.         SAY 'Cleaning pico'
  158.         call directory PHOME'\pico'
  159.         'make' makeargs '-f makefile.ult clean'
  160.         SAY 'Done.'
  161.         call directory PHOME
  162.         end
  163.  
  164.     when maketarget = '' then do
  165.         SAY 'No target plaform for which to build Pine given.'
  166.         SAY 'Give command "build help" for help.'
  167.         end
  168.  
  169.     otherwise do
  170.         SAY 'Do not know how to make Pine for target "'maketarget'".'
  171.         end
  172.  
  173.     end
  174.  
  175. exit 0
  176.