2 # -*- coding: utf-8 -*-
4 # WAF build script - this file is part of vomak - a very simple IRC bot
6 # Copyright 2008 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 # $Id: wscript 2649 2008-06-05 16:52:39Z eht16 $
24 This is a WAF build script (http://code.google.com/p/waf/).
28 import Params
, subprocess
, sys
40 conf
.check_tool('compiler_cc')
42 conf
.check_pkg('glib-2.0', destvar
='GLIB', vnum
='2.6.0', mandatory
=True)
44 if Params
.g_options
.debug
:
45 conf
.env
.append_value('CCFLAGS', '-g -DDEBUG -O0')
49 opt
.tool_options('compiler_cc')
51 opt
.add_option('--html', action
='store_true', default
=False,
52 help='generate HTML doc [default: No]', dest
='html')
54 opt
.add_option('--debug', action
='store_true', default
=False,
55 help='enable debug mode [default: No]', dest
='debug')
59 obj
= bld
.create_obj('cc', 'program')
62 obj
.source
= 'src/irc.c src/socket.c src/vomak.c'
68 if Params
.g_options
.html
:
69 ret
= launch('rst2html -stg --stylesheet=vomak.css README readme.html',
70 'Generating HTML documentation')
74 # Simple function to execute a command and print its exit status
75 def launch(command
, status
):
77 Params
.pprint('GREEN', status
)
79 ret
= subprocess
.call(command
.split())
84 Params
.pprint('RED', status
+ ' failed')