aboutsummaryrefslogtreecommitdiff
path: root/include/linux/gcd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/gcd.h')
0 files changed, 0 insertions, 0 deletions
eturn; /* Print out a dependency path from a symbol name. */ printf(" $(wildcard include/config/%.*s) \\\n", slen, m); } /* test if s ends in sub */ static int str_ends_with(const char *s, int slen, const char *sub) { int sublen = strlen(sub); if (sublen > slen) return 0; return !memcmp(s + slen - sublen, sub, sublen); } static void parse_config_file(const char *p) { const char *q, *r; const char *start = p; while ((p = strstr(p, "CONFIG_"))) { if (p > start && (isalnum(p[-1]) || p[-1] == '_')) { p += 7; continue; } p += 7; q = p; while (isalnum(*q) || *q == '_') q++; if (str_ends_with(p, q - p, "_MODULE")) r = q - 7; else r = q; if (r > p) use_config(p, r - p); p = q; } } static void *read_file(const char *filename) { struct stat st; int fd; char *buf; fd = open(filename, O_RDONLY); if (fd < 0) { fprintf(stderr, "fixdep: error opening file: "); perror(filename); exit(2); } if (fstat(fd, &st) < 0) { fprintf(stderr, "fixdep: error fstat'ing file: "); perror(filename); exit(2); } buf = malloc(st.st_size + 1); if (!buf) { perror("fixdep: malloc"); exit(2); } if (read(fd, buf, st.st_size) != st.st_size) { perror("fixdep: read"); exit(2); } buf[st.st_size] = '\0'; close(fd); return buf; } /* Ignore certain dependencies */ static int is_ignored_file(const char *s, int len) { return str_ends_with(s, len, "include/generated/autoconf.h"); } /* Do not parse these files */ static int is_no_parse_file(const char *s, int len) { /* rustc may list binary files in dep-info */ return str_ends_with(s, len, ".rlib") || str_ends_with(s, len, ".rmeta") || str_ends_with(s, len, ".so"); } /* * Important: The below generated source_foo.o and deps_foo.o variable * assignments are parsed not only by make, but also by the rather simple * parser in scripts/mod/sumversion.c. */ static void parse_dep_file(char *p, const char *target) { bool saw_any_target = false; bool is_target = true; bool is_source = false; bool need_parse; char *q, saved_c; while (*p) { /* handle some special characters first. */ switch (*p) { case '#': /* * skip comments. * rustc may emit comments to dep-info. */ p++; while (*p != '\0' && *p != '\n') { /* * escaped newlines continue the comment across * multiple lines. */ if (*p == '\\') p++; p++; } continue; case ' ': case '\t': /* skip