]> Cypherpunks repositories - gostls13.git/commitdiff
insert ${GOOS} and ${GOARCH} in
authorRuss Cox <rsc@golang.org>
Mon, 16 Feb 2009 03:20:35 +0000 (19:20 -0800)
committerRuss Cox <rsc@golang.org>
Mon, 16 Feb 2009 03:20:35 +0000 (19:20 -0800)
command-line comment.

R=r
DELTA=11  (6 added, 0 deleted, 5 changed)
OCL=25051
CL=25051

src/cmd/gobuild/gobuild.c
src/lib/net/Makefile

index 091e2af6fcb26648c62883a1a41872e2c858cf63..5368d9f4d5792410f61103b292729325f76ff936 100644 (file)
@@ -263,12 +263,18 @@ dollarfmt(Fmt *f)
        for(; *s; s+=n){
                n = strlen(goarch);
                if(strncmp(s, goarch, n) == 0){
-                       fmtstrcpy(f, "$(GOARCH)");
+                       if(f->flags & FmtSharp)
+                               fmtstrcpy(f, "${GOARCH}");  // shell
+                       else
+                               fmtstrcpy(f, "$(GOARCH)");  // make
                        continue;
                }
                n = strlen(goos);
                if(strncmp(s, goos, n) == 0){
-                       fmtstrcpy(f, "$(GOOS)");
+                       if(f->flags & FmtSharp)
+                               fmtstrcpy(f, "${GOOS}");  // shell
+                       else
+                               fmtstrcpy(f, "$(GOOS)");  // make
                        continue;
                }
                n = chartorune(&r, s);
@@ -327,7 +333,7 @@ writemakefile(void)
                        Bprint(&bout, "\\\n#   ");
                        o = Boffset(&bout);
                }
-               Bprint(&bout, " %s", oargv[i]);
+               Bprint(&bout, " %#$", oargv[i]);
        }
        Bprint(&bout, " >Makefile\n");
        Bprint(&bout, preamble, thechar);
index ff5176a1f9c07a48db361d0aff8c46847af47d52..8a4953c2f276cf464ce11e329c7f9059cd8869cc 100644 (file)
@@ -3,8 +3,8 @@
 # license that can be found in the LICENSE file.
 
 # DO NOT EDIT.  Automatically generated by gobuild.
-# gobuild -m dnsclient.go dnsconfig.go dnsmsg.go fd.go fd_darwin.go\
-#    ip.go net.go net_darwin.go parse.go port.go >Makefile
+# gobuild -m dnsclient.go dnsconfig.go dnsmsg.go fd.go fd_${GOOS}.go\
+#    ip.go net.go net_${GOOS}.go parse.go port.go >Makefile
 O=6
 GC=$(O)g
 CC=$(O)c -w