summaryrefslogtreecommitdiff
path: root/src/cmd/gobuild/gobuild.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/gobuild/gobuild.c')
-rw-r--r--src/cmd/gobuild/gobuild.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cmd/gobuild/gobuild.c b/src/cmd/gobuild/gobuild.c
index 091e2af6f..5368d9f4d 100644
--- a/src/cmd/gobuild/gobuild.c
+++ b/src/cmd/gobuild/gobuild.c
@@ -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);