Debian Codegraph @

ipl/packs/itweak/Makefile

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