Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 33 lines (27 sloc) 1.34 KB
#create the ll object file first
gcc -fPIC -pg -c -Wall utl/ll.c
gcc -fPIC -pg -c -Wall utl/heap.c
gcc -fPIC -pg -c -Wall utl/hash.c
gcc -fPIC -pg -c -Wall utl/bst.c
gcc -fPIC -pg -c -Wall utl/bsearch.c
#Now create shared object (library)
gcc -shared -o lib/ ll.o
gcc -shared -o lib/ heap.o
gcc -shared -o lib/ hash.o
gcc -shared -o lib/ bst.o
gcc -shared -o lib/ bsearch.o
#compile any code and link with library
gcc -pg -Wall -Wunused src/llcaller.c -o bin/llcaller -L`pwd`/lib/ -llinkedlist
gcc -pg -Wall -Wunused src/heapcaller.c -o bin/heapcaller -L`pwd`/lib/ -lheap -llinkedlist
gcc -pg -Wall -Wunused src/hashcaller.c -o bin/hashcaller -L`pwd`/lib/ -lheap -llinkedlist -lhash -lbst
gcc -pg -Wall -Wunused src/bstcaller.c -o bin/bstcaller -L`pwd`/lib/ -lbst
gcc -pg -Wall -Wunused src/bstinorder.c -o bin/bstinorder -L`pwd`/lib/ -lbst
gcc -pg -Wall -Wunused src/bcaller.c -o bin/bcaller -L`pwd`/lib/ -lbsearch
#random code
gcc -pg src/findcomplement.c -o bin/findcomplement -L`pwd`/lib/ -lhash -lbst -llinkedlist
gcc -pg src/countsetbits.c -o bin/countsetbits
gcc -pg src/startserver.c -o bin/startserver
gcc -pg src/startclient.c -o bin/startclient
gcc -pg src/newchild.c -o bin/newchild
#Dont forget to keep LIB path in env variable
export LD_LIBRARY_PATH=/scratch/flicktest/lib/