Alexander Afanasyev | 262203b | 2015-01-26 16:39:59 -0800 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
| 3 | from waflib import Utils, Context |
| 4 | |
| 5 | top = '..' |
| 6 | |
| 7 | def build(bld): |
| 8 | # List all .cpp files (whole tool should be in one .cpp) |
| 9 | for i in bld.path.ant_glob(['*.cpp']): |
| 10 | name = str(i)[:-len(".cpp")] |
| 11 | bld(features=['cxx', 'cxxprogram'], |
| 12 | target="../bin/%s" % name, |
| 13 | source=[i] + bld.path.ant_glob(['%s/**/*.cpp' % name]), |
| 14 | use='ndn-cxx core-objects LIBRESOLV BOOST' |
| 15 | ) |
| 16 | |
| 17 | # List all directories files (tool can has multiple .cpp in the directory) |
| 18 | for name in bld.path.ant_glob(['*'], dir=True, src=False): |
| 19 | srcFiles = bld.path.ant_glob(['%s/**/*.cpp' % name]) |
| 20 | if len(srcFiles) > 0: |
| 21 | bld(features=['cxx', 'cxxprogram'], |
| 22 | target="../bin/%s" % name, |
| 23 | source=srcFiles, |
| 24 | use='ndn-cxx core-objects LIBRESOLV BOOST', |
| 25 | includes='%s' % name, |
| 26 | ) |
| 27 | |
| 28 | bld(features="subst", |
| 29 | source=bld.path.ant_glob(['*.sh', '*.py']), |
| 30 | target=['../bin/%s' % node.change_ext('') |
| 31 | for node in bld.path.ant_glob(['*.sh', '*.py'])], |
| 32 | install_path="${BINDIR}", |
| 33 | chmod=Utils.O755, |
| 34 | VERSION=Context.g_module.VERSION |
| 35 | ) |
| 36 | |
| 37 | bld.install_files("${DATAROOTDIR}/ndn", |
| 38 | bld.path.ant_glob('nfd-status-http-server-files/*')) |