| 1 |
# -*- sh -*- |
| 2 |
# Build script to build Halibut releases. |
| 3 |
|
| 4 |
module halibut |
| 5 |
|
| 6 |
# Make up a version number. |
| 7 |
set Version $(!builddate).$(vcsid) |
| 8 |
ifneq "$(RELEASE)" "" set Version $(RELEASE) |
| 9 |
|
| 10 |
# use perl to avoid inconsistent behaviour of echo '\v' |
| 11 |
in halibut do perl -e 'print "\n\\versionid Halibut version $$ARGV[0]\n"' $(Version) >> doc/manpage.but |
| 12 |
|
| 13 |
# Write out a version.h that contains the real version number. |
| 14 |
in halibut do echo '/* Generated by automated build script */' > version.h |
| 15 |
in halibut do echo '$#define VERSION "version $(Version)"' >> version.h |
| 16 |
|
| 17 |
# Make the source archive. |
| 18 |
in . do ln -s halibut halibut-$(Version) |
| 19 |
in . do tar chzvf halibut-$(Version).tar.gz halibut-$(Version) |
| 20 |
|
| 21 |
# Build the Windows binary, using clang-cl. |
| 22 |
in . do mkdir buildwin |
| 23 |
in buildwin do cmake ../halibut -DCMAKE_TOOLCHAIN_FILE=$(cmake_toolchain_clangcl64) -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_C_FLAGS_RELEASE="/MT /O2" |
| 24 |
in buildwin do make -j$(nproc) VERBOSE=1 |
| 25 |
# Code-sign the Windows binary, if the local bob config provides a |
| 26 |
# script to do so. We assume here that the script accepts an -i option |
| 27 |
# to provide a 'more info' URL, and that it signs the file in place. |
| 28 |
ifneq "$(cross_winsigncode)" "" in buildwin do $(cross_winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/halibut/ halibut.exe |
| 29 |
|
| 30 |
# Do a full Unix build, which will also build the docs, and also |
| 31 |
# checks that it _does_ build. |
| 32 |
in . do mkdir buildunix |
| 33 |
in buildunix do cmake ../halibut |
| 34 |
in buildunix do make -j$(nproc) VERBOSE=1 |
| 35 |
|
| 36 |
deliver halibut-$(Version).tar.gz $@ |
| 37 |
deliver buildwin/halibut.exe $@ |
| 38 |
deliver buildunix/doc/manual/halibut.pdf $@ |
| 39 |
deliver buildunix/doc/manual/halibut.txt $@ |
| 40 |
deliver buildunix/doc/manual/halibut.chm $@ |
| 41 |
deliver buildunix/doc/manual/*.html $@ |