Proper recursive dependencies (came from libantithread work)
[ccan] / tools / ccan_depends.c
1 #include "tools.h"
2 #include <err.h>
3 #include <stdlib.h>
4 #include <stdio.h>
5 #include "string/string.h"
6
7 int main(int argc, char *argv[])
8 {
9         char **deps;
10         unsigned int i;
11
12         if (argc != 2)
13                 errx(1, "Usage: ccan_depends <dir>\n"
14                         "Spits out all the ccan dependencies (recursively)");
15
16         deps = get_deps(NULL, argv[1]);
17         for (i = 0; deps[i]; i++)
18                 if (strstarts(deps[i], "ccan/"))
19                         printf("%s\n", deps[i]);
20         return 0;
21 }