1 # Make-lang.in -- Top level -*- makefile -*- fragment for gcc Go frontend.
3 # Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
5 # This file is part of GCC.
7 # GCC 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 3, or (at your option)
12 # GCC 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.
17 # You should have received a copy of the GNU General Public License
18 # along with GCC; see the file COPYING3. If not see
19 # <http://www.gnu.org/licenses/>.
21 # This file provides the language dependent support in the main Makefile.
25 GCCGO_INSTALL_NAME := $(shell echo gccgo|sed '$(program_transform_name)')
26 GCCGO_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gccgo|sed '$(program_transform_name)')
28 # The name for selecting go in LANGUAGES.
33 gospec.o: $(srcdir)/go/gospec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) \
35 (SHLIB_LINK='$(SHLIB_LINK)'; \
36 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
37 $(INCLUDES) $(srcdir)/go/gospec.c)
39 GCCGO_OBJS = $(GCC_OBJS) gospec.o intl.o prefix.o version.o
40 gccgo$(exeext): $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
41 $(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
42 $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
44 # Use strict warnings.
45 go-warn = $(STRICT_WARN)
67 go1$(exeext): $(GO_OBJS) attribs.o $(BACKEND) $(LIBDEPS)
68 $(CXX) $(ALL_CXXFLAGS) $(LDFLAGS) -o $@ \
69 $(GO_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
75 $(gcc_docdir)/include/fdl.texi \
76 $(gcc_docdir)/include/gpl_v3.texi \
77 $(gcc_docdir)/include/gcc-common.texi \
80 doc/gccgo.info: $(GO_TEXI_FILES)
81 if test "x$(BUILD_INFO)" = xinfo; then \
82 rm -f doc/gccgo.info*; \
83 $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
84 -I $(gcc_docdir)/include -o $@ $<; \
87 doc/gccgo.dvi: $(GO_TEXI_FILES)
88 $(TEXI2DVI) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
90 doc/gccgo.pdf: $(GO_TEXI_FILES)
91 $(TEXI2PDF) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
93 $(build_htmldir)/go/index.html: $(GO_TEXI_FILES)
94 $(mkinstalldirs) $(@D)
96 $(TEXI2HTML) -I $(gcc_docdir) -I $(gcc_docdir)/include \
97 -I $(srcdir)/go -o $(@D) $<
99 .INTERMEDIATE: gccgo.pod
101 gccgo.pod: go/gccgo.texi
102 -$(TEXI2POD) -D gccgo < $< > $@
106 go.all.cross: gccgo$(exeext)
107 go.start.encap: gccgo$(exeext)
109 go.info: doc/gccgo.info
110 go.dvi: doc/gccgo.dvi
111 go.pdf: doc/gccgo.pdf
112 go.html: $(build_htmldir)/go/index.html
113 go.srcinfo: doc/gccgo.info
114 -cp -p $^ $(srcdir)/doc
118 etags -o TAGS.sub *.c *.h gofrontend/*.h gofrontend/*.cc; \
119 etags --include TAGS.sub --include ../TAGS.sub
121 go.srcman: doc/gccgo.1
122 -cp -p $^ $(srcdir)/doc
124 lang_checks += check-go
125 lang_checks_parallelized += check-go
126 check_go_parallelize = go-test.exp=*/test/\[0-57-9a-bd-hj-zA-Z\]* \
127 go-test.exp=*/test/c* \
128 go-test.exp=*/test/i* \
129 go-test.exp=*/test/6*
133 go.install-common: installdirs
134 -rm -f $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
135 -rm -f $(DESTDIR)$(bindir)/$(GCCGO_TARGET_INSTALL_NAME)$(exeext)
136 $(INSTALL_PROGRAM) gccgo$(exeext) $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
137 if test -f $(DESTDIR)$(bindir)$(GCCGO_TARGET_INSTALL_NAME)$(exeext); then \
140 cd $(DESTDIR)$(bindir) && \
141 $(LN) $(GCCGO_INSTALL_NAME)$(exeext) $(GCCGO_TARGET_INSTALL_NAME)$(exeext); \
146 go.install-info: $(DESTDIR)$(infodir)/gccgo.info
148 go.install-pdf: doc/gccgo.pdf
150 test -z "$(pdfdir)" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc"
151 @for p in doc/gccgo.pdf; do \
152 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
153 f=$(pdf__strip_dir) \
154 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \
155 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
158 go.install-html: $(build_htmldir)/go
160 test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
161 @for p in $(build_htmldir)/go; do \
162 if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
163 f=$(html__strip_dir) \
164 if test -d "$$d$$p"; then \
165 echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
166 $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
167 echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
168 $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
170 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
171 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
175 go.install-man: $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
177 $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo.1 installdirs
179 -$(INSTALL_DATA) $< $@
183 rm -rf $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
184 rm -rf $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
185 rm -rf $(DESTDIR)$(bindir)/$(GCCGO_TARGET_INSTALL_NAME)$(exeext)
186 rm -rf $(DESTDIR)$(infodir)/gccgo.info*
192 -rm -f go/*$(coverageexts)
196 -rm -f $(docobjdir)/gccgo.1
200 go.stage1: stage1-start
201 -mv go/*$(objext) stage1/go
202 go.stage2: stage2-start
203 -mv go/*$(objext) stage2/go
204 go.stage3: stage3-start
205 -mv go/*$(objext) stage3/go
206 go.stage4: stage4-start
207 -mv go/*$(objext) stage4/go
208 go.stageprofile: stageprofile-start
209 -mv go/*$(objext) stageprofile/go
210 go.stagefeedback: stagefeedback-start
211 -mv go/*$(objext) stagefeedback/go
213 GO_SYSTEM_H = go/go-system.h $(CONFIG_H) $(SYSTEM_H) coretypes.h \
214 $(DIAGNOSTIC_CORE_H) $(INPUT_H) intl.h
216 GO_C_H = go/go-c.h $(MACHMODE_H)
217 GO_LEX_H = go/gofrontend/lex.h go/gofrontend/operator.h
218 GO_PARSE_H = go/gofrontend/parse.h
219 GO_GOGO_H = go/gofrontend/gogo.h
220 GO_TYPES_H = go/gofrontend/types.h
221 GO_STATEMENTS_H = go/gofrontend/statements.h go/gofrontend/operator.h
222 GO_EXPRESSIONS_H = go/gofrontend/expressions.h go/gofrontend/operator.h
223 GO_IMPORT_H = go/gofrontend/import.h go/gofrontend/export.h
224 GO_RUNTIME_H = go/gofrontend/runtime.h go/gofrontend/runtime.def
226 go/go-backend.o: go/go-backend.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
227 $(TM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(TARGET_H)
229 go/go-lang.o: go/go-lang.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(OPTS_H) \
230 $(TREE_H) $(GIMPLE_H) $(GGC_H) $(TOPLEV_H) debug.h options.h \
231 $(FLAGS_H) convert.h $(DIAGNOSTIC_H) langhooks.h \
232 $(LANGHOOKS_DEF_H) $(EXCEPT_H) $(TARGET_H) $(GO_C_H) \
233 gt-go-go-lang.h gtype-go.h
234 $(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
235 -DDEFAULT_TARGET_VERSION=\"$(version)\" \
236 -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
237 -c $< $(OUTPUT_OPTION)
239 GOINCLUDES = -I $(srcdir)/go -I $(srcdir)/go/gofrontend
241 go/go-gcc.o: go/go-gcc.cc $(GO_SYSTEM_H) $(TREE_H) tree-iterator.h \
242 $(GIMPLE_H) $(GO_C_H) $(GO_GOGO_H) go/gofrontend/backend.h
243 $(CXX) -c $(GOINCLUDES) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) $< $(OUTPUT_OPTION)
245 go/%.o: go/gofrontend/%.cc
246 $(CXX) -c $(GOINCLUDES) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) $< $(OUTPUT_OPTION)
248 go/dataflow.o: go/gofrontend/dataflow.cc $(GO_SYSTEM_H) $(GO_GOGO_H) \
249 $(GO_EXPRESSIONS_H) $(GO_STATEMENTS_H) go/gofrontend/dataflow.h
250 go/export.o: go/gofrontend/export.cc $(GO_SYSTEM_H) \
251 $(srcdir)/../include/sha1.h $(MACHMODE_H) output.h $(TARGET_H) \
252 $(GO_GOGO_H) $(GO_TYPES_H) $(GO_STATEMENTS_H) go/gofrontend/export.h
253 go/expressions.o: go/gofrontend/expressions.cc $(GO_SYSTEM_H) $(TOPLEV_H) \
254 intl.h $(TREE_H) $(GIMPLE_H) tree-iterator.h convert.h $(REAL_H) \
255 realmpfr.h $(GO_C_H) $(GO_GOGO_H) $(GO_TYPES_H) \
256 go/gofrontend/export.h $(GO_IMPORT_H) $(GO_STATEMENTS_H) $(GO_LEX_H) \
257 go/gofrontend/backend.h $(GO_EXPRESSIONS_H)
258 go/go.o: go/gofrontend/go.cc $(GO_SYSTEM_H) $(GO_C_H) $(GO_LEX_H) \
259 $(GO_PARSE_H) go/gofrontend/backend.h $(GO_GOGO_H)
260 go/go-dump.o: go/gofrontend/go-dump.cc $(GO_SYSTEM_H) $(GO_C_H) \
261 go/gofrontend/go-dump.h
262 go/gogo-tree.o: go/gofrontend/gogo-tree.cc $(GO_SYSTEM_H) $(TOPLEV_H) \
263 $(TREE_H) $(GIMPLE_H) tree-iterator.h $(CGRAPH_H) langhooks.h \
264 convert.h output.h $(DIAGNOSTIC_H) $(GO_TYPES_H) \
265 $(GO_EXPRESSIONS_H) $(GO_STATEMENTS_H) $(GO_RUNTIME_H) \
266 go/gofrontend/backend.h $(GO_GOGO_H)
267 go/gogo.o: go/gofrontend/gogo.cc $(GO_SYSTEM_H) $(GO_C_H) \
268 go/gofrontend/go-dump.h $(GO_LEX_H) $(GO_TYPES_H) $(GO_STATEMENTS_H) \
269 $(GO_EXPRESSIONS_H) go/gofrontend/dataflow.h $(GO_RUNTIME_H) \
270 $(GO_IMPORT_H) go/gofrontend/export.h go/gofrontend/backend.h \
272 go/import.o: go/gofrontend/import.cc $(GO_SYSTEM_H) \
273 $(srcdir)/../include/filenames.h $(srcdir)/../include/simple-object.h \
274 $(GO_C_H) $(GO_GOGO_H) $(GO_TYPES_H) go/gofrontend/export.h \
276 go/import-archive.o: go/gofrontend/import-archive.cc $(GO_SYSTEM_H) \
278 go/lex.o: go/gofrontend/lex.cc $(GO_LEX_H) $(GO_SYSTEM_H)
279 go/parse.o: go/gofrontend/parse.cc $(GO_SYSTEM_H) $(GO_LEX_H) $(GO_GOGO_H) \
280 $(GO_TYPES_H) $(GO_STATEMENTS_H) $(GO_EXPRESSIONS_H) $(GO_PARSE_H)
281 go/runtime.o: go/gofrontend/runtime.cc $(GO_SYSTEM_H) $(GO_GOGO_H) \
282 $(GO_TYPES_H) $(GO_EXPRESSIONS_H) $(GO_RUNTIME_H) \
283 go/gofrontend/runtime.def
284 go/statements.o: go/gofrontend/statements.cc $(GO_SYSTEM_H) \
285 $(GO_C_H) $(GO_TYPES_H) $(GO_EXPRESSIONS_H) $(GO_GOGO_H) \
286 $(GO_RUNTIME_H) go/gofrontend/backend.h $(GO_STATEMENTS_H)
287 go/types.o: go/gofrontend/types.cc $(GO_SYSTEM_H) $(TOPLEV_H) intl.h $(TREE_H) \
288 $(GIMPLE_H) $(REAL_H) convert.h $(GO_C_H) $(GO_GOGO_H) \
289 go/gofrontend/operator.h $(GO_EXPRESSIONS_H) $(GO_STATEMENTS_H) \
290 go/gofrontend/export.h $(GO_IMPORT_H) $(GO_TYPES_H)
291 go/unsafe.o: go/gofrontend/unsafe.cc $(GO_SYSTEM_H) $(GO_C_H) $(GO_TYPES_H) \