Tweak cscript for OS X.
[lwext4.git] / cscript
1 # -*- mode: python -*-
2 #
3 #    Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
4 #
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.
9 #
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.
14 #
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.
18 #
19
20 def build(target, options):
21     if target.platform == 'linux':
22         target.command('make generic')
23         target.command('make -j%d -C build_generic' % target.parallel)
24         target.command('mkdir -p %s/include/lwext4' % target.directory)
25         target.command('cp -r include/* %s/include/lwext4' % target.directory)
26         target.command('cp -r build_generic/include/generated %s/include/lwext4' % target.directory)
27         target.command('cp blockdev/linux/file_dev.h %s/include/lwext4' % target.directory)
28         target.command('cp build_generic/src/liblwext4.so %s/lib' % target.directory)
29         target.command('cp build_generic/blockdev/libblockdev.so %s/lib' % target.directory)
30     elif target.platform == 'osx':
31         target.command('make generic')
32         target.command('make -j%d -C build_generic' % target.parallel)
33         target.command('mkdir -p %s/include/lwext4' % target.directory)
34         target.command('cp -r include/* %s/include/lwext4' % target.directory)
35         target.command('cp -r build_generic/include/generated %s/include/lwext4' % target.directory)
36         target.command('cp blockdev/linux/file_dev.h %s/include/lwext4' % target.directory)
37         target.command('cp build_generic/src/liblwext4.dylib %s/lib' % target.directory)
38         target.command('cp build_generic/blockdev/libblockdev.dylib %s/lib' % target.directory)
39     elif target.platform == 'windows':
40         target.command('make mingw')
41         target.command('make -j%d -C build_mingw')
42         target.command('mkdir -p %s/include/lwext4' % target.directory)
43         target.command('cp -r include/* %s/include/lwext4' % target.directory)
44         target.command('cp -r build_mingw/include/generated %s/include/lwext4' % target.directory)
45         target.command('cp blockdev/windows/file_dev.h %s/include/lwext4' % target.directory)
46         target.command('cp build_mingw/src/liblwext4.dll %s/lib' % target.directory)
47         target.command('cp build_mingw/blockdev/libblockdev.dll %s/lib' % target.directory)