home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / packs / itweak / Makefile < prev    next >
Makefile  |  2001-06-06  |  4KB  |  126 lines

  1. ############################################################################ 
  2. #
  3. # Unix Makefile for installing itweak and running a sample debugging session.
  4. #
  5. # $Id: Makefile,v 2.21 1996/10/04 03:45:37 hs Rel $
  6. # updated 4-aug-2000/gmt
  7. #
  8. # 'make' or 'make install'
  9. # does the necessary compilations to get the itweak package ready to use.
  10. # Note, however, that it leaves the resulting files in the current directory.
  11. # You must move or copy them yourself if you want them any other place.
  12. # (See the documentation.)
  13. #
  14. # 'make sample-debug'
  15. # compiles, tweaks, and links a sample program to make it ready for a
  16. # debugging session.
  17. # Assumes the 'dbg_run.u?' files are on your IPATH or in the current directory
  18. # which is the case if you haven't moved things around since 'make install'.
  19. #
  20. # The sample executable is named 'sample'.
  21. # The program is, however, identical 'ipxref' copied from the Icon Library.
  22. # It also requires 'options.icn' (included), so the program is built from two
  23. # source files.
  24. #
  25. # 'make demo'
  26. # runs a debugging session with the sample program.
  27. # It is uncommon to run debugging sessions from a Makefile.
  28. # This is only for demo purposes.
  29. #
  30. # This makefile is in itself an example of how to construct makefiles.
  31. # It provides a simple way to switch between a clean (untweaked) version
  32. # and a tweaked version of the sample program without duplicating a lot of
  33. # makefile code.
  34. # Use 'make sample-clean' to force compilation of a clean (untweaked) copy of
  35. # 'sample'.
  36. #
  37. ############################################################################ 
  38. # Copyright (c) 1994 Hakan Soderstrom and
  39. # Soderstrom Programvaruverkstad AB, Sweden
  40. # Permission to use, copy, modify, distribute, and sell this software
  41. # and its documentation for any purpose is hereby granted without fee,
  42. # provided that the above copyright notice and this permission notice
  43. # appear in all copies of the software and related documentation.
  44. # THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
  45. # EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
  46. # WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  47. #
  48. # IN NO EVENT SHALL HAKAN SODERSTROM OR SODERSTROM PROGRAMVARUVERKSTAD
  49. # AB BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL
  50. # DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  51. # OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY
  52. # OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN
  53. # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  54. #
  55. ############################################################################ 
  56.  
  57. ICONT=icont -s
  58. ITWEAK=itweak
  59.  
  60.  
  61. MAKEFILE=Makefile
  62. SAMPLE_INIT=samp_ini.icn
  63. CMD=demo.cmd
  64.  
  65. ##### 'install' targets
  66.  
  67. install : itweak dbg_run.u1
  68.  
  69. itweak : itweak.icn
  70.     $(ICONT) itweak.icn
  71.  
  72. dbg_run.u1 : dbg_run.icn
  73.     $(ICONT) -c dbg_run.icn
  74.  
  75. ##### 'sample' targets: first the plain ones
  76. ##### The program is built from source files 'ipxref.icn' and 'options.icn'.
  77. ##### The name of the resulting program is 'sample'.
  78.  
  79. sample : ipxref.u1 options.u1 $(DEBUG)
  80.     $(ICONT) -u -o sample ipxref.u1 options.u1
  81.  
  82. ipxref.u1 : ipxref.icn
  83.     $(ICONT) -cu ipxref.icn
  84.  
  85. options.u1 : options.icn
  86.     $(ICONT) -cu options.icn
  87.  
  88. ##### 'sample' targets: the debugging stuff
  89.  
  90. sample-debug :
  91.     $(MAKE) -f $(MAKEFILE) sample DEBUG=$(SAMPLE_INIT)
  92.  
  93. $(SAMPLE_INIT) : ipxref.u1 options.u1
  94.     @echo '*** This is how the program files are tweaked...'
  95.     $(ITWEAK) -o $(SAMPLE_INIT) ipxref options
  96.     @echo '*** ... and don't forget to compile the generated file.'
  97.     $(ICONT) -cu $(SAMPLE_INIT)
  98.  
  99. sample-clean :
  100.     rm -f ipxref.u? options.u?
  101.     $(MAKE) -f $(MAKEFILE) sample
  102.  
  103. ##### demo session
  104.  
  105. demo : sample-debug
  106.     @echo 'We will now start a sample debugging session.'
  107.     @echo 'Debugging commands will be taken from the file $(CMD).'
  108.     @echo 'Please open an editor on this file -- the commands will'
  109.     @echo 'not appear in the debugger output.'
  110.     @echo '-------------- session start --------------------------'
  111.     @(DBG_INPUT=$(CMD); export DBG_INPUT; sample ipxref.icn)
  112.     @echo '-------------- session end ----------------------------'
  113.  
  114. ##### build executable and copy to ../../iexe
  115. ##### (nothing done in this case because the executable doesn't stand alone)
  116.  
  117. Iexe :
  118.  
  119. ##### cleanup
  120.  
  121. Clean :
  122.     rm -f $(ITWEAK) *.u[12]
  123.