3 # Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 def build(target, options):
21 if target.platform == 'linux':
26 elif target.platform == 'osx':
34 elif target.platform == 'windows':
35 type = 'mingw' if target.bits == 64 else 'mingw-32'
40 target.command('mkdir -p %s/include/lwext4' % target.directory)
41 target.command('cp -r include/* %s/include/lwext4' % target.directory)
42 target.command('make %s' % type)
43 target.command('make -j%d -C build_%s' % (target.parallel, type))
44 target.command('cp -r build_%s/include/generated %s/include/lwext4' % (type, target.directory))
45 target.command('cp blockdev/%s/file_%s.h %s/include/lwext4' % (blockdev, device, target.directory))
46 target.command('mkdir -p %s/lib' % target.directory)
47 target.command('cp build_%s/src/liblwext4.%s %s/lib' % (type, ext, target.directory))
48 target.command('cp build_%s/blockdev/libblockdev.%s %s/lib' % (type, ext, target.directory))