]> Cypherpunks repositories - gostls13.git/commitdiff
build: fiddle with make variables
authorRuss Cox <rsc@golang.org>
Mon, 1 Nov 2010 20:14:58 +0000 (16:14 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 1 Nov 2010 20:14:58 +0000 (16:14 -0400)
Fixes #1234.

R=r, r2
CC=golang-dev
https://golang.org/cl/2735043

src/Make.ccmd
src/Make.inc

index a0da13857e45a51f9598f296ba8df02260e63d25..fe53f5d054b4671c153f2b835e448f65024672bc 100644 (file)
@@ -9,7 +9,7 @@ TARG:=$(TARG).exe
 endif
 
 $(TARG): $(OFILES) $(LIB)
-       $(HOST_LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) $(LIB) -lbio -l9 -lm
+       $(HOST_LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) $(LIB) -lbio -l9 -lm $(HOST_LDFLAGS)
 
 $(OFILES): $(HFILES)
 
index b1d8247d7eb2abee452f626f3434b574e3106b0e..8096253d0243717096dbbb31fdf27d488eb3a21c 100644 (file)
@@ -101,7 +101,17 @@ HOST_CC=quietgcc
 HOST_LD=quietgcc
 HOST_O=o
 HOST_YFLAGS=-d
-HOST_CFLAGS=-ggdb -I"$(GOROOT)/include" -O2
+
+# These two variables can be overridden in the environment
+# to build with other flags.  They are like $CFLAGS and $LDFLAGS
+# in a more typical GNU build.  We are more explicit about the names
+# here because there are different compilers being run during the
+# build (both gcc and 6c, for example).
+HOST_EXTRA_CFLAGS?=-ggdb -O2
+HOST_EXTRA_LDFLAGS?=
+
+HOST_CFLAGS=-I"$(GOROOT)/include" $(HOST_EXTRA_CFLAGS)
+HOST_LDFLAGS=$(HOST_EXTRA_LDFLAGS)
 PWD=$(shell pwd)
 
 # Make environment more standard.