build 1.3 KB

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
  4. distdir=/var/tmp/dist/[% project %]
  5. mkdir -p /var/tmp/build
  6. tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  7. cd /var/tmp/build/[% project %]-[% c('version') %]
  8. [% IF c("var/windows") -%]
  9. make BINARY_PATH=$distdir/lib INCLUDE_PATH=$distdir/include LIBRARY_PATH=$distdir/lib -f win32/Makefile.gcc PREFIX=[% c("arch") %]-w64-mingw32- CC=[% c("arch") %]-w64-mingw32-cc -j[% c("num_procs") %] SHARED_MODE=1 LOC="[% c("var/CFLAGS") %] [% c("var/LDFLAGS") %]"
  10. make BINARY_PATH=$distdir/lib INCLUDE_PATH=$distdir/include LIBRARY_PATH=$distdir/lib -f win32/Makefile.gcc PREFIX=[% c("arch") %]-w64-mingw32- CC=[% c("arch") %]-w64-mingw32-cc -j[% c("num_procs") %] SHARED_MODE=1 LOC="[% c("var/CFLAGS") %] [% c("var/LDFLAGS") %]" install
  11. [% END -%]
  12. [% IF c("var/android") -%]
  13. export CHOST=[% c("var/cross_prefix") %]
  14. export CC=[% c("var/CC") %]
  15. ./configure --prefix=$distdir
  16. make -j[% c("num_procs") %]
  17. make -j[% c("num_procs") %] install
  18. # Only need static libraries
  19. rm -r $distdir/lib/{*.so*,pkgconfig}
  20. [% END -%]
  21. cd /var/tmp/dist
  22. [% c('tar', {
  23. tar_src => [ project ],
  24. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  25. }) %]