PR rtl-optimization/60601
[official-gcc.git] / gcc / go / Make-lang.in
blobabcae66a21f554069796a24a2b3b26b77b4c7860
1 # Make-lang.in -- Top level -*- makefile -*- fragment for gcc Go frontend.
3 # Copyright (C) 2009-2014 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)
10 # any later version.
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.
23 # Installation name.
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.
29 go: go1$(exeext)
31 .PHONY: go
33 CFLAGS-go/gospec.o += $(DRIVER_DEFINES)
35 GCCGO_OBJS = $(GCC_OBJS) go/gospec.o
36 gccgo$(exeext): $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
37         +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
38           $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
39           $(EXTRA_GCC_LIBS) $(LIBS)
41 # The cross-compiler version.  This is built mainly as a signal to the
42 # go.install-common target.  If this executable exists, it means that
43 # go.all.cross was run.
44 gccgo-cross$(exeext): gccgo$(exeext)
45         -rm -f gccgo-cross$(exeext)
46         cp gccgo$(exeext) gccgo-cross$(exeext)
48 # Use strict warnings.
49 go-warn = $(STRICT_WARN)
51 GO_OBJS = \
52         go/ast-dump.o \
53         go/dataflow.o \
54         go/export.o \
55         go/expressions.o \
56         go/go-backend.o \
57         go/go-dump.o \
58         go/go-gcc.o \
59         go/go-lang.o \
60         go/go-linemap.o \
61         go/go-optimize.o \
62         go/go.o \
63         go/gogo-tree.o \
64         go/gogo.o \
65         go/import.o \
66         go/import-archive.o \
67         go/lex.o \
68         go/parse.o \
69         go/runtime.o \
70         go/statements.o \
71         go/types.o \
72         go/unsafe.o
74 go_OBJS = $(GO_OBJS) go/gospec.o
76 go1$(exeext): $(GO_OBJS) attribs.o $(BACKEND) $(LIBDEPS)
77         +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
78               $(GO_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
80 # Documentation.
82 GO_TEXI_FILES = \
83         go/gccgo.texi \
84         $(gcc_docdir)/include/fdl.texi \
85         $(gcc_docdir)/include/gpl_v3.texi \
86         $(gcc_docdir)/include/gcc-common.texi \
87         gcc-vers.texi
89 doc/gccgo.info: $(GO_TEXI_FILES)
90         if test "x$(BUILD_INFO)" = xinfo; then \
91           rm -f doc/gccgo.info*; \
92           $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
93                 -I $(gcc_docdir)/include -o $@ $<; \
94         else true; fi
96 doc/gccgo.dvi: $(GO_TEXI_FILES)
97         $(TEXI2DVI) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
99 doc/gccgo.pdf: $(GO_TEXI_FILES)
100         $(TEXI2PDF) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
102 $(build_htmldir)/go/index.html: $(GO_TEXI_FILES)
103         $(mkinstalldirs) $(@D)
104         rm -f $(@D)/*
105         $(TEXI2HTML) -I $(gcc_docdir) -I $(gcc_docdir)/include \
106                 -I $(srcdir)/go -o $(@D) $<
108 .INTERMEDIATE: gccgo.pod
110 gccgo.pod: go/gccgo.texi
111         -$(TEXI2POD) -D gccgo < $< > $@
113 # Build hooks.
115 go.all.cross: gccgo-cross$(exeext)
116 go.start.encap: gccgo$(exeext)
117 go.rest.encap:
118 go.info: doc/gccgo.info
119 go.dvi: doc/gccgo.dvi
120 go.pdf: doc/gccgo.pdf
121 go.html: $(build_htmldir)/go/index.html
122 go.srcinfo: doc/gccgo.info
123         -cp -p $^ $(srcdir)/doc
124 go.srcextra:
125 go.tags: force
126         cd $(srcdir)/go; \
127         etags -o TAGS.sub *.c *.h gofrontend/*.h gofrontend/*.cc; \
128         etags --include TAGS.sub --include ../TAGS.sub
129 go.man: doc/gccgo.1
130 go.srcman: doc/gccgo.1
131         -cp -p $^ $(srcdir)/doc
133 lang_checks += check-go
134 lang_checks_parallelized += check-go
135 check_go_parallelize = go-test.exp=*/test/\[0-57-9a-bd-hj-qs-zA-Z\]* \
136                        go-test.exp=*/test/c* \
137                        go-test.exp=*/test/i* \
138                        go-test.exp=*/test/r* \
139                        go-test.exp=*/test/6*
141 # Install hooks.
143 go.install-common: installdirs
144         -rm -f $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
145         $(INSTALL_PROGRAM) gccgo$(exeext) $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
146         -if test -f go1$(exeext); then \
147           if test -f gccgo-cross$(exeext); then \
148             :; \
149           else \
150             rm -f $(DESTDIR)$(bindir)/$(GCCGO_TARGET_INSTALL_NAME)$(exeext); \
151             ( cd $(DESTDIR)$(bindir) && \
152               $(LN) $(GCCGO_INSTALL_NAME)$(exeext) $(GCCGO_TARGET_INSTALL_NAME)$(exeext) ); \
153           fi; \
154         fi
156 go.install-plugin:
158 go.install-info: $(DESTDIR)$(infodir)/gccgo.info
160 go.install-pdf: doc/gccgo.pdf
161         @$(NORMAL_INSTALL)
162         test -z "$(pdfdir)" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc"
163         @for p in doc/gccgo.pdf; do \
164           if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
165           f=$(pdf__strip_dir) \
166           echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \
167           $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
168         done
170 go.install-html: $(build_htmldir)/go
171         @$(NORMAL_INSTALL)
172         test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
173         @for p in $(build_htmldir)/go; do \
174           if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
175           f=$(html__strip_dir) \
176           if test -d "$$d$$p"; then \
177             echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
178             $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
179             echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
180             $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
181           else \
182             echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
183             $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
184           fi; \
185         done
187 go.install-man: $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
189 $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo.1 installdirs
190         -rm -f $@
191         -$(INSTALL_DATA) $< $@
192         -chmod a-x $@
194 go.uninstall:
195         rm -rf $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
196         rm -rf $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
197         rm -rf $(DESTDIR)$(bindir)/$(GCCGO_TARGET_INSTALL_NAME)$(exeext)
198         rm -rf $(DESTDIR)$(infodir)/gccgo.info*
200 # Clean hooks.
202 go.mostlyclean:
203         -rm -f go/*$(objext)
204         -rm -f go/*$(coverageexts)
205 go.clean:
206 go.distclean:
207 go.maintainer-clean:
208         -rm -f $(docobjdir)/gccgo.1
210 # Stage hooks.
212 go.stage1: stage1-start
213         -mv go/*$(objext) stage1/go
214 go.stage2: stage2-start
215         -mv go/*$(objext) stage2/go
216 go.stage3: stage3-start
217         -mv go/*$(objext) stage3/go
218 go.stage4: stage4-start
219         -mv go/*$(objext) stage4/go
220 go.stageprofile: stageprofile-start
221         -mv go/*$(objext) stageprofile/go
222 go.stagefeedback: stagefeedback-start
223         -mv go/*$(objext) stagefeedback/go
225 CFLAGS-go/go-lang.o += -DDEFAULT_TARGET_VERSION=\"$(version)\" \
226         -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\"
228 GOINCLUDES = -I $(srcdir)/go -I $(srcdir)/go/gofrontend
230 CFLAGS-go/go-gcc.o += $(GOINCLUDES)
231 CFLAGS-go/go-linemap.o += $(GOINCLUDES)
233 go/%.o: go/gofrontend/%.cc
234         $(COMPILE) $(GOINCLUDES) $<
235         $(POSTCOMPILE)