version 1.118, 2015/12/29 19:04:46 |
version 1.119, 2016/01/04 10:59:23 |
|
|
switch (c) { |
switch (c) { |
case 'C': |
case 'C': |
if (chdir(optarg) == -1) |
if (chdir(optarg) == -1) |
err(1, "chdir(%s)", optarg); |
err(2, "chdir(%s)", optarg); |
break; |
break; |
case -1: |
case -1: |
optind++; /* skip over non-option */ |
optind++; /* skip over non-option */ |
|
|
if (r == NULL) { |
if (r == NULL) { |
static struct utsname utsname; |
static struct utsname utsname; |
|
|
if (uname(&utsname) == -1) { |
if (uname(&utsname) == -1) |
perror("make: uname"); |
err(2, "uname"); |
exit(2); |
|
} |
|
r = utsname.machine; |
r = utsname.machine; |
} |
} |
return r; |
return r; |
|
|
|
|
/* curdir is cwd... */ |
/* curdir is cwd... */ |
cwd = dogetcwd(); |
cwd = dogetcwd(); |
if (cwd == NULL) { |
if (cwd == NULL) |
(void)fprintf(stderr, "make: %s.\n", strerror(errno)); |
err(2, "%s", strerror(errno)); |
exit(2); |
|
} |
|
|
|
if (stat(cwd, &sa) == -1) { |
if (stat(cwd, &sa) == -1) |
(void)fprintf(stderr, "make: %s: %s.\n", cwd, strerror(errno)); |
err(2, "%s: %s", cwd, strerror(errno)); |
exit(2); |
|
} |
|
|
|
/* ...but we can use the alias $PWD if we can prove it is the same |
/* ...but we can use the alias $PWD if we can prove it is the same |
* directory */ |
* directory */ |