`cmd` is exactly the words `words` (NULL-terminated), however spaced. */
| 2949 | |
| 2950 | /* `cmd` is exactly the words `words` (NULL-terminated), however spaced. */ |
| 2951 | static bool mk_words(const char *cmd, const char *const *words) { |
| 2952 | const char *p = cmd; |
| 2953 | for (int i = 0; words[i]; i++) { |
| 2954 | while (*p == ' ' || *p == '\t') { |
| 2955 | p++; |
| 2956 | } |
| 2957 | size_t wl = strlen(words[i]); |
| 2958 | if (strncmp(p, words[i], wl) != 0 || (p[wl] && p[wl] != ' ' && p[wl] != '\t')) { |
| 2959 | return false; |
| 2960 | } |
| 2961 | p += wl; |
| 2962 | } |
| 2963 | while (*p == ' ' || *p == '\t') { |
| 2964 | p++; |
| 2965 | } |
| 2966 | return *p == '\0'; |
| 2967 | } |
| 2968 | |
| 2969 | /* $(NAME) / ${NAME} / $(shell pwd) / $(abspath X): its expansion. */ |
| 2970 | static const char *mk_reference(mk_t *m, const char *ref) { |