summaryrefslogtreecommitdiff
path: root/gotools
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-10 00:23:48 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-10 00:23:48 +0000
commitff5b9b4f5b28a73f99a25c9fa4f89fb0b0831e0e (patch)
tree64bdda18667613c3fe28c23182d7b95993aca9a0 /gotools
parenta1f711beb6ac5fd2e2cb2dd831dfe75c83f5bdbf (diff)
downloadgcc-ff5b9b4f5b28a73f99a25c9fa4f89fb0b0831e0e.tar.gz
* Makefile.am (GOCOMPILER): Set to GOC or GOC_FOR_TARGET depending
on whether this is a native build or not. (GOCOMPILE, GOLINK): Use $(GOCOMPILER) instead of $(GOC). (MOSTLYCLEANFILES): Define. * Makefile.in: Rebuild. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219418 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gotools')
-rw-r--r--gotools/ChangeLog6
-rw-r--r--gotools/Makefile.am13
-rw-r--r--gotools/Makefile.in17
3 files changed, 29 insertions, 7 deletions
diff --git a/gotools/ChangeLog b/gotools/ChangeLog
index 12bfb591087..0e24b33d75a 100644
--- a/gotools/ChangeLog
+++ b/gotools/ChangeLog
@@ -1,3 +1,9 @@
2015-01-09 Ian Lance Taylor <iant@google.com>
+ * Makefile.am (GOCOMPILER): Set to GOC or GOC_FOR_TARGET depending
+ on whether this is a native build or not.
+ (GOCOMPILE, GOLINK): Use $(GOCOMPILER) instead of $(GOC).
+ (MOSTLYCLEANFILES): Define.
+ * Makefile.in: Rebuild.
+
* Initial implementation.
diff --git a/gotools/Makefile.am b/gotools/Makefile.am
index 248bed4b82c..8a564ff3fa3 100644
--- a/gotools/Makefile.am
+++ b/gotools/Makefile.am
@@ -28,11 +28,18 @@ STAMP = echo timestamp >
libgodir = ../$(target_noncanonical)/libgo
LIBGODEP = $(libgodir)/libgo.la
+if NATIVE
+# Use the compiler we just built.
+GOCOMPILER = $(GOC_FOR_TARGET)
+else
+GOCOMPILER = $(GOC)
+endif
+
GOCFLAGS = $(CFLAGS_FOR_TARGET)
-GOCOMPILE = $(GOC) $(GOCFLAGS)
+GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS)
AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs -static-libgo
-GOLINK = $(GOC) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
+GOLINK = $(GOCOMPILER) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
cmdsrcdir = $(srcdir)/../libgo/go/cmd
@@ -89,6 +96,8 @@ s-zdefaultcc: Makefile
$(SHELL) $(srcdir)/../move-if-change zdefaultcc.go.tmp zdefaultcc.go
$(STAMP) $@
+MOSTLYCLEANFILES = zdefaultcc.go s-zdefaultcc
+
if NATIVE
# For a native build we build the programs using the newly built libgo
diff --git a/gotools/Makefile.in b/gotools/Makefile.in
index bbe5b834f42..b108d9d916c 100644
--- a/gotools/Makefile.in
+++ b/gotools/Makefile.in
@@ -53,9 +53,10 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = .
-DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/../mkinstalldirs $(srcdir)/../depcomp
+DIST_COMMON = README ChangeLog $(srcdir)/Makefile.in \
+ $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(srcdir)/../mkinstalldirs \
+ $(srcdir)/../depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/depstand.m4 \
@@ -199,9 +200,13 @@ PWD_COMMAND = $${PWDCMD-pwd}
STAMP = echo timestamp >
libgodir = ../$(target_noncanonical)/libgo
LIBGODEP = $(libgodir)/libgo.la
-GOCOMPILE = $(GOC) $(GOCFLAGS)
+@NATIVE_FALSE@GOCOMPILER = $(GOC)
+
+# Use the compiler we just built.
+@NATIVE_TRUE@GOCOMPILER = $(GOC_FOR_TARGET)
+GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS)
AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs -static-libgo
-GOLINK = $(GOC) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
+GOLINK = $(GOCOMPILER) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
cmdsrcdir = $(srcdir)/../libgo/go/cmd
go_cmd_go_files = \
$(cmdsrcdir)/go/build.go \
@@ -246,6 +251,7 @@ go_cmd_cgo_files = \
GCCGO_INSTALL_NAME := $(shell echo gccgo|sed '$(program_transform_name)')
GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
GXX_INSTALL_NAME := $(shell echo g++|sed '$(program_transform_name)')
+MOSTLYCLEANFILES = zdefaultcc.go s-zdefaultcc
# For a native build we build the programs using the newly built libgo
# and install them as regular programs.
@@ -470,6 +476,7 @@ install-strip:
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic: