Skip to content

Instantly share code, notes, and snippets.

@barnslig
Last active May 19, 2018 10:28
Show Gist options
  • Select an option

  • Save barnslig/cee433ea5812ee2c921cc85ed2102d6b to your computer and use it in GitHub Desktop.

Select an option

Save barnslig/cee433ea5812ee2c921cc85ed2102d6b to your computer and use it in GitHub Desktop.
compiler construction!
FROM ubuntu:artful
RUN apt-get update \
&& apt-get -y install build-essential llvm-4.0 clang libedit-dev libgmp-dev bison flex libz-dev ghc curl \
&& curl -sSL https://get.haskellstack.org/ | sh \
&& stack --resolver lts-8.13 --install-ghc install BNFC alex happy \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get -y install cmake libgtest-dev \
&& cd /usr/src/gtest \
&& cmake . \
&& make \
&& cp *.a /usr/lib
WORKDIR /app
ENV PATH "$PATH:/root/.local/bin"
# usage:
# docker build -t compilerconstruction container
# docker container run -i -t --rm -v "$(pwd)":/app compilerconstruction bnfc -m -c CPP.cf CPP
# docker container run -i -t --rm -v "$(pwd)":/app compilerconstruction bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment