v / .github / workflows
Raw file | 56 loc (44 sloc) | 1.17 KB | Latest commit hash b666482d8
1#!/bin/bash
2
3set -e
4
5V=$PWD/v
6
7if [[ -x "$V" ]]
8then
9 echo "The v executable exists."
10else
11 echo "This script should be run from the top level folder of a V repository"
12 echo "i.e. the folder where your V executable is."
13 exit 1
14fi
15
16BUILD=$PWD/vinix_build
17
18echo "Creating $BUILD folder..."
19rm -rf $BUILD
20mkdir -p $BUILD
21
22cd $BUILD
23echo "Clone current Vinix"
24git clone https://github.com/vlang/vinix.git --depth=1
25
26cd $BUILD
27echo "Clone current mlibc"
28git clone https://github.com/managarm/mlibc.git --depth=1
29
30cd $BUILD
31echo "Patch mlibc for Vinix"
32cd mlibc
33patch -p3 < ../vinix/patches/mlibc/mlibc.patch
34
35cd $BUILD
36echo "Install mlibc headers"
37mkdir mlibc-build
38cd mlibc-build
39meson --cross-file ../vinix/cross_file.txt --prefix=/ -Dheaders_only=true ../mlibc
40ninja
41mkdir ../mlibc-headers
42DESTDIR=`realpath ../mlibc-headers` ninja install
43
44cd $BUILD
45echo "Attempt to build the Vinix kernel (debug)"
46cd vinix/kernel
47make PROD=false CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include"
48make clean
49
50cd $BUILD
51echo "Attempt to build the Vinix kernel (prod)"
52cd vinix/kernel
53make PROD=true CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include"
54make clean
55
56rm -rf $BUILD