-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathEarthfile
34 lines (32 loc) · 1.21 KB
/
Earthfile
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
VERSION 0.8
build:
FROM ubuntu
WORKDIR /whitespace_compiler
COPY whitespace_compiler .
RUN apt-get update && \
apt-get install -y --no-install-recommends g++ flex bison && \
rm -rf /var/lib/apt/lists/*
# Compiling parser.tab.c with -O1, -O2, or -O3 or on alpine causes segfaults
# when running ./compile with some programs.
RUN flex lexer.l && \
bison -d parser.y && \
g++ -std=c++11 -c -o main.o main.cpp && \
g++ -std=gnu++11 -c -o lex.yy.o lex.yy.c && \
g++ -std=gnu++11 -c -o parser.tab.o parser.tab.c && \
g++ -static -o compile main.o lex.yy.o parser.tab.o
RUN set -e && \
mkdir compiled && \
for f in spoj spoj2 test; do \
./compile examples/$f.txt > compiled/$f.ws && \
./compile -a examples/$f.txt > compiled/${f}_a.ws && \
./compile -i examples/$f.txt > compiled/${f}_i.ws && \
./compile -a -i examples/$f.txt > compiled/${f}_ai.ws; \
done
SAVE ARTIFACT compile /bin/
SAVE ARTIFACT examples /programs
SAVE ARTIFACT compiled /programs/
docker:
FROM scratch
COPY +build/ /
ENTRYPOINT ["/bin/compile"]
SAVE IMAGE wspace-corpus/cpp/malkiewiczm