Alexander Afanasyev | a1ae0a1 | 2014-01-28 15:21:02 -0800 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
Alexander Afanasyev | fff47d6 | 2014-05-11 19:24:46 -0700 | [diff] [blame] | 3 | from waflib import Utils |
| 4 | |
Alexander Afanasyev | a1ae0a1 | 2014-01-28 15:21:02 -0800 | [diff] [blame] | 5 | top = '..' |
| 6 | |
Yingdi Yu | 8d7468f | 2014-02-21 14:49:45 -0800 | [diff] [blame] | 7 | def configure(conf): |
| 8 | conf.find_program('sh') |
| 9 | |
Alexander Afanasyev | a1ae0a1 | 2014-01-28 15:21:02 -0800 | [diff] [blame] | 10 | def build(bld): |
Alexander Afanasyev | 28d0d94 | 2015-01-04 14:52:19 -0800 | [diff] [blame] | 11 | # List all .cpp files (whole tool should be in one .cpp) |
| 12 | for i in bld.path.ant_glob(['*.cpp']): |
| 13 | name = str(i)[:-len(".cpp")] |
Alexander Afanasyev | a1ae0a1 | 2014-01-28 15:21:02 -0800 | [diff] [blame] | 14 | bld(features=['cxx', 'cxxprogram'], |
Alexander Afanasyev | 28d0d94 | 2015-01-04 14:52:19 -0800 | [diff] [blame] | 15 | target="../bin/%s" % name, |
| 16 | source=[i] + bld.path.ant_glob(['%s/**/*.cpp' % name]), |
| 17 | use='ndn-cxx' |
Alexander Afanasyev | 766cea7 | 2014-04-24 19:16:42 -0700 | [diff] [blame] | 18 | ) |
Yingdi Yu | 8d7468f | 2014-02-21 14:49:45 -0800 | [diff] [blame] | 19 | |
Alexander Afanasyev | 28d0d94 | 2015-01-04 14:52:19 -0800 | [diff] [blame] | 20 | # List all directories files (tool can has multiple .cpp in the directory) |
| 21 | for name in bld.path.ant_glob(['*'], dir=True, src=False, excl=['wrapper']): |
| 22 | bld(features=['cxx', 'cxxprogram'], |
| 23 | target="../bin/%s" % name, |
| 24 | source=bld.path.ant_glob(['%s/**/*.cpp' % name]), |
| 25 | use='ndn-cxx', |
| 26 | includes='%s' % name, |
| 27 | ) |
| 28 | |
| 29 | bld(features="subst", |
| 30 | source=bld.path.ant_glob(['wrapper/*.sh']), |
| 31 | target=['%s' % node.change_ext('', '.sh') |
| 32 | for node in bld.path.ant_glob(['wrapper/*.sh'])], |
| 33 | install_path="${BINDIR}", |
| 34 | chmod=Utils.O755, |
Alexander Afanasyev | fff47d6 | 2014-05-11 19:24:46 -0700 | [diff] [blame] | 35 | ) |