Codebase list halibut / HEAD Buildscr
HEAD

Tree @HEAD (Download .tar.gz)

Buildscr @HEADraw · history · blame

# -*- sh -*-
# Build script to build Halibut releases.

module halibut

# Make up a version number.
set Version $(!builddate).$(vcsid)
ifneq "$(RELEASE)" "" set Version $(RELEASE)

# use perl to avoid inconsistent behaviour of echo '\v'
in halibut do perl -e 'print "\n\\versionid Halibut version $$ARGV[0]\n"' $(Version) >> doc/manpage.but

# Write out a version.h that contains the real version number.
in halibut do echo '/* Generated by automated build script */' > version.h
in halibut do echo '$#define VERSION "version $(Version)"' >> version.h

# Make the source archive.
in . do ln -s halibut halibut-$(Version)
in . do tar chzvf halibut-$(Version).tar.gz halibut-$(Version)

# Build the Windows binary, using clang-cl.
in . do mkdir buildwin
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"
in buildwin do make -j$(nproc) VERBOSE=1
# Code-sign the Windows binary, if the local bob config provides a
# script to do so. We assume here that the script accepts an -i option
# to provide a 'more info' URL, and that it signs the file in place.
ifneq "$(cross_winsigncode)" "" in buildwin do $(cross_winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/halibut/ halibut.exe

# Do a full Unix build, which will also build the docs, and also
# checks that it _does_ build.
in . do mkdir buildunix
in buildunix do cmake ../halibut
in buildunix do make -j$(nproc) VERBOSE=1

deliver halibut-$(Version).tar.gz $@
deliver buildwin/halibut.exe $@
deliver buildunix/doc/manual/halibut.pdf $@
deliver buildunix/doc/manual/halibut.txt $@
deliver buildunix/doc/manual/halibut.chm $@
deliver buildunix/doc/manual/*.html $@