1 # Makefile template for Configure for the erc32sim library.
2 # Copyright (C) 1993 Free Software Foundation, Inc.
3 # Written by Cygnus Support
4 # Modified by J.Gaisler ESA/ESTEC
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 exec_prefix = @exec_prefix@
26 host_alias = @host_alias@
27 target_alias = @target_alias@
28 program_transform_name = @program_transform_name@
31 tooldir = $(exec_prefix)/$(target_alias)
35 man1dir = $(mandir)/man1
36 man2dir = $(mandir)/man2
37 man3dir = $(mandir)/man3
38 man4dir = $(mandir)/man4
39 man5dir = $(mandir)/man5
40 man6dir = $(mandir)/man6
41 man7dir = $(mandir)/man7
42 man8dir = $(mandir)/man8
43 man9dir = $(mandir)/man9
45 includedir = @includedir@
50 INSTALL_PROGRAM = @INSTALL_PROGRAM@
51 INSTALL_DATA = @INSTALL_DATA@
52 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
53 INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1
63 # UARTS run at about 115200 baud (simulator time). Add -DFAST_UART to
64 # CFLAGS if faster (infinite) UART speed is desired. Might affect the
65 # behaviour of UART interrupt routines ...
70 CFLAGS2 = -g -O3 -DSTAT -DFAST_UART -DIUREV0 -DMECREV0
76 INCDIR = $(srcdir)/../../include
77 CSEARCH = -I. -I$(srcdir) -I$(INCDIR) -I../../bfd -I$(srcdir)/../../bfd \
78 -I$(srcdir)/../../gdb -I$(srcdir)/../../gdb/config
84 CFILES = sis.c exec.c erc32.c interf.c run.c help.c float.c
85 OFILES = exec.o erc32.o func.o help.o float.o
88 all: end.h sis run $(TARGETLIB)
91 $(CC) $(srcdir)/end.c -o end
97 $(CC) $(CFLAGS) $(CLAGS2) -o sis sis.o $(OFILES) \
98 ../../opcodes/libopcodes.a ../../readline/libreadline.a \
99 ../../bfd/libbfd.a ../../libiberty/libiberty.a \
102 run: run.o interf.o $(OFILES)
103 $(CC) $(CFLAGS) $(CLAGS2) -o run run.o interf.o $(OFILES) \
104 ../../opcodes/libopcodes.a ../../readline/libreadline.a \
105 ../../bfd/libbfd.a ../../libiberty/libiberty.a \
109 rm -f *.o libsim.a sis run end end.h
112 rm -rf Makefile config.status sysdep.h
114 #### host and target dependent Makefile fragments come in here.
118 "against=$(against)" \
120 "AR_FLAGS=$(AR_FLAGS)" \
124 "MAKEINFO=$(MAKEINFO)" \
125 "INSTALL=$(INSTALL)" \
126 "INSTALL_DATA=$(INSTALL_DATA)" \
127 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
130 $(OFILES) sis.o interf.o : end.h sis.h
133 $(CC) -c $(CFLAGS) $(CFLAGS2) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) $<
136 # C source files that correspond to .o's.
138 STAGESTUFF = $(TARGETLIB) $(OFILES)
151 # HDEPFILES comes from the host config; TDEPFILES from the target config.
154 $(TARGETLIB): $(OFILES) interf.o
156 $(AR) $(AR_FLAGS) $(TARGETLIB) $(OFILES) interf.o
157 $(RANLIB) $(TARGETLIB)
159 # Circumvent Sun Make bug with VPATH.
160 sparc-opc.o: sparc-opc.c
165 etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c
168 sis.o: sis.c sis.h end.h
169 exec.o: exec.c sis.h end.h
170 erc32.o: erc32.c sis.h end.h
171 interf.o: interf.c sis.h end.h
174 float.o: float.c sis.h end.h
176 # Mark everything as depending on config.status, since the timestamp on
177 # sysdep.h might actually move backwards if we reconfig and relink it
178 # to a different hosts/h-xxx.h file. This will force a recompile anyway.
179 RECONFIG = config.status
181 # Dummy target to force execution of dependent targets.
185 # Copy the files into directories where they will be run.
187 $(INSTALL_XFORM) sis $(bindir)/sis ; \
188 n=`echo sis | sed '$(program_transform_name)'`; \
189 rm -f $(bindir)/sis; \
190 ln $(bindir)/$$n $(bindir)/sis \
191 || $(INSTALL_PROGRAM) sis $(bindir)/sis; \
192 test -d $(tooldir) || mkdir $(tooldir); \
193 test -d $(tooldir)/bin || mkdir $(tooldir)/bin; \
194 rm -f $(tooldir)/bin/sis; \
195 ln $(bindir)/$$n $(tooldir)/bin/sis \
196 || $(INSTALL_PROGRAM) sis $(tooldir)/bin/sis; \
199 Makefile: $(srcdir)/Makefile.in
200 $(SHELL) ./config.status