aboutsummaryrefslogtreecommitdiff
path: root/sim/w65/Makefile.in
blob: 8943bd5d68321792d8ab5e4669e76f2b27e89ab8 (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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# Makefile for GNU binary-file utilities
# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.

# This file is part of GNU binutils.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

VPATH = @srcdir@
srcdir = @srcdir@

prefix = @prefix@
exec_prefix = @exec_prefix@

host_alias = @host_alias@
target_alias = @target_alias@
program_transform_name = @program_transform_name@
bindir = @bindir@
libdir = @libdir@
tooldir = $(exec_prefix)/$(target_alias)

datadir = @datadir@
mandir = @mandir@
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man4dir = $(mandir)/man4
man5dir = $(mandir)/man5
man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = @infodir@
includedir = @includedir@

# This can be referenced by the gettext configuration code.
top_builddir = ..

SHELL = /bin/sh

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

AR = @AR@
AR_FLAGS = qv
CC = @CC@
CFLAGS = @CFLAGS@
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
RANLIB = @RANLIB@
TEXI2ROFF=texi2roff
MAKEOVERRIDES=
CC_FOR_BUILD = @CC_FOR_BUILD@

HDEFINES = @HDEFINES@
TDEFINES =

# Comment these out if using lex.
# Distribution version

# Distribution name

# Where to find texinfo.tex to format docn with TeX
TEXIDIR = $(srcdir)/../texinfo

# These should all be the same program too.
RUN_PROG=run
SIM_LIB=libsim.a
ADDL_LIBS=

PROGS = $(RUN_PROG)
LIBS= $(SIM_LIB)

DISTSTUFF = $(PROGS) $(LIBS)

BASEDIR = $(srcdir)/../..
BFDDIR = $(BASEDIR)/bfd
INCDIR	= $(BASEDIR)/include
GDBDIR = $(BASEDIR)/gdb
INCLUDES = -I. -I$(srcdir) -I../../bfd -I$(BFDDIR) -I$(INCDIR) -I$(GDBDIR)

#### host and target dependant Makefile fragments come in here.
###

ALL_CFLAGS = $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS)

.c.o:
	$(CC) -c $(ALL_CFLAGS) $<

LIBIBERTY = ../../libiberty/libiberty.a

BFD = ../../bfd/libbfd.a

INTLLIBS = @INTLLIBS@
INTLDEPS = @INTLDEPS@

RUNTEST = runtest
RUNTESTFLAGS = 
FLAGS_TO_PASS = \
	"CC=$(CC)" \
	"CFLAGS=$(CFLAGS)" \
	"RUNTEST=$(RUNTEST)" \
	"RUNTESTFLAGS=$(RUNTESTFLAGS)"

#
## The rules

all: $(LIBS) $(PROGS)


$(RUN_PROG): $(LIBS) run.o $(BFD) $(INTLDEPS)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $(RUN_PROG) run.o $(SIM_LIB) $(BFD) $(INTLLIBS) $(LIBIBERTY)

$(SIM_LIB): case.o interp.o
	rm -f $(SIM_LIB)
	$(AR) $(AR_FLAGS) $(SIM_LIB) case.o interp.o
	$(RANLIB) $(SIM_LIB)

case.c: gencode
	./gencode -c >case.c                     ; \
	if [ -x /usr/latest/bin/indent ] ; then    \
		/usr/latest/bin/indent case.c    ; \
	fi

optable:gencode
	./gencode >optable
	./gencode -a >$(srcdir)/../../opcodes/w65-opc.h

gencode:gencode.c
	$(CC_FOR_BUILD) -o gencode $<

run.o:run.c config.h
interp.o:interp.c config.h


######################################################################

mostlyclean:
	-rm -f *.o *~ \#* core binutils.?? binutils.??? case.c

clean: mostlyclean
	-rm -f $(PROGS) *.o *.a

distclean:
	-rm -f Makefile config.status sysdep.h *.o *~ \#* core y.* \
		binutils.?? binutils.??s binutils.aux binutils.log \
		binutils.toc gencode run config.log
	-rm -f $(PROGS) config.h stamp-h

maintainer-clean realclean: clean distclean
	-rm -f $(DISTSTUFF) TAGS

etags tags: TAGS

TAGS: force
	etags $(INCDIR)/*.h $(srcdir)/*.[hc] 

install: all installdirs
	for i in $(PROGS) ; do \
	  n=`echo $$i | sed -e 's/.new//' | sed '$(program_transform_name)'`; \
	  $(INSTALL_PROGRAM) $$i $(bindir)/$$n; \
	done

installdirs:
	$(SHELL) $(srcdir)/../../mkinstalldirs $(bindir)

install-info:

clean-info:
	-rm -rf *.info*

# Making a dist:
# cvs rtag binutils-x-yy ld+utils
# cvs co -r binutils-x-yy ld+utils
# cd {HERE}; make dist [-f Makefile.in]

dist: $(DIST_NAME).tar.z

diststuff: $(DISTSTUFF)

$(DIST_NAME).tar.z:
	cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME)
	make diststuff -f Makefile.in
	cd ../ld; make diststuff -f Makefile.in
	cd ../gprof; make diststuff -f Makefile.in
	cd ../texinfo; mv texinfo.tex ..; rm -rf *; mv ../texinfo.tex .
	# Take out texinfo from configurable dirs
	mv ../configure.in tmp; \
	  sed -e '/^host_tools=/s/texinfo //' <tmp >../configure.in; rm tmp
	cd ..; chmod og=u `find . -print`
	cd ../..; tar chf - $(DIST_NAME) | gzip >$(DIST_NAME).tar.z
	rm -rf ../../$(DIST_NAME)


# Dummy target to force execution of dependent targets.
#
force:

# Target to uncomment host-specific lines in this makefile.  Such lines must
# have the following string beginning in column 1: #__<hostname>__#
# Original Makefile is backed up as 'Makefile.old'.
#
# Invoke with:  make make HOST=xxx
#
make:
	-@if test $(HOST)x = x ; then \
		echo 'Specify "make make HOST=???"'; \
		exit 1; \
	fi ; \
	grep -s "^#The next line was generated by 'make make'" Makefile; \
	if test $$? = 0 ; then	\
		echo "Makefile has already been processed with 'make make'";\
		exit 1; \
	fi ; \
	mv -f Makefile Makefile.old; \
	echo "#The next line was generated by 'make make'"	 >Makefile ; \
	echo "HOST=$(HOST)"					>>Makefile ; \
	echo							>>Makefile ; \
	sed "s/^#__$(HOST)__#//" < Makefile.old			>>Makefile

Makefile: Makefile.in config.status
	CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status

config.h: stamp-h ; @true
stamp-h: config.in config.status
	CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status

config.status: configure
	$(SHELL) ./config.status --recheck

### Local Variables: ***
### mode:fundamental ***
### page-delimiter: "^#" ***
### End: ***
### end of file