aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/Makefile.in
blob: 96081783bae30758017c3b1dc95ef3ba1aff5880 (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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# Makefile for GNU compiler for the Java(TM) language.
#   Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1998,
#   1999 Free Software Foundation, Inc.

#This file is part of GNU CC.

#GNU CC 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, or (at your option)
#any later version.

#GNU CC 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 GNU CC; see the file COPYING.  If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston, MA 02111-1307, USA.

#Java and all Java-based marks are trademarks or registered trademarks
#of Sun Microsystems, Inc. in the United States and other countries.
#The Free Software Foundation is independent of Sun Microsystems, Inc.

# The makefile built from this file lives in the language subdirectory.
# Its purpose is to provide support for:
#
# 1) recursion where necessary, and only then (building .o's), and
# 2) building and debugging cc1 from the language subdirectory, and
# 3) nothing else.
#
# The parent makefile handles all other chores, with help from the
# language makefile fragment, of course.
#
# The targets for external use are:
# all, TAGS, ???mostlyclean, ???clean.

# Suppress smart makes who think they know how to automake Yacc files
.y.c:

# Variables that exist for you to override.
# See below for how to change them for certain systems.

# Various ways of specifying flags for compilations:  
# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
# BOOT_CFLAGS is the value of CFLAGS to pass
# to the stage2 and stage3 compilations
# XCFLAGS is used for most compilations but not when using the GCC just built.
XCFLAGS =
CFLAGS = -g
BOOT_CFLAGS = -O $(CFLAGS)
# These exists to be overridden by the x-* and t-* files, respectively.
X_CFLAGS =
T_CFLAGS =

X_CPPFLAGS =
T_CPPFLAGS =

CC = @CC@
SET_BISON = here=`pwd`; sdir=`cd $(srcdir) && pwd`; if test -f ../../bison; then bison="$$here/../../bison/bison -L $$sdir"; else bison=bison; fi
BISONFLAGS =
JAVABISONFLAGS = --name-prefix=java_
AR = ar
AR_FLAGS = rc
SHELL = /bin/sh
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi

# Define this as & to perform parallel make on a Sequent.
# Note that this has some bugs, and it seems currently necessary 
# to compile all the gen* files first by hand to avoid erroneous results.
P =

# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
# It omits XCFLAGS, and specifies -B./.
# It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)

# Tools to use when building a cross-compiler.
# These are used because `configure' appends `cross-make'
# to the makefile when making a cross-compiler.

# We don't use cross-make.  Instead we use the tools
# from the build tree, if they are available.
# program_transform_name and objdir are set by configure.in.
program_transform_name =
objdir = .

#version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
#mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`

# Directory where sources are, from where we are.
srcdir = @srcdir@
VPATH = @srcdir@

# Directory holding libgcj.zip.
prefix = @prefix@
datadir = @datadir@
libgcj_zip = $(datadir)/libgcj.zip

# Additional system libraries to link with.
CLIB=

# Top build directory, relative to here.
top_builddir = ..

# Internationalization library.
INTLLIBS = @INTLLIBS@

# Choose the real default target.
ALL=all

# End of variables for you to override.

# Definition of `all' is here so that new rules inserted by sed
# do not specify the default target.
all: all.indirect

# This tells GNU Make version 3 not to put all variables in the environment.
.NOEXPORT:

# sed inserts variable overrides after the following line.
####target overrides
@target_overrides@
####host overrides
@host_overrides@
####cross overrides
@cross_overrides@
####build overrides
@build_overrides@
####site overrides
#
# Now figure out from those variables how to compile and link.

all.indirect: Makefile ../jc1$(exeext) ../jcf-dump$(exeext) \
	../jvgenmain$(exeext) ../gcjh$(exeext) ../jv-scan$(exeext)

# IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@

# This is the variable actually used when we compile.
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) -W -Wall

# Likewise.
ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)

# This is where we get libiberty.a from.
LIBIBERTY = ../../libiberty/libiberty.a

# This is where we get zlib from.  zlibdir is -L../../zlib by default,
# and is nothing when configured with --enable-system-zlib.
ZLIB = @zlibdir@ -lz

# How to link with both our special library facilities
# and the system's installed libraries.
LIBS = $(ZLIB) $(INTLLIBS) $(LIBIBERTY) $(CLIB)
LIBDEPS = $(INTLLIBS) $(LIBIBERTY) ../errors.o

# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
# so that tm.h and config.h will be found in the compilation
# subdirectory rather than in the source directory.
INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include @zlibinc@

# Always use -I$(srcdir)/config when compiling.
.c.o:
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<

#
# Lists of files for various purposes.

# Language-specific object files for Gcc/Java:

# Remember to keep this list in sync with JAVA_SRCS in Make-lang.in!!!
#
JAVA_OBJS = parse.o class.o decl.o expr.o constants.o lang.o typeck.o \
  except.o verify.o zextract.o jcf-io.o jcf-parse.o mangle.o jcf-write.o \
  buffer.o check-init.o jcf-depend.o jcf-path.o xref.o boehm.o

JAVA_OBJS_LITE = parse-scan.o jv-scan.o

# Language-independent object files.
BACKEND = ../toplev.o ../libbackend.a

compiler: ../jc1$(exeext) ../jv-scan$(exeext)
../jc1$(exeext): $(P) $(JAVA_OBJS) $(BACKEND) $(LIBDEPS)
	rm -f ../jc1$(exeext)
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JAVA_OBJS) $(BACKEND) $(LIBS)
../jv-scan$(exeext): $(P) $(JAVA_OBJS_LITE) ../version.o $(LIBDEPS)
	rm -f ../jv-scan$(exeext)
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JAVA_OBJS_LITE) ../version.o $(LIBS)

../jcf-dump$(exeext): jcf-dump.o jcf-io.o jcf-depend.o jcf-path.o \
		zextract.o ../version.o $(LIBDEPS)
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ jcf-dump.o jcf-io.o \
	  jcf-depend.o jcf-path.o zextract.o ../errors.o ../version.o $(LIBS)

# Dependencies here must be kept in sync with dependencies in Make-lang.in.
../jvgenmain$(exeext):  jvgenmain.o mangle.o $(LIBDEPS)
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ jvgenmain.o mangle.o $(LIBS)

../gcjh$(exeext): gjavah.o jcf-io.o jcf-depend.o jcf-path.o \
		zextract.o ../version.o $(LIBDEPS)
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gjavah.o jcf-io.o \
	  jcf-depend.o jcf-path.o zextract.o ../errors.o ../version.o $(LIBS)

Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
	cd ..; $(SHELL) config.status

native: config.status ../jc1$(exeext)
#
# Compiling object files from source files.
TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
        $(srcdir)/../machmode.h $(srcdir)/../machmode.def ../tree-check.h
JAVA_TREE_H = $(TREE_H) java-tree.h java-tree.def
RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
        $(srcdir)/../machmode.h $(srcdir)/../machmode.def ../genrtl.h
EXPR_H = $(srcdir)/../expr.h ../insn-codes.h

# Separating PARSE_DIR from PARSE_RELDIR lets us easily change the
# code to support building parse.c in the build directory, at some
# expense in readability.
# This code must be kept in sync with Make-lang.in.
PARSE_DIR = $(srcdir)
PARSE_RELDIR = .
PARSE_C = $(PARSE_DIR)/parse.c
PARSE_SCAN_C = $(PARSE_DIR)/parse-scan.c
PARSE_H = $(srcdir)/parse.h

$(PARSE_C):  $(srcdir)/parse.y
	$(SET_BISON); \
	cd $(PARSE_DIR) ; $$bison -t $(BISONFLAGS) $(JAVABISONFLAGS) \
	    -o p$$$$.c $(PARSE_RELDIR)/parse.y ; \
	mv -f p$$$$.c parse.c
$(PARSE_SCAN_C):  $(srcdir)/parse-scan.y
	$(SET_BISON); \
	cd $(PARSE_DIR) ; $$bison -t $(BISONFLAGS) -o ps$$$$.c \
	    $(PARSE_RELDIR)/parse-scan.y ; \
	mv -f ps$$$$.c parse-scan.c

lex.c: keyword.h lex.h

lang.o: $(srcdir)/java-tree.def

keyword.h: keyword.gperf
	gperf -L C -F ', 0' -p -t -j1 -i 1 -g -o -N java_keyword -k1,3,$$ \
	keyword.gperf > keyword.h || ( \
	echo "Please update your 'gperf' from ftp://ftp.gnu.org/pub/gnu/gperf/" >&2 ; \
	exit 1 )

jcf-path.o : jcf-path.c $(CONFIG_H) $(srcdir)/../system.h jcf.h
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
	  -DLIBGCJ_ZIP_FILE='"$(libgcj_zip)"' $(srcdir)/jcf-path.c

# These exist for maintenance purposes.

# Update the tags table.
TAGS: force
	cd $(srcdir) ;				\
	etags *.c *.h ;				\
	echo 'l' | tr 'l' '\f' >> TAGS ;	\
	echo 'parse.y,0' >> TAGS ; 		\
	etags -a ../*.h ../*.c;

.PHONY: TAGS

mostlyclean:
	rm -f *.o

clean:  mostlyclean

force:

parse.o : $(PARSE_C) jcf-reader.c $(CONFIG_H) $(srcdir)/../system.h \
  $(srcdir)/../function.h $(JAVA_TREE_H) $(srcdir)/lex.c $(PARSE_H) \
  $(srcdir)/lex.h $(srcdir)/../ggc.h
jcf-dump.o : $(CONFIG_H) $(srcdir)/../system.h $(JAVA_TREE_H) jcf-dump.c \
  jcf-reader.c jcf.h javaop.h javaop.def $(srcdir)/../version.h
gjavah.o : $(CONFIG_H) $(srcdir)/../system.h $(JAVA_TREE_H) gjavah.c \
  jcf-reader.c jcf.h javaop.h $(srcdir)/../version.h
boehm.o: boehm.c $(CONFIG_H) $(srcdir)/../system.h $(TREE_H) $(JAVA_TREE_H) \
  $(PARSE_H)
buffer.o : buffer.c $(CONFIG_H) buffer.h $(srcdir)/../gansidecl.h \
  $(srcdir)/../system.h $(srcdir)/../toplev.h
check-init.o : check-init.c $(CONFIG_H) $(srcdir)/../gansidecl.h \
  $(JAVA_TREE_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
class.o : class.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) jcf.h $(PARSE_H) \
  $(srcdir)/../gansidecl.h $(srcdir)/../toplev.h $(srcdir)/../system.h \
  $(srcdir)/../output.h $(srcdir)/../ggc.h
constants.o : constants.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h \
  $(srcdir)/../toplev.h $(srcdir)/../system.h $(srcdir)/../ggc.h
decl.o : decl.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h \
  $(srcdir)/../toplev.h $(srcdir)/../system.h $(srcdir)/../function.h \
  $(srcdir)/../defaults.h $(srcdir)/../gcc.h
except.o : except.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(srcdir)/../real.h \
  $(RTL_H) javaop.h java-opcodes.h $(srcdir)/../except.h java-except.h \
  $(srcdir)/../eh-common.h $(srcdir)/../toplev.h $(srcdir)/../system.h \
  $(srcdir)/../function.h
expr.o : expr.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(srcdir)/../real.h \
  $(RTL_H) $(EXPR_H) javaop.h java-opcodes.h $(srcdir)/../except.h \
  java-except.h java-except.h parse.h $(srcdir)/../toplev.h \
  $(srcdir)/../system.h $(srcdir)/../ggc.h
jcf-depend.o : jcf-depend.c $(CONFIG_H) $(srcdir)/../system.h jcf.h
jcf-io.o : jcf-io.c $(CONFIG_H) $(srcdir)/../system.h $(JAVA_TREE_H)
jcf-parse.o : jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) $(srcdir)/../flags.h \
  $(srcdir)/../input.h java-except.h $(srcdir)/../system.h \
  $(srcdir)/../toplev.h $(PARSE_H) $(srcdir)/../ggc.h
jcf-write.o : jcf-write.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(RTL_H) \
  java-opcodes.h parse.h buffer.h $(srcdir)/../system.h \
  $(srcdir)/../toplev.h $(srcdir)/../ggc.h
jv-scan.o : jv-scan.c $(CONFIG_H) $(srcdir)/../system.h $(srcdir)/../version.h
jvgenmain.o : jvgenmain.c $(CONFIG_H) $(srcdir)/../system.h
lang.o : lang.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(srcdir)/../input.h \
  $(srcdir)/../toplev.h $(srcdir)/../system.h $(RTL_H) $(EXPR_H)
mangle.o : mangle.c $(CONFIG_H) jcf.h $(JAVA_TREE_H) $(srcdir)/../system.h \
  $(srcdir)/../toplev.h $(srcdir)/../ggc.h
parse-scan.o : $(CONFIG_H) $(srcdir)/../system.h $(srcdir)/../toplev.h \
  $(srcdir)/lex.c $(PARSE_H) $(srcdir)/lex.h
typeck.o : typeck.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h convert.h \
  $(srcdir)/../toplev.h $(srcdir)/../system.h $(srcdir)/../ggc.h
verify.o : verify.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h javaop.h java-opcodes.h \
  java-except.h $(srcdir)/../toplev.h $(srcdir)/../system.h
xref.o : xref.c xref.h $(CONFIG_H) $(JAVA_TREE_H) $(srcdir)/../toplev.h \
  $(srcdir)/../system.h
zextract.o : zextract.c $(CONFIG_H) $(srcdir)/../system.h zipfile.h