#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2009 (ita)

"""
The tool "post_one" emulates the make behaviour for building exactly one file,
this will not work in general (tasks may not have files!), but some users might
use it for some c/c++

Though executing a full build first is recommended, it tries to guess the
dependencies to build exactly what is required first.

Examples:
waf distclean configure build --bf=libmy_static_lib.a
waf distclean configure build --bf=test_staticlib_2.o,main_1.o

"""

VERSION='0.0.1'
APPNAME='cc_test'

top = '.'
out = 'build'

def set_options(opt):
	opt.tool_options('post_one', tooldir='.')

def configure(conf):
	conf.check_tool('gcc')
	conf.check_tool('post_one', tooldir='.')

def build(bld):

	bld(
		features = 'cc cprogram',
		source = 'main.c',
		target = 'test_c_app',
		uselib_local = 'my_static_lib',
		includes = '. /usr/include')

	bld(
		features = 'cc cstaticlib',
		source = 'test_staticlib.c',
		target='my_static_lib')

