]> gcc.gnu.org Git - gcc.git/blame - gcc/java/Make-lang.in
[multiple changes]
[gcc.git] / gcc / java / Make-lang.in
CommitLineData
e04a16fb
AG
1# Top level makefile fragment for the GNU compiler for the Java(TM)
2# language.
3# Copyright (C) 1996, 1998 Free Software Foundation, Inc.
4
5#This file is part of GNU CC.
6
7#GNU CC is free software; you can redistribute it and/or modify
8#it under the terms of the GNU General Public License as published by
9#the Free Software Foundation; either version 2, or (at your option)
10#any later version.
11
12#GNU CC is distributed in the hope that it will be useful,
13#but WITHOUT ANY WARRANTY; without even the implied warranty of
14#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15#GNU General Public License for more details.
16
17#You should have received a copy of the GNU General Public License
18#along with GNU CC; see the file COPYING. If not, write to
19#the Free Software Foundation, 59 Temple Place - Suite 330,
20#Boston, MA 02111-1307, USA.
21
22#Java and all Java-based marks are trademarks or registered trademarks
23#of Sun Microsystems, Inc. in the United States and other countries.
24#The Free Software Foundation is independent of Sun Microsystems, Inc.
25
26# This file provides the language dependent support in the main Makefile.
27# Each language makefile fragment must provide the following targets:
28#
29# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
30# foo.info, foo.dvi,
31# foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
32# foo.uninstall, foo.distdir,
33# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
34# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
35#
36# where `foo' is the name of the language.
37#
38# It should also provide rules for:
39#
40# - making any compiler driver (eg: g++)
41# - the compiler proper (eg: jc1)
42# - define the names for selecting the language in LANGUAGES.
43\f
44# Extra flags to pass to recursive makes.
45JAVA_FLAGS_TO_PASS = \
46 "JAVA_FOR_BUILD=$(JAVA_FOR_BUILD)" \
47 "JAVAFLAGS=$(JAVAFLAGS)" \
48 "JAVA_FOR_TARGET=$(JAVA_FOR_TARGET)"
49
50# Actual names to use when installing a native compiler.
51JAVA_INSTALL_NAME = `t='$(program_transform_name)'; echo gcj | sed $$t`
52
53# Actual names to use when installing a cross-compiler.
54JAVA_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcj | sed $$t`
55
56\f
76f42086
JL
57GCJ = gcj
58
e04a16fb 59# Define the names for selecting java in LANGUAGES.
257fafbb 60java: jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) gcjh$(exeext) jv-scan$(exeext) jcf-dump$(exeext)
e04a16fb
AG
61
62# Define the name of target independant tools to be installed in $(bindir)
63# Names are subject to changes
64JAVA_TARGET_INDEPENDENT_BIN_TOOLS = gcjh jv-scan jcf-dump
65
66# Tell GNU make to ignore these if they exist.
67.PHONY: java
68
e04a16fb
AG
69# Remember to keep this list in sync with JAVA_OBJS in Makefile.in!!!
70#
71JAVA_SRCS = $(srcdir)/java/parse.y $(srcdir)/java/class.c \
72 $(srcdir)/java/decl.c $(srcdir)/java/expr.c $(srcdir)/java/constants.c \
73 $(srcdir)/java/lang.c $(srcdir)/java/typeck.c $(srcdir)/java/except.c \
74 $(srcdir)/java/verify.c $(srcdir)/java/zextract.c $(srcdir)/java/jcf-io.c \
75 $(srcdir)/java/jcf-parse.c $(srcdir)/java/mangle.c \
fc45c7ef 76 $(srcdir)/java/jcf-write.c $(srcdir)/java/buffer.c \
8603f9c5 77 $(srcdir)/java/jcf-depend.c $(srcdir)/java/jcf-path.c
e04a16fb
AG
78
79jc1$(exeext): $(P) $(JAVA_SRCS) $(LIBDEPS) stamp-objlist
80 cd java; $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jc1$(exeext)
81
82$(GCJ).c: $(srcdir)/gcc.c
83 -rm -f $@
84 $(LN_S) $(srcdir)/gcc.c $@
85
86jvspec.o: $(srcdir)/java/jvspec.c
87 $(CC) -c -DWITH_THREAD_$(GCC_THREAD_FILE) \
88 $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
89 $(INCLUDES) $(srcdir)/java/jvspec.c
90
91# N.B.: This is a copy of the gcc.o rule, with -DLANG_SPECIFIC_DRIVER added.
92# It'd be nice if we could find an easier way to do this---rather than have
93# to track changes to the toplevel gcc Makefile as well.
94# We depend on $(GCJ).c last, to make it obvious where it came from.
95$(GCJ).o: $(CONFIG_H) multilib.h config.status $(lang_specs_files) $(GCJ).c \
96 system.h
97 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
98 $(DRIVER_DEFINES) \
99 -DLANG_SPECIFIC_DRIVER \
100 -c $(GCJ).c
101
102# Create the compiler driver for $(GCJ).
103$(GCJ)$(exeext): $(GCJ).o jvspec.o version.o choose-temp.o\
104 pexecute.o prefix.o mkstemp.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
105 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCJ).o jvspec.o prefix.o \
106 version.o choose-temp.o pexecute.o mkstemp.o $(EXTRA_GCC_OBJS) $(LIBS)
107
108# Create a version of the $(GCJ) driver which calls the cross-compiler.
109$(GCJ)-cross$(exeext): $(GCJ)$(exeext)
110 -rm -f $(GCJ)-cross$(exeext)
111 cp $(GCJ)$(exeext) $(GCJ)-cross$(exeext)
112
113# Dependencies here must be kept in sync with dependencies in Makefile.in.
114jvgenmain$(exeext): $(srcdir)/java/jvgenmain.c $(srcdir)/java/mangle.c \
115 $(OBSTACK)
116 cd java && $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jvgenmain$(exeext)
117
118# This must be kept in sync with dependencies in Makefile.in.
119GCJH_SOURCES = $(srcdir)/java/gjavah.c $(srcdir)/java/jcf-io.c \
120 $(srcdir)/java/zextract.c $(srcdir)/java/jcf-reader.c \
121 $(srcdir)/java/jcf.h $(srcdir)/java/javaop.h \
8603f9c5
TT
122 $(srcdir)/java/javaop.def $(srcdir)/java/jcf-depend.c \
123 $(srcdir)/java/jcf-path.c
e04a16fb
AG
124
125gcjh$(exeext): $(GCJH_SOURCES)
126 cd java && $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../gcjh$(exeext)
127
257fafbb
TT
128# This must be kept in sync with dependencies in Makefile.in.
129JV_SCAN_SOURCES = $(srcdir)/java/parse-scan.y $(srcdir)/java/lex.c \
130 $(srcdir)/java/parse.h $(srcdir)/java/lex.h $(srcdir)/java/jv-scan.c
131
132jv-scan$(exeext): $(JV_SCAN_SOURCES)
133 cd java && $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jv-scan$(exeext)
134
135# This must be kept in sync with dependencies in Makefile.in.
136JCF_DUMP_SOURCES = $(srcdir)/java/jcf-dump.c $(srcdir)/java/jcf-io.c \
137 $(srcdir)/java/zextract.c $(srcdir)/../libiberty/memmove.c
138
139jcf-dump$(exeext): $(JCF_DUMP_SOURCES)
140 cd java && $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jcf-dump$(exeext)
e04a16fb
AG
141
142\f
143# Build hooks:
144
232e6c7c
TT
145java.all.build: $(GCJ)$(exeext)
146java.all.cross: $(GCJ)-cross$(exeext)
e04a16fb 147java.start.encap: $(GCJ)$(exeext)
232e6c7c 148java.rest.encap:
e04a16fb
AG
149
150java.info:
151
152# Install hooks:
153# jc1, gcj, jvgenmain, and gcjh are installed elsewhere as part
154# of $(COMPILERS).
155
156# Nothing to do here.
157java.install-normal:
158
159java.install-common:
160 -if [ -f $(GCJ)$(exeext) ]; then \
161 if [ -f $(GCJ)-cross$(exeext) ]; then \
162 rm -f $(bindir)/$(JAVA_CROSS_NAME)$(exeext); \
163 $(INSTALL_PROGRAM) $(GCJ)-cross$(exeext) $(bindir)/$(JAVA_CROSS_NAME)$(exeext); \
164 chmod a+x $(bindir)/$(JAVA_CROSS_NAME)$(exeext); \
165 else \
166 rm -f $(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
167 $(INSTALL_PROGRAM) $(GCJ)$(exeext) $(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
168 chmod a+x $(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
169 fi ; \
170 fi ; \
171 for tool in $(JAVA_TARGET_INDEPENDENT_BIN_TOOLS); do \
172 if [ -f $$tool$(exeext) ]; then \
173 rm -f $(bindir)/$$tool$(exeext); \
174 $(INSTALL_PROGRAM) $$tool$(exeext) $(bindir)/$$tool$(exeext); \
175 chmod a+x $(bindir)/$$tool$(exeext); \
176 fi ; \
177 done
178
179java.install-man:
180
181java.uninstall:
182 -rm -rf $(bindir)/$(JAVA_INSTALL_NAME)$(exeext)
183 -rm -rf $(bindir)/$(JAVA_CROSS_NAME)$(exeext)
184
185java.install-info:
186
187\f
188# Clean hooks:
189# A lot of the ancillary files are deleted by the main makefile.
190# We just have to delete files specific to us.
191
192java.mostlyclean:
193 -rm -f java/*$(objext) $(DEMANGLER_PROG)
9d45bec2
PB
194# CYGNUS LOCAL - Delete these files here instead of in realclean because they
195# are now created in the build subdirectories.
196 -rm -f java/parse.c java/parse-scan.c java/parse.output java/y.tab.c
e04a16fb
AG
197java.clean:
198java.distclean:
199 -rm -f java/config.status java/Makefile
200 -rm -f java/parse.output
201java.extraclean:
202java.maintainer-clean:
9d45bec2 203
e04a16fb
AG
204\f
205# Stage hooks:
206# The main makefile has already created stage?/java.
207
208java.stage1:
209 -mv java/*$(objext) stage1/java
210java.stage2:
211 -mv java/*$(objext) stage2/java
212java.stage3:
213 -mv java/*$(objext) stage3/java
214java.stage4:
215 -mv java/*$(objext) stage4/java
216\f
217# Maintenance hooks:
218
219# This target creates the files that can be rebuilt, but go in the
220# distribution anyway. It then copies the files to the distdir directory.
221java.distdir:
222 mkdir tmp/java
223 cd java ; $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) parse.c hash.h
224 cd java; \
225 for file in *[0-9a-zA-Z+]; do \
226 ln $$file ../tmp/java >/dev/null 2>&1 || cp $$file ../tmp/java; \
227 done
This page took 0.093008 seconds and 5 git commands to generate.