Skip to content

Commit c027cc1

Browse files
xavierrouthXavier Routh
and
Xavier Routh
authored
Refactor LC3 Compiler Build (#68)
* lc3 compiler build script * fix build script * updated lc3-compiler build script * Fix names --------- Co-authored-by: Xavier Routh <[email protected]>
1 parent 0dd6ad3 commit c027cc1

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
image: ['misc', 'rocm', 'compcert', 'rust-cg-gcc', 'rust-linux', 'iwyu']
10+
image: ['misc', 'rocm', 'compcert', 'rust-cg-gcc', 'rust-linux', 'iwyu', 'lc3']
1111
steps:
1212
- name: Docker Setup Buildx
1313
uses: docker/setup-buildx-action@v2

Dockerfile.lc3

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM ubuntu:20.04
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
RUN dpkg --add-architecture i386
5+
RUN apt update -y -q && apt upgrade -y -q && apt update -y -q && \
6+
apt install -y -q \
7+
build-essential \
8+
bison \
9+
curl \
10+
flex \
11+
git \
12+
libc6-dev-i386 \
13+
libc6-dev:i386 \
14+
make \
15+
patchelf \
16+
xz-utils
17+
18+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
19+
20+
RUN mkdir -p /root
21+
COPY lc3 /root/
22+
COPY common.sh /root/
23+
24+
WORKDIR /root

misc/build-lc3.sh renamed to lc3/build.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -ex
44
source common.sh
5+
export PATH="$PATH":"$HOME"/.cargo/bin
6+
source $HOME/.cargo/env
57

68
VERSION=$1
79
if [[ "${VERSION}" = "trunk" ]]; then
@@ -11,7 +13,7 @@ else
1113
BRANCH=V${VERSION}
1214
fi
1315

14-
URL=https://github.com/xavierrouth/C-LC3-Compiler
16+
URL=https://github.com/xavierrouth/lc3-compiler
1517

1618
FULLNAME=C-LC3-Compiler-${VERSION}.tar.xz
1719
OUTPUT=$2/${FULLNAME}
@@ -22,15 +24,13 @@ LAST_REVISION="${3:-}"
2224
initialise "${REVISION}" "${OUTPUT}" "${LAST_REVISION}"
2325

2426
PREFIX=$(pwd)/prefix
25-
DIR=$(pwd)/C-LC3-Compiler
26-
BUILD=${DIR}/build
27+
DIR=$(pwd)/lc3-compiler
28+
BUILD=${DIR}/target/release
2729

28-
git clone --recurse-submodules --depth 1 -b "${BRANCH}" "${URL}" "${DIR}"
30+
git clone --depth 1 -b "${BRANCH}" "${URL}" "${DIR}"
2931

30-
mkdir "${BUILD}"
31-
cd "${BUILD}"
32-
cmake ..
33-
make
32+
cd $DIR
33+
cargo build --release
3434
mkdir -p "${PREFIX}"
3535

3636
cp "${BUILD}/lc3-compile" "${PREFIX}"

0 commit comments

Comments
 (0)