summaryrefslogtreecommitdiff
path: root/expect/DbgMkfl.in
blob: 6bd6212e949c9b03ac7e54b0f4bcc5e7a6ee833b (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
#
# Makefile for tcl debugger
#

VERSION = \"@DBG_VERSION_FULL@\"
SHORT_VERSION = @DBG_VERSION@

# Compatible with Tcl version 7.5
# Compatible with Tk version 4.1

srcdir 	= @srcdir@
VPATH = @srcdir@

######################################################################
# The following lines are things you are likely to want to change
######################################################################

# Tcl include files.  (If you haven't installed Tcl yet, read the README file).
# This must point to the directory that contains ALL of Tcl's include
# files, not just the public ones.
TCLHDIR = @TCLHDIRDASHI@

# flags to pass to cc
# You should be able to leave this just the way it is.  However, here are some
# note if you run into problems:
#
# Avoid -O (optimize) unless you are convinced your optimizer is flawless
# (hint: not a chance).  I have heard many reports of -O causing Expect to
# misbehave.
# I encourage you to use -g (debugging).  While it is unlikely you will
# encounter an internal error in Expect, should this happen, I may just need
# the -g information and then you will need to recompile Expect.  As an aside,
# Expect is not a space or time pig, so this won't affect the performance of
# your Expect scripts.
# Note: On Linux systems which only have dynamic X libraries, the -g prevents
# the linker from using them.  So do not use -g on such systems.
CFLAGS = @DBG_CFLAGS@ @DBG_SHLIB_CFLAGS@

# which C compiler to use
CC = @CC@

# By default, `make install' will install the appropriate files in
# /usr/local/bin, /usr/local/lib, /usr/local/man, etc.  You can specify
# an installation prefix other than /usr/local here:
prefix = @prefix@

# You can specify a separate installation prefix for architecture-specific
# files such as binaries and libraries.
exec_prefix = @exec_prefix@

# If you have ranlib but it should be avoided, change this from "ranlib" #
# to something innocuous like "echo".  Known systems with this problem:
# older SCO boxes.
UNSHARED_RANLIB = @UNSHARED_RANLIB@

######################################################################
# End of things you are likely to want to change
######################################################################

libdir 	= $(exec_prefix)/lib
datadir	= $(prefix)/lib

mandir 	= @mandir@
man1dir = $(mandir)/man1
includedir = $(prefix)/include

# Where to store utility scripts.  This corresponds to the variable
# "dbg_library".
DBG_SCRIPTDIR	= $(datadir)/dbg

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

AR = ar
ARFLAGS = cr

# TCLHDIR includes "-I"
CPPFLAGS =	-I. -I$(srcdir) $(TCLHDIR) \
		-DDBG_VERSION=$(VERSION) \
		-DDBG_SCRIPTDIR=\"$(DBG_SCRIPTDIR)\"

CFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(CFLAGS)

.c.o:
	$(CC) -c $(CFLAGS_INT) $(HDEFS) $<

CFILES = Dbg.c Dbg_cmd.c
OFILES = Dbg.o Dbg_cmd.o

# libraries (both .a and shared)
DBG_LIB_FILES = @DBG_LIB_FILES@
# default Dbg library (shared if possible, otherwise static)
DBG_LIB_FILE = @DBG_LIB_FILE@
# Dbg object library (.a)
DBG_UNSHARED_LIB_FILE = @DBG_UNSHARED_LIB_FILE@
# Dbg object library (shared, if possible)
DBG_SHARED_LIB_FILE = @DBG_SHARED_LIB_FILE@

all: $(DBG_LIB_FILES)

$(DBG_UNSHARED_LIB_FILE): $(OFILES)
	-rm -f $(DBG_UNSHARED_LIB_FILE)
	$(AR) $(ARFLAGS) $(DBG_UNSHARED_LIB_FILE) $(OFILES)
	-$(UNSHARED_RANLIB) $(DBG_UNSHARED_LIB_FILE)

$(DBG_SHARED_LIB_FILE): $(OFILES)
	-rm -f $(DBG_SHARED_LIB_FILE)
	@TCL_SHLIB_LD@ -o $(DBG_SHARED_LIB_FILE) $(OFILES)

# Delete all the installed files that the `install' target creates
# (but not the noninstalled files such as `make all' creates)
uninstall:
	-rm -f	$(man1dir)/tcldbg.1 \
		$(libdir)/$(DBG_SHARED_LIB_FILE) \
		$(libdir)/$(DBG_UNSHARED_LIB_FILE) \
		$(includedir)/Dbg.h \
		$(DBG_SCRIPTDIR)/pkgIndex.tcl

install: $(DBG_LIB_FILES)
	${srcdir}/mkinstalldirs $(man1dir) $(libdir) $(includedir) $(DBG_SCRIPTDIR)
	$(INSTALL_DATA) $(srcdir)/tcldbg.man $(man1dir)/tcldbg.1
	if [ -s $(DBG_UNSHARED_LIB_FILE) ] ; then \
	  $(INSTALL_DATA) $(DBG_UNSHARED_LIB_FILE) $(libdir)/$(DBG_UNSHARED_LIB_FILE) ; \
	  $(UNSHARED_RANLIB) $(libdir)/$(DBG_UNSHARED_LIB_FILE) ; \
	fi
	if [ -s $(DBG_SHARED_LIB_FILE) ] ; then \
	  $(INSTALL_DATA) $(DBG_SHARED_LIB_FILE) $(libdir)/$(DBG_SHARED_LIB_FILE) ; \
	fi
	$(INSTALL_DATA) $(srcdir)/Dbg.h $(includedir)
# create utility-script directory
	$(INSTALL_DATA) $(srcdir)/Dbg_lib.tcl $(DBG_SCRIPTDIR)
	$(INSTALL_DATA) $(srcdir)/tclIndex $(DBG_SCRIPTDIR)


###################################
# Targets for Makefile and configure
###################################

Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) config.status
	@echo "Rebuilding the Makefile..."
	$(SHELL) config.status

configure: $(srcdir)/configure.in $(srcdir)/Makefile.in $(srcdir)/aclocal.m4
	autoconf configure.in > configure
	-@chmod a+x configure
	-rm -f config.cache
     
config.status: $(srcdir)/configure
	@echo "Rebuilding config.status..."
	$(SHELL) ./config.status --recheck

################################################
# Various "clean" targets follow GNU conventions
################################################

clean:
	-rm -f *~ *.o core \
		$(DBG_UNSHARED_LIB_FILE) $(DBG_SHARED_LIB_FILE)

# like "clean", but also delete files created by "configure"
distclean: clean
	-rm -f Makefile config.status config.cache config.log Dbg_cf.h

# like "clean", but doesn't delete test utilities or massaged scripts
# because most people don't have to worry about them
mostlyclean:
	-rm -f *~ *.o core \
		$(DBG_UNSHARED_LIB_FILE) $(DBG_SHARED_LIB_FILE)

# delete everything from current directory that can be reconstructed
# except for configure
realclean:	distclean

tclIndex: Dbg_lib.tcl
	expect -c "auto_mkindex . *.tcl;exit"

LINTFLAGS = -h -q -x 

lint:
	lint $(LINTFLAGS) $(CPPFLAGS) $(CFILES) $(TCLLINTLIB) | tee debug.lint

##################################
# Targets for development at NIST
##################################

nist:
	configure --verbose --prefix=/depot/tcl --exec-prefix=/depot/tcl/arch

# report globals that shouldn't be public but are
bad_globals:
	nm $(DBG_UNSHARED_LIB_FILE) | egrep -v " [a-zU] | _Dbg"

# after copying source directory, restablish all links
symlink:
	rm -f aclocal.m4
	ln -s ../expect/aclocal.m4

######################################
# Targets for pushing out releases
######################################

FTPDIR = /proj/itl/www/div826/subject/expect/tcl-debug

ftp:	tcl-debug-$(SHORT_VERSION).tar.Z tcl-debug-$(SHORT_VERSION).tar.gz
	cp tcl-debug-$(SHORT_VERSION).tar.Z $(FTPDIR)/tcl-debug.tar.Z
	cp tcl-debug-$(SHORT_VERSION).tar.gz $(FTPDIR)/tcl-debug.tar.gz
	cp HISTORY $(FTPDIR)
	cp README $(FTPDIR)/README.distribution
	rm tcl-debug-$(SHORT_VERSION).tar*
	ls -l $(FTPDIR)/tcl-debug.tar*

# make an alpha relase and install it on ftp server
alpha:	tcl-debug-$(SHORT_VERSION).tar.Z tcl-debug-$(SHORT_VERSION).tar.gz
	cp tcl-debug-$(SHORT_VERSION).tar.Z $(FTPDIR)/tcl-debug-alpha.tar.Z
	cp tcl-debug-$(SHORT_VERSION).tar.gz $(FTPDIR)/tcl-debug-alpha.tar.gz
	rm tcl-debug-$(SHORT_VERSION).tar*
	ls -l $(FTPDIR)/tcl-debug-alpha.tar*

tcl-debug-$(SHORT_VERSION).tar:
	rm -f ../tcl-debug-$(SHORT_VERSION)
	ln -s `pwd` ../tcl-debug-$(SHORT_VERSION)
	cd ..;tar cvfh $@ `pubfile tcl-debug-$(SHORT_VERSION)`
	mv ../$@ .

tcl-debug-$(SHORT_VERSION).tar.Z:	tcl-debug-$(SHORT_VERSION).tar
	compress -fc tcl-debug-$(SHORT_VERSION).tar > $@

tcl-debug-$(SHORT_VERSION).tar.gz:	tcl-debug-$(SHORT_VERSION).tar
	gzip -fc tcl-debug-$(SHORT_VERSION).tar > $@

Dbg.o: $(srcdir)/Dbg.c $(srcdir)/Dbg.h