Makefile.arm (12157:c27b548bad70) Makefile.arm (12464:a02f2484c710)
1# Copyright (c) 2010 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 44 unchanged lines hidden (view full) ---

53JR=jar
54### JDK_PATH must be set to build gem5OpJni
55#JDK_PATH=/path/to/jdk/version_number
56
57CFLAGS=-O2 -I $(JDK_PATH)/include/ -I $(JDK_PATH)/include/linux \
58 -I$(PWD)/../../include -march=armv7-a
59LDFLAGS=-L. -lm5 -static
60
1# Copyright (c) 2010 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 44 unchanged lines hidden (view full) ---

53JR=jar
54### JDK_PATH must be set to build gem5OpJni
55#JDK_PATH=/path/to/jdk/version_number
56
57CFLAGS=-O2 -I $(JDK_PATH)/include/ -I $(JDK_PATH)/include/linux \
58 -I$(PWD)/../../include -march=armv7-a
59LDFLAGS=-L. -lm5 -static
60
61LIB_OBJS=m5op_arm.o
61LIB_OBJS=m5op_arm.o m5_mmap.o
62OBJS=m5.o
63JNI_OBJS=m5op_arm.o jni_gem5Op.o
62OBJS=m5.o
63JNI_OBJS=m5op_arm.o jni_gem5Op.o
64LUA_OBJS=lua_gem5Op.o m5op_arm.o m5_mmap.o
64
65
66### Need to install lua5.1 library to compile gem5OpLua.so
67LUA_HEADER_INCLUDE=$(shell pkg-config --cflags lua51) \
68 -I/usr/include/x86_64-linux-gnu
69
65all: libm5.a m5
66
67%.o: %.S
68 $(CC) $(CFLAGS) -o $@ -c $<
69
70%.o: %.c
71 $(CC) $(CFLAGS) -o $@ -c $<
72
73m5: $(OBJS) libm5.a
70all: libm5.a m5
71
72%.o: %.S
73 $(CC) $(CFLAGS) -o $@ -c $<
74
75%.o: %.c
76 $(CC) $(CFLAGS) -o $@ -c $<
77
78m5: $(OBJS) libm5.a
74 $(CC) -o $@ $(OBJS) $(LDFLAGS)
79 $(CC) -o $@ $^ $(LDFLAGS)
75
76libm5.a: $(LIB_OBJS)
80
81libm5.a: $(LIB_OBJS)
77 $(AR) rcs $@ $<
82 $(AR) rcs $@ $^
78
79gem5OpJni: gem5OpJni.jar $(JNI_OBJS)
80 $(CC) --shared -o lib$@.so $(JNI_OBJS)
81
82gem5OpJni.jar:
83 $(JC) jni/gem5Op.java; \
84 $(JH) jni.gem5Op; \
85 $(JR) cvf $@ jni/*.class
86
83
84gem5OpJni: gem5OpJni.jar $(JNI_OBJS)
85 $(CC) --shared -o lib$@.so $(JNI_OBJS)
86
87gem5OpJni.jar:
88 $(JC) jni/gem5Op.java; \
89 $(JH) jni.gem5Op; \
90 $(JR) cvf $@ jni/*.class
91
92lua_gem5Op.o: lua_gem5Op.c
93 $(CC) $(CFLAGS) $(LUA_HEADER_INCLUDE) -o $@ -c $< -fPIC
94
95gem5OpLua.so: $(LUA_OBJS)
96 $(CC) $(CFLAGS) $^ -o $@ -shared
97
87clean:
88 rm -f *.o m5 libgem5OpJni.so gem5OpJni.jar jni/*.class libm5.a \
98clean:
99 rm -f *.o m5 libgem5OpJni.so gem5OpJni.jar jni/*.class libm5.a \
89 jni_gem5Op.h
100 jni_gem5Op.h gem5OpLua.so