blob: 8caf393a78c440753e2b76b91bd93f85d5fc56c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# -*- sh -*-
# Build script to build Halibut releases.
module halibut
ifnexist halibut/charset checkout charset halibut/charset
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
# Substitute the version into configure.ac.
in halibut do perl -i -pe 's!NOVERSION!$(Version)!' configure.ac
# Run autotools.
in halibut do ./autogen.sh
# Make the source archive.
in . do mkdir builddist
in builddist do ../halibut/configure && make dist
# Build a Windows binary of Halibut using clang-cl.
in . do mkdir buildwin
in buildwin do mkdir lld-link-bodge
in buildwin/lld-link-bodge do { echo '$#!/bin/sh'; echo 'exec lld-link "$$@"'; } > lld-link.exe && chmod +x lld-link.exe
in buildwin do ../halibut/configure
in buildwin/charset with clangcl64 do PATH="$$PWD/lld-link-bodge:$$PATH" make CC='clang --target=x86_64-pc-windows-msvc18.0.0 -D_CRT_SECURE_NO_WARNINGS -fuse-ld=lld' bin_PROGRAMS=
in buildwin with clangcl64 do PATH="$$PWD/lld-link-bodge:$$PATH" make CC='clang --target=x86_64-pc-windows-msvc18.0.0 -D_CRT_SECURE_NO_WARNINGS -fuse-ld=lld' EXEEXT=.exe halibut.exe
# 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 local build of Halibut, which will also build the docs.
in builddist do make
deliver builddist/*.tar.gz $@
deliver buildwin/halibut.exe $@
deliver builddist/halibut.pdf $@
deliver builddist/halibut.txt $@
deliver builddist/halibut.chm $@
deliver builddist/*.html $@
|