The makefile make reads in directory `dir` (GNUmakefile, makefile, * Makefile, the first there is), for the one candidate of `dir` that has * one; NULL otherwise. */
| 1891 | * Makefile, the first there is), for the one candidate of `dir` that has |
| 1892 | * one; NULL otherwise. */ |
| 1893 | static const char *sh_make_default(sh_t *s, const char *dir) { |
| 1894 | const char *c[PAIR_LEN] = {NULL, NULL}; |
| 1895 | int n = sh_candidates(s, dir, c); |
| 1896 | const char *hit = NULL; |
| 1897 | int found = 0; |
| 1898 | for (int i = 0; i < n; i++) { |
| 1899 | for (int k = 0; SH_MAKEFILES[k]; k++) { |
| 1900 | const char *p = sh_join(s->a, c[i], SH_MAKEFILES[k]); |
| 1901 | if (p && sh_repo_file_id(s, p) > 0) { |
| 1902 | found++; |
| 1903 | hit = p; |
| 1904 | break; |
| 1905 | } |
| 1906 | } |
| 1907 | } |
| 1908 | return found == SKIP_ONE ? hit : NULL; |
| 1909 | } |
| 1910 | |
| 1911 | /* make [-C DIR] [-f FILE] [VAR=V] TARGET...: each TARGET SPAWNS the rule of |
| 1912 | * that name the makefile reads -- the first -f, else the directory's (-C is |
no test coverage detected