f8d9fa9e80
This upgrades all of libgo other than the runtime package to the Go 1.4 release. In Go 1.4 much of the runtime was rewritten into Go. Merging that code will take more time and will not change the API, so I'm putting it off for now. There are a few runtime changes anyhow, to accomodate other packages that rely on minor modifications to the runtime support. The compiler changes slightly to add a one-bit flag to each type descriptor kind that is stored directly in an interface, which for gccgo is currently only pointer types. Another one-bit flag (gcprog) is reserved because it is used by the gc compiler, but gccgo does not currently use it. There is another error check in the compiler since I ran across it during testing. gotools/: * Makefile.am (go_cmd_go_files): Sort entries. Add generate.go. * Makefile.in: Rebuild. From-SVN: r219627
126 lines
3.9 KiB
Makefile
126 lines
3.9 KiB
Makefile
# Makefile for gotools
|
|
# Copyright 2015 Free Software Foundation, Inc.
|
|
#
|
|
# This file 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 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program 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 this program; see the file COPYING3. If not see
|
|
# <http://www.gnu.org/licenses/>.
|
|
|
|
ACLOCAL_AMFLAGS = -I ./config -I ../config
|
|
|
|
gcc_version := $(shell $(GCC_FOR_TARGET) -dumpversion)
|
|
|
|
libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
|
|
|
|
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
|
|
PWD_COMMAND = $${PWDCMD-pwd}
|
|
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 = $(GOCOMPILER) $(GOCFLAGS)
|
|
|
|
AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs -static-libgo
|
|
GOLINK = $(GOCOMPILER) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
|
|
|
|
cmdsrcdir = $(srcdir)/../libgo/go/cmd
|
|
|
|
go_cmd_go_files = \
|
|
$(cmdsrcdir)/go/build.go \
|
|
$(cmdsrcdir)/go/clean.go \
|
|
$(cmdsrcdir)/go/context.go \
|
|
$(cmdsrcdir)/go/discovery.go \
|
|
$(cmdsrcdir)/go/env.go \
|
|
$(cmdsrcdir)/go/fix.go \
|
|
$(cmdsrcdir)/go/fmt.go \
|
|
$(cmdsrcdir)/go/generate.go \
|
|
$(cmdsrcdir)/go/get.go \
|
|
$(cmdsrcdir)/go/go11.go \
|
|
$(cmdsrcdir)/go/help.go \
|
|
$(cmdsrcdir)/go/http.go \
|
|
$(cmdsrcdir)/go/list.go \
|
|
$(cmdsrcdir)/go/main.go \
|
|
$(cmdsrcdir)/go/pkg.go \
|
|
$(cmdsrcdir)/go/run.go \
|
|
$(cmdsrcdir)/go/signal.go \
|
|
$(cmdsrcdir)/go/signal_unix.go \
|
|
$(cmdsrcdir)/go/test.go \
|
|
$(cmdsrcdir)/go/testflag.go \
|
|
$(cmdsrcdir)/go/tool.go \
|
|
$(cmdsrcdir)/go/vcs.go \
|
|
$(cmdsrcdir)/go/version.go \
|
|
$(cmdsrcdir)/go/vet.go
|
|
|
|
go_cmd_gofmt_files = \
|
|
$(cmdsrcdir)/gofmt/doc.go \
|
|
$(cmdsrcdir)/gofmt/gofmt.go \
|
|
$(cmdsrcdir)/gofmt/rewrite.go \
|
|
$(cmdsrcdir)/gofmt/simplify.go
|
|
|
|
go_cmd_cgo_files = \
|
|
$(cmdsrcdir)/cgo/ast.go \
|
|
$(cmdsrcdir)/cgo/doc.go \
|
|
$(cmdsrcdir)/cgo/gcc.go \
|
|
$(cmdsrcdir)/cgo/godefs.go \
|
|
$(cmdsrcdir)/cgo/main.go \
|
|
$(cmdsrcdir)/cgo/out.go \
|
|
$(cmdsrcdir)/cgo/util.go
|
|
|
|
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)')
|
|
|
|
zdefaultcc.go: s-zdefaultcc; @true
|
|
s-zdefaultcc: Makefile
|
|
echo 'package main' > zdefaultcc.go.tmp
|
|
echo 'const defaultGCCGO = "$(bindir)/$(GCCGO_INSTALL_NAME)"' >> zdefaultcc.go.tmp
|
|
echo 'const defaultCC = "$(bindir)/$(GCC_INSTALL_NAME)"' >> zdefaultcc.go.tmp
|
|
echo 'const defaultCXX = "$(bindir)/$(GXX_INSTALL_NAME)"' >> zdefaultcc.go.tmp
|
|
$(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
|
|
# and install them as regular programs.
|
|
|
|
bin_PROGRAMS = go$(EXEEXT) gofmt$(EXEEXT)
|
|
libexecsub_PROGRAMS = cgo$(EXEEXT)
|
|
|
|
go$(EXEEXT): $(go_cmd_go_files) zdefaultcc.go $(LIBGODEP)
|
|
$(GOLINK) $(go_cmd_go_files) zdefaultcc.go
|
|
gofmt$(EXEEXT): $(go_cmd_gofmt_files) $(LIBGODEP)
|
|
$(GOLINK) $(go_cmd_gofmt_files)
|
|
cgo$(EXEEXT): $(go_cmd_cgo_files) zdefaultcc.go $(LIBGODEP)
|
|
$(GOLINK) $(go_cmd_cgo_files) zdefaultcc.go
|
|
|
|
else
|
|
|
|
# For a non-native build we have to build the programs using a
|
|
# previously built host (or build -> host) Go compiler. We should
|
|
# only do this if such a compiler is available. We also need to get
|
|
# the right values for GOARCH and GOOS in the default build context in
|
|
# the go/build package. Figure this out later.
|
|
|
|
endif
|