Allow versions on dependencies.
Display external dependencies on info pages.
# Especially tools/ccanlint/ccanlint and tools/namespacize.
# distclean: destroy everything back to pristine state
# Especially tools/ccanlint/ccanlint and tools/namespacize.
# distclean: destroy everything back to pristine state
-ALL=$(patsubst ccan/%/test, %, $(wildcard ccan/*/test))
-ALL_DIRS=$(patsubst %, ccan/%, $(ALL))
+# Anything with an _info.c file is a module.
+ALL=$(patsubst ccan/%/_info.c, %, $(wildcard ccan/*/_info.c))
ALL_DEPENDS=$(patsubst %, ccan/%/.depends, $(ALL))
ALL_DEPENDS=$(patsubst %, ccan/%/.depends, $(ALL))
+# Not all modules have tests.
+ALL_TESTS=$(patsubst ccan/%/test/, %, $(wildcard ccan/*/test/))
default: libccan.a
include Makefile-ccan
default: libccan.a
include Makefile-ccan
-check: $(ALL_DIRS:ccan/%=check-%)
+check: $(ALL_TESTS:%=check-%)
distclean: clean
rm -f $(ALL_DEPENDS)
distclean: clean
rm -f $(ALL_DEPENDS)
# This can be overridden on cmdline to generate pages elsewhere.
WEBDIR=~/www/html/ccan/
# This can be overridden on cmdline to generate pages elsewhere.
WEBDIR=~/www/html/ccan/
-ALL_PAGES=$(patsubst ccan/%, $(WEBDIR)/info/%.html, $(ALL_DIRS))
-DIRECT_TARBALLS=$(patsubst ccan/%, $(WEBDIR)/tarballs/%.tar.bz2, $(ALL_DIRS))
-DEPEND_TARBALLS=$(patsubst ccan/%, $(WEBDIR)/tarballs/with-deps/%.tar.bz2, $(ALL_DIRS))
+ALL_PAGES=$(patsubst %, $(WEBDIR)/info/%.html, $(ALL))
+DIRECT_TARBALLS=$(patsubst %, $(WEBDIR)/tarballs/%.tar.bz2, $(ALL))
+DEPEND_TARBALLS=$(patsubst %, $(WEBDIR)/tarballs/with-deps/%.tar.bz2, $(ALL))
WEB_SUBDIRS=$(WEBDIR)/tarballs $(WEBDIR)/junkcode $(WEBDIR)/tarballs/with-deps $(WEBDIR)/info
JUNKDIRS=$(wildcard junkcode/*)
JUNKPAGES=$(JUNKDIRS:%=$(WEBDIR)/%.html)
WEB_SUBDIRS=$(WEBDIR)/tarballs $(WEBDIR)/junkcode $(WEBDIR)/tarballs/with-deps $(WEBDIR)/info
JUNKDIRS=$(wildcard junkcode/*)
JUNKPAGES=$(JUNKDIRS:%=$(WEBDIR)/%.html)
$(WEBDIR)/info/%.html: $(WEBDIR)/tarballs/%.tar.bz2 $(WEBDIR)/tarballs/with-deps/%.tar.bz2
@URLPREFIX=../ php5 web/staticmoduleinfo.php ccan/$* > $@
$(WEBDIR)/info/%.html: $(WEBDIR)/tarballs/%.tar.bz2 $(WEBDIR)/tarballs/with-deps/%.tar.bz2
@URLPREFIX=../ php5 web/staticmoduleinfo.php ccan/$* > $@
-$(WEBDIR)/tarballs/%.tar.bz2: ccan/%/test
+$(WEBDIR)/tarballs/%.tar.bz2: ccan/%/_info.c
tar -c -j -f $@ `bzr ls --versioned --kind=file ccan/$*`
tar -c -j -f $@ `bzr ls --versioned --kind=file ccan/$*`
-$(WEBDIR)/tarballs/with-deps/%.tar.bz2: ccan/%/test tools/ccan_depends
+$(WEBDIR)/tarballs/with-deps/%.tar.bz2: ccan/%/_info.c tools/ccan_depends
tar cfj $@ $$(echo ccan/$* $$(tools/ccan_depends ccan/$*) | xargs -n 1 bzr ls --versioned --kind=file)
distclean: distclean-web
tar cfj $@ $$(echo ccan/$* $$(tools/ccan_depends ccan/$*) | xargs -n 1 bzr ls --versioned --kind=file)
distclean: distclean-web
return 1;
if (strcmp(argv[1], "depends") == 0) {
return 1;
if (strcmp(argv[1], "depends") == 0) {
+ printf("libvorbis >=19\n");
if (strcmp(argv[1], "depends") == 0) {
printf("ccan/ogg_to_pcm\n"
if (strcmp(argv[1], "depends") == 0) {
printf("ccan/ogg_to_pcm\n"
"portaudio\n");
return 0;
}
"portaudio\n");
return 0;
}
unsigned int i;
bool compile = false;
bool recurse = true;
unsigned int i;
bool compile = false;
bool recurse = true;
if (argv[1] && streq(argv[1], "--direct")) {
argv++;
if (argv[1] && streq(argv[1], "--direct")) {
argv++;
argc--;
compile = true;
}
argc--;
compile = true;
}
+ if (argv[1] && streq(argv[1], "--non-ccan")) {
+ argv++;
+ argc--;
+ ccan = false;
+ }
- errx(1, "Usage: ccan_depends [--direct] [--compile] <dir>\n"
+ errx(1, "Usage: ccan_depends [--direct] [--compile] [--non-ccan] <dir>\n"
"Spits out all the ccan dependencies (recursively unless --direct)");
"Spits out all the ccan dependencies (recursively unless --direct)");
+ /* We find depends without compiling by looking for ccan/ */
+ if (!ccan && !compile)
+ errx(1, "--non-ccan needs --compile");
+
if (compile)
deps = get_deps(talloc_autofree_context(), argv[1], recurse);
else
if (compile)
deps = get_deps(talloc_autofree_context(), argv[1], recurse);
else
recurse);
for (i = 0; deps[i]; i++)
recurse);
for (i = 0; deps[i]; i++)
- if (strstarts(deps[i], "ccan/"))
+ if (strstarts(deps[i], "ccan/") == ccan)
printf("%s\n", deps[i]);
return 0;
}
printf("%s\n", deps[i]);
return 0;
}
$d = dir($argv[1]);
$modules = array();
while (false !== ($entry = $d->read())) {
$d = dir($argv[1]);
$modules = array();
while (false !== ($entry = $d->read())) {
- if ($entry[0] != '.' && is_dir($argv[1].$entry."/test")) {
+ if ($entry[0] != '.' && is_file($argv[1].$entry."/_info.c")) {
array_push($modules, $entry);
}
}
array_push($modules, $entry);
}
}
$description=htmlize_field('description',$module);
$example=extract_field('example',$module);
$dependencies=htmlspecialchars(shell_exec('tools/ccan_depends --direct '.$module));
$description=htmlize_field('description',$module);
$example=extract_field('example',$module);
$dependencies=htmlspecialchars(shell_exec('tools/ccan_depends --direct '.$module));
+$extdepends=htmlspecialchars(shell_exec('tools/ccan_depends --compile --non-ccan '.$module));
$licence=extract_field('licence',$module);
?>
<table align="center" bgcolor="lightblue" width="70%" border="0" cellpadding="3" cellspacing="1">
$licence=extract_field('licence',$module);
?>
<table align="center" bgcolor="lightblue" width="70%" border="0" cellpadding="3" cellspacing="1">
+
+if ($extdepends) {
+?>
+<tr align="left" bgcolor="FFFFCC">
+<td><h3>External dependencies: </h3> <?php
+ foreach (split("\n", $extdepends) as $dep) {
+ $fields=preg_split("/\s+/", $dep);
+ echo $fields[0].' ';
+ if (count($fields) > 1)
+ echo '(version '.$fields[1].') ';
+ echo '<br>';
+ }
+?></td>
+</tr>
+<?php
+}
?>
<tr align="left" bgcolor="FFFFCC">
<td><h3>Description: </h3> <?=$description;?> </td>
?>
<tr align="left" bgcolor="FFFFCC">
<td><h3>Description: </h3> <?=$description;?> </td>