Commit | Line | Data |
---|---|---|
594266fc SC |
1 | # Makefile template for Configure for the h8300sim library. |
2 | # Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc. | |
3 | # Written by Cygnus Support. | |
4 | # | |
5 | # This program is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 2 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # This program is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | # | |
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program; if not, write to the Free Software | |
17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
18 | ||
19 | srcdir = . | |
d2fd61a8 SC |
20 | srcroot = $(srcdir)/../../ |
21 | ||
594266fc SC |
22 | |
23 | prefix = /usr/local | |
d2fd61a8 | 24 | |
594266fc SC |
25 | program_transform_name = |
26 | exec_prefix = $(prefix) | |
27 | bindir = $(exec_prefix)/bin | |
28 | libdir = $(exec_prefix)/lib | |
d2fd61a8 | 29 | tooldir = $(libdir)/$(target_alias) |
594266fc SC |
30 | |
31 | datadir = $(prefix)/lib | |
32 | mandir = $(prefix)/man | |
33 | man1dir = $(mandir)/man1 | |
34 | man2dir = $(mandir)/man2 | |
35 | man3dir = $(mandir)/man3 | |
36 | man4dir = $(mandir)/man4 | |
37 | man5dir = $(mandir)/man5 | |
38 | man6dir = $(mandir)/man6 | |
39 | man7dir = $(mandir)/man7 | |
40 | man8dir = $(mandir)/man8 | |
41 | man9dir = $(mandir)/man9 | |
42 | infodir = $(prefix)/info | |
43 | includedir = $(prefix)/include | |
44 | oldincludedir = | |
45 | docdir = $(srcdir)/doc | |
46 | ||
47 | SHELL = /bin/sh | |
48 | ||
d2fd61a8 SC |
49 | |
50 | ||
51 | INSTALL = $(srcroot)/install.sh -c | |
594266fc SC |
52 | INSTALL_PROGRAM = $(INSTALL) |
53 | INSTALL_DATA = $(INSTALL) | |
d2fd61a8 SC |
54 | INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' |
55 | INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1 | |
56 | ||
594266fc | 57 | |
d2fd61a8 SC |
58 | |
59 | CC_FOR_BUILD = cc | |
594266fc SC |
60 | AR = ar |
61 | AR_FLAGS = qc | |
62 | CFLAGS = -g | |
63 | BISON = bison | |
64 | MAKEINFO = makeinfo | |
65 | RANLIB = ranlib | |
d2fd61a8 SC |
66 | X=xstuff.o |
67 | XL=-lX11 | |
68 | X= | |
69 | XL= | |
594266fc | 70 | INCDIR = $(srcdir)/../../include |
d2fd61a8 | 71 | CSEARCH = -I. -I$(srcdir) -I../../include -I../../bfd -I$(INCDIR) -I$(srcdir)/../../bfd -I$(srcdir)/../../gdb |
594266fc SC |
72 | DEP = mkdep |
73 | ||
74 | #### host, target, and site specific Makefile frags come in here. | |
75 | ||
d2fd61a8 | 76 | all: run libsim.a |
594266fc SC |
77 | |
78 | ||
d2fd61a8 SC |
79 | run: interp.o $(X) run.o table.o |
80 | $(CC) $(CFLAGS) -o run $(X) interp.o table.o run.o ../../bfd/libbfd.a ../../libiberty/libiberty.a $(XL) | |
594266fc SC |
81 | |
82 | interp.o:interp.c code.c table.c | |
83 | run.o:run.c | |
84 | ||
d2fd61a8 SC |
85 | libsim.a:interp.o table.o |
86 | $(AR) $(ARFLAGS) libsim.a interp.o table.o | |
87 | $(RANLIB) libsim.a | |
88 | ||
594266fc SC |
89 | code.c:gencode |
90 | ./gencode -x >code.c | |
d2fd61a8 | 91 | # indent code.c |
594266fc SC |
92 | |
93 | table.c:gencode | |
94 | ./gencode -s >table.c | |
d2fd61a8 | 95 | # indent table.c |
594266fc | 96 | |
d2fd61a8 SC |
97 | gencode:gencode.c |
98 | $(CC_FOR_BUILD) -o gencode $< | |
e615309a | 99 | |
594266fc SC |
100 | |
101 | #### host and target dependent Makefile fragments come in here. | |
102 | ### | |
103 | ||
104 | FLAGS_TO_PASS = \ | |
105 | "against=$(against)" \ | |
106 | "AR=$(AR)" \ | |
107 | "AR_FLAGS=$(AR_FLAGS)" \ | |
108 | "CC=$(CC)" \ | |
109 | "CFLAGS=$(CFLAGS)" \ | |
110 | "RANLIB=$(RANLIB)" \ | |
111 | "MAKEINFO=$(MAKEINFO)" \ | |
112 | "INSTALL=$(INSTALL)" \ | |
113 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
114 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ | |
115 | "BISON=$(BISON)" | |
116 | ||
117 | .c.o: | |
118 | $(CC) -c $(CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) $< | |
119 | ||
120 | ||
121 | ||
122 | .NOEXPORT: | |
123 | ||
124 | check: | |
125 | ||
126 | info: | |
127 | clean-info: | |
128 | install-info: | |
129 | ||
130 | # HDEPFILES comes from the host config; TDEPFILES from the target config. | |
131 | ||
132 | ||
133 | ||
134 | tags etags: TAGS | |
135 | ||
136 | TAGS: force | |
137 | etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c | |
138 | ||
139 | clean: | |
140 | rm -f *.[oa] *~ core *.E *.p *.ip aout-params.h gen-aout | |
141 | ||
142 | clobber realclean: clean | |
143 | rm -f libbfd.a TAGS | |
144 | ||
145 | # Mark everything as depending on config.status, since the timestamp on | |
146 | # sysdep.h might actually move backwards if we reconfig and relink it | |
147 | # to a different hosts/h-xxx.h file. This will force a recompile anyway. | |
148 | RECONFIG = config.status | |
149 | ||
150 | ||
151 | ||
152 | # This target should be invoked before building a new release. | |
153 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
154 | # | |
155 | roll: | |
156 | @V=`cat VERSION` ; \ | |
157 | MAJ=`sed 's/\..*//' VERSION` ; \ | |
158 | MIN=`sed 's/.*\.//' VERSION` ; \ | |
159 | V=$$MAJ.`expr $$MIN + 1` ; \ | |
160 | rm -f VERSION ; \ | |
161 | echo $$V >VERSION ; \ | |
162 | echo Version $$V | |
163 | ||
164 | # Dummy target to force execution of dependent targets. | |
165 | # | |
166 | force: | |
167 | ||
d2fd61a8 | 168 | # Copy the files into directories where they will be run. |
594266fc | 169 | install: |
d2fd61a8 SC |
170 | srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
171 | $(INSTALL_XFORM) run $(bindir)/run ; \ | |
172 | n=`t='$(program_transform_name)'; echo run | sed -e "" $$t`; \ | |
173 | if [ -d $(tooldir) ] ; then \ | |
174 | if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \ | |
175 | rm -f $(tooldir)/bin/run; \ | |
176 | ln $(bindir)/$$n $(tooldir)/bin/run \ | |
177 | || $(INSTALL_PROGRAM) run $(tooldir)/bin/run; \ | |
178 | else true; fi | |
179 | ||
180 | install-man: run.1 | |
181 | $(INSTALL_XFORM1) $(srcdir)/run.1 $(man1dir)/run.1 | |
594266fc SC |
182 | |
183 | ||
184 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) | |
185 | $(SHELL) ./config.status | |
186 | ||
187 | dep: $(CFILES) | |
188 | mkdep $(CFLAGS) $? | |
189 | ||
190 | ||
191 | # What appears below is generated by a hacked mkdep using gcc -MM. | |
192 | ||
193 | # DO NOT DELETE THIS LINE -- mkdep uses it. | |
194 | # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. | |
195 | ||
196 | ||
197 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY | |
198 |