113372Sgabeblack@google.com# Copyright (c) 2012-2014 ARM Limited
213372Sgabeblack@google.com# All rights reserved
313372Sgabeblack@google.com#
413372Sgabeblack@google.com# The license below extends only to copyright in the software and shall
513372Sgabeblack@google.com# not be construed as granting a license to any other intellectual
613372Sgabeblack@google.com# property including but not limited to intellectual property relating
713372Sgabeblack@google.com# to a hardware implementation of the functionality of the software
813372Sgabeblack@google.com# licensed hereunder.  You may use the software subject to the license
913372Sgabeblack@google.com# terms below provided that you ensure that this notice is replicated
1013372Sgabeblack@google.com# unmodified and in its entirety in all distributions of the software,
1113372Sgabeblack@google.com# modified or unmodified, in source code or in binary form.
1213372Sgabeblack@google.com#
1313372Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without
1413372Sgabeblack@google.com# modification, are permitted provided that the following conditions are
1513372Sgabeblack@google.com# met: redistributions of source code must retain the above copyright
1613372Sgabeblack@google.com# notice, this list of conditions and the following disclaimer;
1713372Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright
1813372Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the
1913372Sgabeblack@google.com# documentation and/or other materials provided with the distribution;
2013372Sgabeblack@google.com# neither the name of the copyright holders nor the names of its
2113372Sgabeblack@google.com# contributors may be used to endorse or promote products derived from
2213372Sgabeblack@google.com# this software without specific prior written permission.
2313372Sgabeblack@google.com#
2413372Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2513372Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2613372Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2713372Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2813372Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2913372Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3013372Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3113372Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3213372Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3313372Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3413372Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3513372Sgabeblack@google.com#
3613372Sgabeblack@google.com# Authors: Andrew Bardsley
3713372Sgabeblack@google.com
3813372Sgabeblack@google.comARCH = ARM
3913372Sgabeblack@google.comVARIANT = opt
4013372Sgabeblack@google.com
4113372Sgabeblack@google.comSYSTEMC_INC = ./systemc/include
4213372Sgabeblack@google.comSYSTEMC_LIB = ./systemc/lib-linux64
4313372Sgabeblack@google.com
4413372Sgabeblack@google.comCXXFLAGS = -I../../../build/$(ARCH) -L../../../build/$(ARCH)
4513372Sgabeblack@google.comCXXFLAGS += -I$(SYSTEMC_INC) -L$(SYSTEMC_LIB)
4613372Sgabeblack@google.comCXXFLAGS += -std=c++0x
4713372Sgabeblack@google.comCXXFLAGS += -g
4813372Sgabeblack@google.comLIBS = -lgem5_$(VARIANT) -lsystemc
4913372Sgabeblack@google.com
5013372Sgabeblack@google.comALL = gem5.$(VARIANT).sc
5113372Sgabeblack@google.com
5213372Sgabeblack@google.comall: $(ALL)
5313372Sgabeblack@google.com
5413372Sgabeblack@google.com.cc.o:
5513372Sgabeblack@google.com	$(CXX) $(CXXFLAGS) -c -o $@ $<
5613372Sgabeblack@google.com
5713372Sgabeblack@google.comsc_gem5_control.o: sc_gem5_control.cc sc_gem5_control.hh
5813372Sgabeblack@google.comsc_logger.o: sc_logger.cc sc_logger.hh
5913372Sgabeblack@google.comsc_module.o: sc_module.cc sc_module.hh
6013372Sgabeblack@google.comstats.o: stats.cc stats.hh
6113372Sgabeblack@google.commain.o: main.cc sc_logger.hh sc_module.hh stats.hh
6213372Sgabeblack@google.com
6313372Sgabeblack@google.comgem5.$(VARIANT).sc: main.o stats.o \
6413372Sgabeblack@google.com	sc_gem5_control.o sc_logger.o sc_module.o
6513372Sgabeblack@google.com	$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
6613372Sgabeblack@google.com
6713372Sgabeblack@google.comclean:
6813372Sgabeblack@google.com	$(RM) $(ALL)
6913372Sgabeblack@google.com	$(RM) *.o
7013372Sgabeblack@google.com	$(RM) -r m5out
71