compile.sh 1.51 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
9
10
11
12
13
java -jar ../../compiler/labComm.jar --java=gen --c=gen/simple.c --h=gen/simple.h  --python=gen/simple.py simple.lc 

javac -cp ../../lib/java:. gen/*.java Encoder.java Decoder.java

gcc -Wall -Werror -I. -I../../lib/c -L../../lib/c \
    -o example_encoder example_encoder.c gen/simple.c \
14
    -llabcomm2013 -Tlabcomm.linkscript
15
16
gcc -Wall -Werror -I . -I ../../lib/c -L../../lib/c \
    -o example_decoder example_decoder.c gen/simple.c \
17
    -llabcomm2013 -Tlabcomm.linkscript
18
19

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

21
22
mkdir -p gen06
java -jar ../../compiler/labComm.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
23

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

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

#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
36

Sven Robertz's avatar
Sven Robertz committed
37