Makefile.x86 revision 13780
111986Sandreas.sandberg@arm.com# Copyright (c) 2005-2006 The Regents of The University of Michigan
211986Sandreas.sandberg@arm.com# All rights reserved.
311986Sandreas.sandberg@arm.com#
411986Sandreas.sandberg@arm.com# Redistribution and use in source and binary forms, with or without
511986Sandreas.sandberg@arm.com# modification, are permitted provided that the following conditions are
611986Sandreas.sandberg@arm.com# met: redistributions of source code must retain the above copyright
711986Sandreas.sandberg@arm.com# notice, this list of conditions and the following disclaimer;
811986Sandreas.sandberg@arm.com# redistributions in binary form must reproduce the above copyright
911986Sandreas.sandberg@arm.com# notice, this list of conditions and the following disclaimer in the
1012037Sandreas.sandberg@arm.com# documentation and/or other materials provided with the distribution;
1112037Sandreas.sandberg@arm.com# neither the name of the copyright holders nor the names of its
1212037Sandreas.sandberg@arm.com# contributors may be used to endorse or promote products derived from
1312037Sandreas.sandberg@arm.com# this software without specific prior written permission.
1412037Sandreas.sandberg@arm.com#
1512391Sjason@lowepower.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1612391Sjason@lowepower.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1712391Sjason@lowepower.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1812391Sjason@lowepower.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1912391Sjason@lowepower.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2012391Sjason@lowepower.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2111986Sandreas.sandberg@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2211986Sandreas.sandberg@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2311986Sandreas.sandberg@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2411986Sandreas.sandberg@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2511986Sandreas.sandberg@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2611986Sandreas.sandberg@arm.com#
2711986Sandreas.sandberg@arm.com# Authors: Nathan Binkert
2811986Sandreas.sandberg@arm.com#          Ali Saidi
2911986Sandreas.sandberg@arm.com
3011986Sandreas.sandberg@arm.comCC=gcc
3111986Sandreas.sandberg@arm.comAS=as
3211986Sandreas.sandberg@arm.comLD=ld
3311986Sandreas.sandberg@arm.com
3411986Sandreas.sandberg@arm.comCFLAGS?=-O2 -DM5OP_ADDR=0xFFFF0000 -I../../include
3511986Sandreas.sandberg@arm.comOBJS=m5.o m5op_x86.o m5_mmap.o
3611986Sandreas.sandberg@arm.comLUA_HEADER_INCLUDE=$(shell pkg-config --cflags-only-I lua51)
3711986Sandreas.sandberg@arm.comLUA_OBJS=lua_gem5Op.opic m5op_x86.opic m5_mmap.opic
3811986Sandreas.sandberg@arm.com
3911986Sandreas.sandberg@arm.comall: m5
4011986Sandreas.sandberg@arm.com
4114299Sbbruce@ucdavis.edu%.o: %.S
4214299Sbbruce@ucdavis.edu	$(CC) $(CFLAGS) -o $@ -c $<
4311986Sandreas.sandberg@arm.com
4412391Sjason@lowepower.com%.o: %.c
4511986Sandreas.sandberg@arm.com	$(CC) $(CFLAGS) -o $@ -c $<
4612391Sjason@lowepower.com
4712391Sjason@lowepower.com%.opic : %.S
4812391Sjason@lowepower.com	$(CC) $(CFLAGS) -fPIC -o $@ -c $<
4912391Sjason@lowepower.com
5012391Sjason@lowepower.com%.opic : %.c
5112391Sjason@lowepower.com	$(CC) $(CFLAGS) -fPIC -o $@ -c $<
5211986Sandreas.sandberg@arm.com
5312391Sjason@lowepower.comm5: $(OBJS)
5411986Sandreas.sandberg@arm.com	$(CC) -o $@ $(OBJS) -no-pie
5511986Sandreas.sandberg@arm.com
5611986Sandreas.sandberg@arm.comm5op_x86.opic: m5op_x86.S
5711986Sandreas.sandberg@arm.com	$(CC) $(CFLAGS) -DM5OP_PIC -fPIC -o $@ -c $<
5811986Sandreas.sandberg@arm.com
5911986Sandreas.sandberg@arm.comlua_gem5Op.opic: lua_gem5Op.c
6012391Sjason@lowepower.com	$(CC) $(CFLAGS) $(LUA_HEADER_INCLUDE) -fPIC -o $@ -c $<
6111986Sandreas.sandberg@arm.com
6211986Sandreas.sandberg@arm.comgem5OpLua.so: $(LUA_OBJS)
6311986Sandreas.sandberg@arm.com	$(CC) $(CFLAGS) -fPIC $^ -o $@ -shared
6411986Sandreas.sandberg@arm.com
6511986Sandreas.sandberg@arm.comclean:
6611986Sandreas.sandberg@arm.com	rm -f *.o *.opic m5 gem5OpLua.so
6711986Sandreas.sandberg@arm.com