From 66c28e357819636d371eee746783ab32f6b5e89e Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Tue, 4 Mar 2014 08:22:48 +0100 Subject: [PATCH] hybrid builds --- playground/extern_makefile/just_make/Makefile | 4 +++- playground/extern_makefile/just_make/main.c | 6 ++++++ playground/extern_makefile/just_make/wscript | 7 +++++++ playground/extern_makefile/wscript | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 playground/extern_makefile/just_make/main.c diff --git a/playground/extern_makefile/just_make/Makefile b/playground/extern_makefile/just_make/Makefile index a6159303..e33ea592 100644 --- a/playground/extern_makefile/just_make/Makefile +++ b/playground/extern_makefile/just_make/Makefile @@ -1,3 +1,5 @@ all: - touch ../build/just_make/foo.so + echo "int foo() {return 2;} " > ../build/just_make_mk.c + gcc -shared ../build/just_make_mk.c -o ../build/just_make/libfoo.so + diff --git a/playground/extern_makefile/just_make/main.c b/playground/extern_makefile/just_make/main.c new file mode 100644 index 00000000..70f2b5a4 --- /dev/null +++ b/playground/extern_makefile/just_make/main.c @@ -0,0 +1,6 @@ + +int foo(); + +int main() { + return foo(); +} diff --git a/playground/extern_makefile/just_make/wscript b/playground/extern_makefile/just_make/wscript index 510bd960..7d2b2253 100644 --- a/playground/extern_makefile/just_make/wscript +++ b/playground/extern_makefile/just_make/wscript @@ -1,5 +1,6 @@ #! /usr/bin/env python +from waflib import Build def build(bld): # Call make for building, but keep waf for install/uninstall @@ -20,3 +21,9 @@ def build(bld): # the make command will be called only once bld(rule=make_all, always=True, name='call make') + # for a hybrid build... + bld.post_mode = Build.POST_LAZY + bld.add_group() + bld.read_shlib('foo', paths=[bld.path.get_bld().abspath()]) + bld.program(source='main.c', target='a', use='foo') + diff --git a/playground/extern_makefile/wscript b/playground/extern_makefile/wscript index b6651c25..82c9605e 100644 --- a/playground/extern_makefile/wscript +++ b/playground/extern_makefile/wscript @@ -2,6 +2,7 @@ def configure(conf): conf.env.thecmd = 'all' + conf.load('gcc') def build(bld): bld(rule='touch ${TGT}', target='bar.txt')