Fixed Makefile
This commit is contained in:
parent
f0f4a0ef6d
commit
281d1c942e
18
Makefile
18
Makefile
@ -5,9 +5,6 @@ VERSION = 1
|
|||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
# Location for the build files for instrumentation purposes
|
|
||||||
INST_BUILD_LOC = /home/courses/cs3214/bin/heap-visualizer/processing/build
|
|
||||||
|
|
||||||
# for benchmarking - this turns asserts off.
|
# for benchmarking - this turns asserts off.
|
||||||
CFLAGS = -Wall -O3 -Werror -pthread -DNDEBUG=1
|
CFLAGS = -Wall -O3 -Werror -pthread -DNDEBUG=1
|
||||||
# for debugging, with asserts on
|
# for debugging, with asserts on
|
||||||
@ -18,15 +15,20 @@ OBJS = $(SHARED_OBJS) mm.o
|
|||||||
MTOBJS = $(SHARED_OBJS) mmts.o
|
MTOBJS = $(SHARED_OBJS) mmts.o
|
||||||
GBACK_IMPL_OBJS = $(SHARED_OBJS) mm-gback-implicit.o
|
GBACK_IMPL_OBJS = $(SHARED_OBJS) mm-gback-implicit.o
|
||||||
|
|
||||||
all: mdriver
|
# Variables used for instrumentation purposes
|
||||||
|
INST_BUILD_LOC = /home/courses/cs3214/bin/heap-visualizer/processing/build
|
||||||
|
CLANGFLAGS = -O3 -ggdb3 -emit-llvm -c -fPIC
|
||||||
|
LLCFLAGS = --relocation-model=pic -O3 -filetype=obj
|
||||||
|
|
||||||
|
all: mdriver libMallocInstrumented.so
|
||||||
|
|
||||||
mdriver: $(OBJS)
|
mdriver: $(OBJS)
|
||||||
$(CC) $(CFLAGS) -o mdriver $(OBJS)
|
$(CC) $(CFLAGS) -o mdriver $(OBJS)
|
||||||
|
|
||||||
minstrumented:
|
libMallocInstrumented.so: mm.c
|
||||||
clang -O3 -ggdb3 -emit-llvm mm.c -c -fPIC -o mm.bc
|
clang $(CLANGFLAGS) mm.c -o mm.bc
|
||||||
LD_LIBRARY_PATH=$(INST_BUILD_LOC)/lib opt -load libLLVMMallocInjectorPass.so -mallocinjector mm.bc -o mm-instrumented.bc
|
LD_LIBRARY_PATH=$(INST_BUILD_LOC)/lib opt -load libLLVMMallocInjectorPass.so -mallocinjector mm.bc -o mm-instrumented.bc
|
||||||
llc --relocation-model=pic -O3 -filetype=obj mm-instrumented.bc -o mm-instrumented.o
|
llc $(LLCFLAGS) mm-instrumented.bc -o mm-instrumented.o
|
||||||
clang -shared mm-instrumented.o $(INST_BUILD_LOC)/build-instrumentation/list-instrumented.o -o libMallocInstrumented.so
|
clang -shared mm-instrumented.o $(INST_BUILD_LOC)/build-instrumentation/list-instrumented.o -o libMallocInstrumented.so
|
||||||
|
|
||||||
# if multi-threaded implementation is attempted
|
# if multi-threaded implementation is attempted
|
||||||
@ -54,6 +56,6 @@ handin:
|
|||||||
/home/courses/cs3214/bin/submit.py p3 mm.c
|
/home/courses/cs3214/bin/submit.py p3 mm.c
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *~ *.o *.so *.bc mdriver libMallocInstrumented.so
|
rm -f *~ *.o *.so *.bc debug.txt mdriver libMallocInstrumented.so
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user