Skip to content
Snippets Groups Projects
Commit fb8d0935 authored by Sven Robertz's avatar Sven Robertz
Browse files

added compilation of dependencies to the compile scripts

parent 4583884b
No related branches found
No related tags found
No related merge requests found
NB! Before trying to build and run this example, make sure you have built the LabComm compiler NB! Before trying to build and run examples, make sure you have built the LabComm compiler
by running "ant jar" in the main directory (../../ seen from here). by running "ant jar" in the main directory (../../ seen from here) and compiled the labcomm
descriptions needed. The compile.sh script does this.
This is a very simple example with one labcomm file (simple.lc) defining two samples. This is a very simple example with one labcomm file (simple.lc) defining two samples.
Example source code: Encoders and decoders written in Java and C. Example source code: Encoders and decoders written in Java and C.
......
(cd ../../lib/c; make) (cd ../../lib/c; make)
(cd ../../ ; ant jar)
java -jar ../../labComm.jar --java=gen --c=gen/simple.c --h=gen/simple.h simple.lc java -jar ../../labComm.jar --java=gen --c=gen/simple.c --h=gen/simple.h simple.lc
......
(cd ../../../lib/c; make) #(cd ../../../lib/c; make)
(cd ..; sh compile.sh)
gcc -o thr_example -L ../../../lib/c -I . -I .. -I ../../../lib/c thr_example.c ../gen/simple.c -llabcomm gcc -o thr_example -L ../../../lib/c -I . -I .. -I ../../../lib/c thr_example.c ../gen/simple.c -llabcomm
#gcc -o thr_example -L ../../../lib/c -I . -I .. -I ../../../lib/c thr_example.c ../gen/simple.c ../../../lib/c/labcomm_thr_reader_writer.c ../../../lib/c/ThrottleDrv/*.c -llabcomm #gcc -o thr_example -L ../../../lib/c -I . -I .. -I ../../../lib/c thr_example.c ../gen/simple.c ../../../lib/c/labcomm_thr_reader_writer.c ../../../lib/c/ThrottleDrv/*.c -llabcomm
(cd ../../../lib/c; make) #(cd ../../../lib/c; make)
gcc -g -o udp_encoder -L ../../../lib/c -I . -I .. -I ../../../lib/c udp_encoder.c ../gen/simple.c ../../../lib/c/labcomm_udp_reader_writer.c udp_hack.c -llabcomm (cd ..; sh compile.sh)
gcc -g -o udp_decoder -L ../../../lib/c -I . -I .. -I ../../../lib/c udp_decoder.c ../gen/simple.c ../../../lib/c/labcomm_udp_reader_writer.c udp_hack.c -llabcomm gcc -g -o udp_encoder -L ../../../lib/c -I . -I .. -I ../../../lib/c udp_encoder.c ../gen/simple.c -llabcomm
gcc -g -o udp_decoder -L ../../../lib/c -I . -I .. -I ../../../lib/c udp_decoder.c ../gen/simple.c -llabcomm
CC = gcc CC = gcc
CFLAGS = -g CFLAGS = -g
liblabcomm.a : labcomm.o labcomm_fd_reader_writer.o labcomm_udp_reader_writer.o labcomm_thr_reader_writer.o ethaddr.o ThrottleDrv/ethernet_drv.o ThrottleDrv/throttle_drv.o liblabcomm.a : labcomm.o labcomm_fd_reader_writer.o labcomm_udp_reader_writer.o udp_hack.o labcomm_thr_reader_writer.o ethaddr.o ThrottleDrv/ethernet_drv.o ThrottleDrv/throttle_drv.o
# ar -r liblabcomm.a labcomm.o labcomm_fd_reader_writer.o ethaddr.o # ar -r liblabcomm.a labcomm.o labcomm_fd_reader_writer.o ethaddr.o
ar -r liblabcomm.a $^ ar -r liblabcomm.a $^
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment