Makefile revision 12266:63b8da9eeca4
113454Spau.cabre@metempsy.com# Copyright (c) 2012-2014, TU Delft 213454Spau.cabre@metempsy.com# Copyright (c) 2012-2014, TU Eindhoven 313454Spau.cabre@metempsy.com# Copyright (c) 2012-2014, TU Kaiserslautern 413454Spau.cabre@metempsy.com# All rights reserved. 513454Spau.cabre@metempsy.com# 613454Spau.cabre@metempsy.com# Redistribution and use in source and binary forms, with or without 713454Spau.cabre@metempsy.com# modification, are permitted provided that the following conditions are 813454Spau.cabre@metempsy.com# met: 913454Spau.cabre@metempsy.com# 1013454Spau.cabre@metempsy.com# 1. Redistributions of source code must retain the above copyright 1113454Spau.cabre@metempsy.com# notice, this list of conditions and the following disclaimer. 1213454Spau.cabre@metempsy.com# 1313454Spau.cabre@metempsy.com# 2. Redistributions in binary form must reproduce the above copyright 1413454Spau.cabre@metempsy.com# notice, this list of conditions and the following disclaimer in the 1513454Spau.cabre@metempsy.com# documentation and/or other materials provided with the distribution. 1613454Spau.cabre@metempsy.com# 1713454Spau.cabre@metempsy.com# 3. Neither the name of the copyright holder nor the names of its 1813454Spau.cabre@metempsy.com# contributors may be used to endorse or promote products derived from 1913454Spau.cabre@metempsy.com# this software without specific prior written permission. 2013454Spau.cabre@metempsy.com# 2113454Spau.cabre@metempsy.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 2213454Spau.cabre@metempsy.com# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2313454Spau.cabre@metempsy.com# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 2413454Spau.cabre@metempsy.com# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2513454Spau.cabre@metempsy.com# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2613454Spau.cabre@metempsy.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 2713454Spau.cabre@metempsy.com# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 2813454Spau.cabre@metempsy.com# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 2913454Spau.cabre@metempsy.com# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 3013454Spau.cabre@metempsy.com# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 3113454Spau.cabre@metempsy.com# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3213454Spau.cabre@metempsy.com# 3313454Spau.cabre@metempsy.com# Authors: Matthias Jung, Omar Naji, Sven Goossens 3413454Spau.cabre@metempsy.com# 3513454Spau.cabre@metempsy.com 3613454Spau.cabre@metempsy.comifeq ($(COVERAGE),1) 3713454Spau.cabre@metempsy.com GCOVFLAGS := -fprofile-arcs -ftest-coverage 3813454Spau.cabre@metempsy.comelse 3913454Spau.cabre@metempsy.com GCOVFLAGS := 4013454Spau.cabre@metempsy.comendif 4113454Spau.cabre@metempsy.com 4213454Spau.cabre@metempsy.com# Optimization flags. Usually you should not optimize until you have finished 4313454Spau.cabre@metempsy.com# debugging, except when you want to detect dead code. 4413454Spau.cabre@metempsy.comOPTCXXFLAGS ?= 4513454Spau.cabre@metempsy.com 4613454Spau.cabre@metempsy.com# Debugging flags. 4713454Spau.cabre@metempsy.comDBGCXXFLAGS ?= -g ${GCOVFLAGS} 4813454Spau.cabre@metempsy.com 4913454Spau.cabre@metempsy.com# Common warning flags shared by both C and C++. 5013626Sjairo.balart@metempsy.comWARNFLAGS := -W -pedantic-errors -Wextra -Werror \ 5113454Spau.cabre@metempsy.com -Wformat -Wformat-nonliteral -Wpointer-arith \ 5213454Spau.cabre@metempsy.com -Wcast-align -Wconversion -Wall -Werror 5313454Spau.cabre@metempsy.com 5413454Spau.cabre@metempsy.com# Sum up the flags. 5513454Spau.cabre@metempsy.comCXXFLAGS := -O ${WARNFLAGS} ${DBGCXXFLAGS} ${OPTCXXFLAGS} -std=c++0x 5613454Spau.cabre@metempsy.com 5713626Sjairo.balart@metempsy.comDRAMPOWER_PATH ?= ../.. 5813454Spau.cabre@metempsy.comMYPATH := ${DRAMPOWER_PATH}/test/libdrampowertest 5913454Spau.cabre@metempsy.comUSE_XERCES ?= 1 6013454Spau.cabre@metempsy.com 6113454Spau.cabre@metempsy.com# Name of the generated binary. 6213685Sjavier.bueno@metempsy.comBINARY := ${MYPATH}/library_test 6313454Spau.cabre@metempsy.comBINARY2 := ${MYPATH}/window_example 6413626Sjairo.balart@metempsy.com 6513626Sjairo.balart@metempsy.comifeq ($(USE_XERCES),1) 6613454Spau.cabre@metempsy.com LIBS := -lxerces-c -ldrampowerxml -ldrampower 6713454Spau.cabre@metempsy.comelse 6813454Spau.cabre@metempsy.com LIBS := -ldrampower 6913685Sjavier.bueno@metempsy.comendif 7013454Spau.cabre@metempsy.com 7113454Spau.cabre@metempsy.comall: 7213454Spau.cabre@metempsy.com g++ ${MYPATH}/lib_test.cc ${CXXFLAGS} -iquote ${DRAMPOWER_PATH}/src -DUSE_XERCES=${USE_XERCES} -L${DRAMPOWER_PATH}/src/ ${LIBS} -o $(BINARY) 7313685Sjavier.bueno@metempsy.com g++ ${MYPATH}/window_example.cc ${CXXFLAGS} -iquote ${DRAMPOWER_PATH}/src -DUSE_XERCES=${USE_XERCES} -L${DRAMPOWER_PATH}/src/ ${LIBS} -o $(BINARY2) 7413626Sjairo.balart@metempsy.com 7513454Spau.cabre@metempsy.comclean: 7613454Spau.cabre@metempsy.com rm -f $(BINARY) 7713626Sjairo.balart@metempsy.com rm -f $(BINARY2) 7813685Sjavier.bueno@metempsy.com 7913685Sjavier.bueno@metempsy.comcoverageclean: 8013454Spau.cabre@metempsy.com $(RM) lib_test.gcno lib_test.gcda 8113454Spau.cabre@metempsy.com 8213685Sjavier.bueno@metempsy.comtest: all 8313685Sjavier.bueno@metempsy.com ./$(BINARY) ${DRAMPOWER_PATH}/memspecs/MICRON_1Gb_DDR2-1066_16bit_H.xml 8413685Sjavier.bueno@metempsy.com ./$(BINARY2) ${DRAMPOWER_PATH}/memspecs/MICRON_1Gb_DDR2-1066_16bit_H.xml 8513626Sjairo.balart@metempsy.com 8613454Spau.cabre@metempsy.com.PHONY: clean test 8713454Spau.cabre@metempsy.com