Chengyu Fan | b25835b | 2015-04-28 17:09:35 -0600 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
| 3 | """ |
| 4 | Copyright (c) 2013-2015, Regents of the University of California, |
| 5 | 2015, Colorado State University. |
| 6 | |
| 7 | This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
| 8 | |
| 9 | ndn-cxx library is free software: you can redistribute it and/or modify it under the |
| 10 | terms of the GNU Lesser General Public License as published by the Free Software |
| 11 | Foundation, either version 3 of the License, or (at your option) any later version. |
| 12 | |
| 13 | ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY |
| 14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 15 | PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
| 16 | |
| 17 | You should have received copies of the GNU General Public License and GNU Lesser |
| 18 | General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see |
| 19 | <http://www.gnu.org/licenses/>. |
| 20 | |
| 21 | See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
| 22 | """ |
| 23 | |
| 24 | from waflib import Utils |
| 25 | |
| 26 | top = '..' |
| 27 | |
| 28 | def configure(conf): |
| 29 | conf.find_program('sh') |
| 30 | |
| 31 | def build(bld): |
| 32 | # List all .cpp files (whole tool should be in one .cpp) |
| 33 | for i in bld.path.ant_glob(['*.cpp']): |
| 34 | name = str(i)[:-len(".cpp")] |
| 35 | bld(features=['cxx', 'cxxprogram'], |
| 36 | target="../bin/%s" % name, |
| 37 | source=[i] + bld.path.ant_glob(['%s/**/*.cpp' % name]), |
Chengyu Fan | 4639821 | 2015-08-11 11:23:13 -0600 | [diff] [blame^] | 38 | use='NDN_CXX JSON' |
Chengyu Fan | b25835b | 2015-04-28 17:09:35 -0600 | [diff] [blame] | 39 | ) |
| 40 | |
| 41 | # List all directories files (tool can has multiple .cpp in the directory) |
| 42 | for name in bld.path.ant_glob(['*'], dir=True, src=False, excl=['wrapper']): |
| 43 | bld(features=['cxx', 'cxxprogram'], |
| 44 | target="../bin/%s" % name, |
| 45 | source=bld.path.ant_glob(['%s/**/*.cpp' % name]), |
| 46 | use='NDN_CXX', |
| 47 | includes='%s' % name, |
| 48 | ) |
| 49 | |
| 50 | bld(features="subst", |
| 51 | source=bld.path.ant_glob(['*.sh', '*.py']), |
| 52 | target=['../bin/%s' % node.change_ext('') |
| 53 | for node in bld.path.ant_glob(['*.sh', '*.py'])], |
| 54 | install_path="${BINDIR}", |
| 55 | chmod=Utils.O755 |
| 56 | ) |