X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fcreate-ccan-tree;h=64fc36e7efd7db832f0759c24974fa01e2ff3d34;hp=ccfee7c664cdcf3bae592844552a2e291e314ab7;hb=d218dcd458cbec7a1b958af39b70cd068da7b040;hpb=e9704966d0d91d96eefdfad040540ae76d3030ec diff --git a/tools/create-ccan-tree b/tools/create-ccan-tree index ccfee7c6..64fc36e7 100755 --- a/tools/create-ccan-tree +++ b/tools/create-ccan-tree @@ -10,7 +10,7 @@ options: -a, --copy-all copy all files in module tree (not just sources required for build) -b, --build-type=TYPE generate build infrastructure of TYPE - (one of 'make', 'make+config') + (one of 'make', 'make+config', 'automake', 'waf') EOF } @@ -60,7 +60,7 @@ fi # check --build-type argument sanity case "$build_type" in - ''|'make'|'make+config') + ''|'make'|'make+config'|'automake'|'waf') ;; *) echo "Invalid build type '$build_type'" >&2 @@ -162,6 +162,19 @@ done echo "Adding build infrastructure" +# generate automake Makefile.am +automakefile="$tmpdir/Makefile.am" +if [ "$build_type" = "automake" ] +then + ( + echo "noinst_LIBRARIES = libccan.a" + echo "libccan_a_SOURCES = \\" + cd "$tmpdir" + find ccan -maxdepth 2 -name '*.[ch]' | + sed -e 's,^,\t,;$!s,$, \\,' + ) > "$automakefile" +fi + makefile="$tmpdir/Makefile" if [ "$build_type" = "make" -o "$build_type" = "make+config" ] then @@ -196,6 +209,18 @@ objs = \$(patsubst %.c, %.o, \$(wildcard ccan/*/*.c)) EOF fi +if [ "$build_type" = "waf" ] +then + echo "Adding waf wscript" + cat > "$tmpdir/wscript" << EOF +def build(ctx): + ctx(features = 'c cstlib', + source = ctx.path.ant_glob('**/*.c'), + target = 'ccan', + includes = '.') +EOF +fi + mv "$tmpdir" "$outdir" echo "Done. ccan source tree built in $outdir"