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

ICONT=icont -s
ITWEAK=itweak


MAKEFILE=Makefile
SAMPLE_INIT=samp_ini.icn
CMD=demo.cmd

##### 'install' targets

install : itweak dbg_run.u1

itweak : itweak.icn
	$(ICONT) itweak.icn

dbg_run.u1 : dbg_run.icn
	$(ICONT) -c dbg_run.icn

##### 'sample' targets: first the plain ones
##### The program is built from source files 'ipxref.icn' and 'options.icn'.
##### The name of the resulting program is 'sample'.

sample : ipxref.u1 options.u1 $(DEBUG)
	$(ICONT) -u -o sample ipxref.u1 options.u1

ipxref.u1 : ipxref.icn
	$(ICONT) -cu ipxref.icn

options.u1 : options.icn
	$(ICONT) -cu options.icn

##### 'sample' targets: the debugging stuff

sample-debug :
	$(MAKE) -f $(MAKEFILE) sample DEBUG=$(SAMPLE_INIT)

$(SAMPLE_INIT) : ipxref.u1 options.u1
	@echo '*** This is how the program files are tweaked...'
	$(ITWEAK) -o $(SAMPLE_INIT) ipxref options
	@echo '*** ... and don't forget to compile the generated file.'
	$(ICONT) -cu $(SAMPLE_INIT)

sample-clean :
	rm -f ipxref.u? options.u?
	$(MAKE) -f $(MAKEFILE) sample

##### demo session

demo : sample-debug
	@echo 'We will now start a sample debugging session.'
	@echo 'Debugging commands will be taken from the file $(CMD).'
	@echo 'Please open an editor on this file -- the commands will'
	@echo 'not appear in the debugger output.'
	@echo '-------------- session start --------------------------'
	@(DBG_INPUT=$(CMD); export DBG_INPUT; sample ipxref.icn)
	@echo '-------------- session end ----------------------------'

##### build executable and copy to ../../iexe
##### (nothing done in this case because the executable doesn't stand alone)

Iexe :

##### cleanup

Clean :
	rm -f $(ITWEAK) *.u[12]