summaryrefslogtreecommitdiff
path: root/util/m5/Makefile.arm
diff options
context:
space:
mode:
authorJames Clarkson <james.clarkson@arm.com>2012-10-09 12:58:25 +0100
committerJames Clarkson <james.clarkson@arm.com>2012-10-09 12:58:25 +0100
commitfdcfbda38d02097720a3215422ee2fc2018b61f7 (patch)
tree2e5bdac22bd0d6b51f0e219da6da9eff4d39ba28 /util/m5/Makefile.arm
parent81406018b0688e956452cd3e00c1ab9aeb9af764 (diff)
downloadgem5-fdcfbda38d02097720a3215422ee2fc2018b61f7.tar.xz
m5: Expose m5 pseudo-instructions to C/C++ via a static library
Updated the util/m5/Makefile.arm so that m5op_arm.S is used to create a static library - libm5.a. Allowing users to insert m5 psuedo-instructions into their applications for fine-grained checkpointing, switching cpus or dumping statistics. e.g. #include <m5op.h> void foo(){ ... m5_reset_stats(<delay>,<period>) m5_work_begin(<workid>,<threadid>); ... m5_work_end(<workid>,<threadid>); m5_dump_stats(<delay>,<period>); }
Diffstat (limited to 'util/m5/Makefile.arm')
-rw-r--r--util/m5/Makefile.arm14
1 files changed, 10 insertions, 4 deletions
diff --git a/util/m5/Makefile.arm b/util/m5/Makefile.arm
index 0e05b028a..a90dc1011 100644
--- a/util/m5/Makefile.arm
+++ b/util/m5/Makefile.arm
@@ -46,6 +46,7 @@ endif
CC=$(CROSS_COMPILE)gcc
AS=$(CROSS_COMPILE)as
LD=$(CROSS_COMPILE)ld
+AR=$(CROSS_COMPILE)ar
JC=javac
JH=javah
@@ -54,11 +55,13 @@ JR=jar
#JDK_PATH=/path/to/jdk/version_number
CFLAGS=-O2 -I $(JDK_PATH)/include/ -I $(JDK_PATH)/include/linux
+LDFLAGS=-L. -lm5
-OBJS=m5.o m5op_arm.o
+LIB_OBJS=m5op_arm.o
+OBJS=m5.o
JNI_OBJS=m5op_arm.o jni_gem5Op.o
-all: m5
+all: libm5.a m5
%.o: %.S
$(CC) $(CFLAGS) -o $@ -c $<
@@ -67,7 +70,10 @@ all: m5
$(CC) $(CFLAGS) -o $@ -c $<
m5: $(OBJS)
- $(CC) -o $@ $(OBJS)
+ $(CC) -o $@ $(OBJS) $(LDFLAGS)
+
+libm5.a: $(LIB_OBJS)
+ $(AR) rcs $@ $<
gem5OpJni: gem5OpJni.jar $(JNI_OBJS)
$(CC) --shared -o lib$@.so $(JNI_OBJS)
@@ -78,4 +84,4 @@ gem5OpJni.jar:
$(JR) cvf $@ jni/*.class
clean:
- rm -f *.o m5 libgemOpJni.so gem5OpJni.jar jni/*.class
+ rm -f *.o m5 libgemOpJni.so gem5OpJni.jar jni/*.class libm5.a