compile.sh 1.59 KB
Newer Older
1 2 3 4
### Example compile script, showing the steps required to build a labcomm application
### (including compiler and libs). Also illustrates how versions 2013 and 2006 coexist

# For current version (2013)
Sven Robertz's avatar
Sven Robertz committed
5
(cd ../..; make all)
Sven Robertz's avatar
Sven Robertz committed
6

7
mkdir -p gen
8
java -jar ../../compiler/labcomm_compiler.jar --java=gen --c=gen/simple.c --h=gen/simple.h  --python=gen/simple.py simple.lc 
9

10
javac -cp ../../lib/java/labcomm2014.jar:. gen/*.java Encoder.java Decoder.java
11

12 13
gcc -Wall -Werror -Wno-unused-function \
    -I. -I../../lib/c -L../../lib/c \
14
    -o example_encoder example_encoder.c gen/simple.c \
15
    -llabcomm2014 -Tlabcomm.linkscript
16 17
gcc -Wall -Werror -I . -I ../../lib/c -L../../lib/c \
    -o example_decoder example_decoder.c gen/simple.c \
18
    -llabcomm2014 -Tlabcomm.linkscript
19 20

# For version 2006
Sven Robertz's avatar
Sven Robertz committed
21

22
mkdir -p gen06
23
java -jar ../../compiler/labcomm_compiler.jar --ver=2006 --java=gen06 --c=gen06/simple.c --h=gen06/simple.h  --python=gen06/simple.py simple.lc 
Sven Robertz's avatar
Sven Robertz committed
24

25
javac -cp ../../lib/java/labcomm2006.jar:. gen06/*.java Encoder06.java Decoder06.java
Sven Gestegård Robertz's avatar
Sven Gestegård Robertz committed
26 27

gcc -Wall -Werror -I.  -I../../lib/c/2006 -L../../lib/c \
28
    -o example_encoder06 example_encoder06.c gen06/simple.c \
29
    -llabcomm -Tlabcomm.linkscript
Sven Gestegård Robertz's avatar
Sven Gestegård Robertz committed
30
gcc -Wall -Werror -I . -I ../../lib/c/2006 -L../../lib/c \
31
    -o example_decoder06 example_decoder06.c gen06/simple.c \
32
    -llabcomm -Tlabcomm.linkscript
33 34 35 36

#gcc -o example_encoder -I . -I ../../lib/c example_encoder.c gen/simple.c ../../lib/c/labcomm.c ../../lib/c/labcomm_fd_reader_writer.c

#gcc -o example_decoder -I . -I ../../lib/c example_decoder.c gen/simple.c ../../lib/c/labcomm.c ../../lib/c/labcomm_fd_reader_writer.c
Sven Robertz's avatar
Sven Robertz committed
37

Sven Robertz's avatar
Sven Robertz committed
38