summaryrefslogtreecommitdiff
path: root/util/m5/Makefile.x86
diff options
context:
space:
mode:
Diffstat (limited to 'util/m5/Makefile.x86')
-rw-r--r--util/m5/Makefile.x8623
1 files changed, 20 insertions, 3 deletions
diff --git a/util/m5/Makefile.x86 b/util/m5/Makefile.x86
index 5ea29ccaa..890e4b151 100644
--- a/util/m5/Makefile.x86
+++ b/util/m5/Makefile.x86
@@ -32,7 +32,9 @@ AS=as
LD=ld
CFLAGS=-O2 -DM5OP_ADDR=0xFFFF0000 -I$(PWD)/../../include
-OBJS=m5.o m5op_x86.o
+OBJS=m5.o m5op_x86.o m5_mmap.o
+LUA_HEADER_INCLUDE=$(shell pkg-config --cflags-only-I lua51)
+LUA_OBJS=lua_gem5Op.opic m5op_x86.opic m5_mmap.opic
all: m5
@@ -40,10 +42,25 @@ all: m5
$(CC) $(CFLAGS) -o $@ -c $<
%.o: %.c
- $(CC) $(CFLAGS) -o $@ -c $<
+ $(CC) $(CFLAGS) -o $@ -c $<
+
+%.opic : %.S
+ $(CC) $(CFLAGS) -fPIC -o $@ -c $<
+
+%.opic : %.c
+ $(CC) $(CFLAGS) -fPIC -o $@ -c $<
m5: $(OBJS)
$(CC) -o $@ $(OBJS)
+m5op_x86.opic: m5op_x86.S
+ $(CC) $(CFLAGS) -DM5OP_PIC -fPIC -o $@ -c $<
+
+lua_gem5Op.opic: lua_gem5Op.c
+ $(CC) $(CFLAGS) $(LUA_HEADER_INCLUDE) -fPIC -o $@ -c $<
+
+gem5OpLua.so: $(LUA_OBJS)
+ $(CC) $(CFLAGS) -fPIC $^ -o $@ -shared
+
clean:
- rm -f *.o m5
+ rm -f *.o *.opic m5 gem5OpLua.so