Make include/config/foo/bar.h fake deps files generation simpler. * delete .h suffix those aren't header files, shorten filenames, * delete tolower() Linux filesystems can deal with both upper and lowercase filenames very well, * put everything in 1 directory Presumably 'mkdir -p' split is from dark times when filesystems handled huge directories badly, disks were round adding to seek times. x86_64 allmodconfig lists 12364 files in include/config. ../obj/include/config/ ├── 104_QUAD_8 ├── 60XX_WDT ├── 64BIT ... ├── ZSWAP_DEFAULT_ON ├── ZSWAP_ZPOOL_DEFAULT └── ZSWAP_ZPOOL_DEFAULT_ZBUD 0 directories, 12364 files
Showing the changes to scripts/basic (1 of 6 files). Show all
Unified · Split
| @@ -34,7 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | * the config symbols are rebuilt. |
| 35 | 35 | * |
| 36 | 36 | * So if the user changes his CONFIG_HIS_DRIVER option, only the objects |
| 37 | − * which depend on "include/config/his/driver.h" will be rebuilt, | |
| 37 | + * which depend on "include/config/HIS_DRIVER" will be rebuilt, | |
| 38 | 38 | * so most likely only his driver ;-) |
| 39 | 39 | * |
| 40 | 40 | * The idea above dates, by the way, back to Michael E Chastain, AFAIK. |
| @@ -74,7 +74,7 @@ · 33 unmodified lines | ||
| 74 | 74 | * |
| 75 | 75 | * and then basically copies the .<target>.d file to stdout, in the |
| 76 | 76 | * process filtering out the dependency on autoconf.h and adding |
| 77 | − * dependencies on include/config/my/option.h for every | |
| 77 | + * dependencies on include/config/MY_OPTION for every | |
| 78 | 78 | * CONFIG_MY_OPTION encountered in any of the prerequisites. |
| 79 | 79 | * |
| 80 | 80 | * We don't even try to really parse the header files, but |
| @@ -107,8 +107,8 @@ static void usage(void) · 26 unmodified lines | ||
| 107 | 107 | |
| 108 | 108 | /* |
| 109 | 109 | * In the intended usage of this program, the stdout is redirected to .*.cmd |
| 110 | − * files. The return value of printf() and putchar() must be checked to catch | |
| 111 | − * any error, e.g. "No space left on device". | |
| 110 | + * files. The return value of printf() must be checked to catch any error, | |
| 111 | + * e.g. "No space left on device". | |
| 112 | 112 | */ |
| 113 | 113 | static void xprintf(const char *format, ...) |
| 114 | 114 | { |
| @@ -124,38 +124,6 @@ static void xprintf(const char *format, ...) · 9 unmodified lines | ||
| 124 | 124 | va_end(ap); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | −static void xputchar(int c) | |
| 128 | −{ | |
| 129 | − int ret; | |
| 130 | − | |
| 131 | − ret = putchar(c); | |
| 132 | − if (ret == EOF) { | |
| 133 | − perror("fixdep"); | |
| 134 | − exit(1); | |
| 135 | − } | |
| 136 | −} | |
| 137 | − | |
| 138 | −/* | |
| 139 | − * Print out a dependency path from a symbol name | |
| 140 | − */ | |
| 141 | −static void print_dep(const char *m, int slen, const char *dir) | |
| 142 | −{ | |
| 143 | − int c, prev_c = '/', i; | |
| 144 | − | |
| 145 | − xprintf(" $(wildcard %s/", dir); | |
| 146 | − for (i = 0; i < slen; i++) { | |
| 147 | − c = m[i]; | |
| 148 | − if (c == '_') | |
| 149 | − c = '/'; | |
| 150 | − else | |
| 151 | − c = tolower(c); | |
| 152 | − if (c != '/' || prev_c != '/') | |
| 153 | − xputchar(c); | |
| 154 | − prev_c = c; | |
| 155 | − } | |
| 156 | − xprintf(".h) \\\n"); | |
| 157 | −} | |
| 158 | − | |
| 159 | 127 | struct item { |
| 160 | 128 | struct item *next; |
| 161 | 129 | unsigned int len; |
| @@ -220,7 +188,8 @@ static void use_config(const char *m, int slen) · 58 unmodified lines | ||
| 220 | 188 | return; |
| 221 | 189 | |
| 222 | 190 | define_config(m, slen, hash); |
| 223 | − print_dep(m, slen, "include/config"); | |
| 191 | + /* Print out a dependency path from a symbol name. */ | |
| 192 | + xprintf(" $(wildcard include/config/%.*s) \\\n", slen, m); | |
| 224 | 193 | } |
| 225 | 194 | |
| 226 | 195 | /* test if s ends in sub */ |