Makefile revision 10428
110428Sandreas.hansson@arm.com# Copyright (c) 2012-2014, TU Delft 210428Sandreas.hansson@arm.com# Copyright (c) 2012-2014, TU Eindhoven 310428Sandreas.hansson@arm.com# Copyright (c) 2012-2014, TU Kaiserslautern 410428Sandreas.hansson@arm.com# All rights reserved. 510428Sandreas.hansson@arm.com# 610428Sandreas.hansson@arm.com# Redistribution and use in source and binary forms, with or without 710428Sandreas.hansson@arm.com# modification, are permitted provided that the following conditions are 810428Sandreas.hansson@arm.com# met: 910428Sandreas.hansson@arm.com# 1010428Sandreas.hansson@arm.com# 1. Redistributions of source code must retain the above copyright 1110428Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer. 1210428Sandreas.hansson@arm.com# 1310428Sandreas.hansson@arm.com# 2. Redistributions in binary form must reproduce the above copyright 1410428Sandreas.hansson@arm.com# notice, this list of conditions and the following disclaimer in the 1510428Sandreas.hansson@arm.com# documentation and/or other materials provided with the distribution. 1610428Sandreas.hansson@arm.com# 1710428Sandreas.hansson@arm.com# 3. Neither the name of the copyright holder nor the names of its 1810428Sandreas.hansson@arm.com# contributors may be used to endorse or promote products derived from 1910428Sandreas.hansson@arm.com# this software without specific prior written permission. 2010428Sandreas.hansson@arm.com# 2110428Sandreas.hansson@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 2210428Sandreas.hansson@arm.com# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2310428Sandreas.hansson@arm.com# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 2410428Sandreas.hansson@arm.com# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2510428Sandreas.hansson@arm.com# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2610428Sandreas.hansson@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 2710428Sandreas.hansson@arm.com# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 2810428Sandreas.hansson@arm.com# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 2910428Sandreas.hansson@arm.com# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 3010428Sandreas.hansson@arm.com# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 3110428Sandreas.hansson@arm.com# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3210428Sandreas.hansson@arm.com# 3310428Sandreas.hansson@arm.com# Authors: Matthias Jung, Omar Naji, Sven Goossens 3410428Sandreas.hansson@arm.com# 3510428Sandreas.hansson@arm.com 3610428Sandreas.hansson@arm.comifeq ($(COVERAGE),1) 3710428Sandreas.hansson@arm.com GCOVFLAGS := -fprofile-arcs -ftest-coverage 3810428Sandreas.hansson@arm.comelse 3910428Sandreas.hansson@arm.com GCOVFLAGS := 4010428Sandreas.hansson@arm.comendif 4110428Sandreas.hansson@arm.com 4210428Sandreas.hansson@arm.com# Optimization flags. Usually you should not optimize until you have finished 4310428Sandreas.hansson@arm.com# debugging, except when you want to detect dead code. 4410428Sandreas.hansson@arm.comOPTCXXFLAGS ?= 4510428Sandreas.hansson@arm.com 4610428Sandreas.hansson@arm.com# Debugging flags. 4710428Sandreas.hansson@arm.comDBGCXXFLAGS ?= -g ${GCOVFLAGS} 4810428Sandreas.hansson@arm.com 4910428Sandreas.hansson@arm.com# Common warning flags shared by both C and C++. 5010428Sandreas.hansson@arm.comWARNFLAGS := -W -pedantic-errors -Wextra -Werror \ 5110428Sandreas.hansson@arm.com -Wformat -Wformat-nonliteral -Wpointer-arith \ 5210428Sandreas.hansson@arm.com -Wcast-align -Wconversion -Wall -Werror 5310428Sandreas.hansson@arm.com 5410428Sandreas.hansson@arm.com# Sum up the flags. 5510428Sandreas.hansson@arm.comCXXFLAGS := -O ${WARNFLAGS} ${DBGCXXFLAGS} ${OPTCXXFLAGS} -std=c++98 5610428Sandreas.hansson@arm.com 5710428Sandreas.hansson@arm.comDRAMPOWER_PATH ?= ../.. 5810428Sandreas.hansson@arm.comMYPATH := ${DRAMPOWER_PATH}/test/libdrampowertest 5910428Sandreas.hansson@arm.comUSE_XERCES ?= 1 6010428Sandreas.hansson@arm.com 6110428Sandreas.hansson@arm.com# Name of the generated binary. 6210428Sandreas.hansson@arm.comBINARY := ${MYPATH}/library_test 6310428Sandreas.hansson@arm.com 6410428Sandreas.hansson@arm.comifeq ($(USE_XERCES),1) 6510428Sandreas.hansson@arm.com LIBS := -lxerces-c -ldrampowerxml -ldrampower 6610428Sandreas.hansson@arm.comelse 6710428Sandreas.hansson@arm.com LIBS := -ldrampower 6810428Sandreas.hansson@arm.comendif 6910428Sandreas.hansson@arm.com 7010428Sandreas.hansson@arm.comall: 7110428Sandreas.hansson@arm.com g++ ${MYPATH}/lib_test.cc ${CXXFLAGS} -iquote ${DRAMPOWER_PATH}/src -DUSE_XERCES=${USE_XERCES} -L${DRAMPOWER_PATH}/src/ ${LIBS} -o $(BINARY) 7210428Sandreas.hansson@arm.com 7310428Sandreas.hansson@arm.comclean: 7410428Sandreas.hansson@arm.com rm -f $(BINARY) 7510428Sandreas.hansson@arm.com 7610428Sandreas.hansson@arm.comcoverageclean: 7710428Sandreas.hansson@arm.com $(RM) lib_test.gcno lib_test.gcda 7810428Sandreas.hansson@arm.com 7910428Sandreas.hansson@arm.comtest: all 8010428Sandreas.hansson@arm.com ./$(BINARY) ${DRAMPOWER_PATH}/memspecs/MICRON_1Gb_DDR2-1066_16bit_H.xml 8110428Sandreas.hansson@arm.com 8210428Sandreas.hansson@arm.com.PHONY: clean test 83