Makefile revision 12266
16019Shines@cs.fsu.edu# Copyright (c) 2012-2014, TU Delft
27091Sgblack@eecs.umich.edu# Copyright (c) 2012-2014, TU Eindhoven
37091Sgblack@eecs.umich.edu# Copyright (c) 2012-2014, TU Kaiserslautern
47091Sgblack@eecs.umich.edu# All rights reserved.
57091Sgblack@eecs.umich.edu#
67091Sgblack@eecs.umich.edu# Redistribution and use in source and binary forms, with or without
77091Sgblack@eecs.umich.edu# modification, are permitted provided that the following conditions are
87091Sgblack@eecs.umich.edu# met:
97091Sgblack@eecs.umich.edu#
107091Sgblack@eecs.umich.edu# 1. Redistributions of source code must retain the above copyright
117091Sgblack@eecs.umich.edu# notice, this list of conditions and the following disclaimer.
127091Sgblack@eecs.umich.edu#
137091Sgblack@eecs.umich.edu# 2. Redistributions in binary form must reproduce the above copyright
146019Shines@cs.fsu.edu# notice, this list of conditions and the following disclaimer in the
156019Shines@cs.fsu.edu# documentation and/or other materials provided with the distribution.
166019Shines@cs.fsu.edu#
176019Shines@cs.fsu.edu# 3. Neither the name of the copyright holder nor the names of its
186019Shines@cs.fsu.edu# contributors may be used to endorse or promote products derived from
196019Shines@cs.fsu.edu# this software without specific prior written permission.
206019Shines@cs.fsu.edu#
216019Shines@cs.fsu.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
226019Shines@cs.fsu.edu# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
236019Shines@cs.fsu.edu# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
246019Shines@cs.fsu.edu# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
256019Shines@cs.fsu.edu# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
266019Shines@cs.fsu.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
276019Shines@cs.fsu.edu# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
286019Shines@cs.fsu.edu# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
296019Shines@cs.fsu.edu# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
306019Shines@cs.fsu.edu# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
316019Shines@cs.fsu.edu# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
326019Shines@cs.fsu.edu#
336019Shines@cs.fsu.edu# Authors: Matthias Jung, Omar Naji, Sven Goossens
346019Shines@cs.fsu.edu#
356019Shines@cs.fsu.edu
366019Shines@cs.fsu.eduifeq ($(COVERAGE),1)
376019Shines@cs.fsu.edu	GCOVFLAGS := -fprofile-arcs -ftest-coverage
386019Shines@cs.fsu.eduelse
396019Shines@cs.fsu.edu	GCOVFLAGS :=
406019Shines@cs.fsu.eduendif
416019Shines@cs.fsu.edu
426019Shines@cs.fsu.edu# Optimization flags. Usually you should not optimize until you have finished
436019Shines@cs.fsu.edu# debugging, except when you want to detect dead code.
446019Shines@cs.fsu.eduOPTCXXFLAGS ?=
456019Shines@cs.fsu.edu
466019Shines@cs.fsu.edu# Debugging flags.
476019Shines@cs.fsu.eduDBGCXXFLAGS ?= -g ${GCOVFLAGS}
486019Shines@cs.fsu.edu
496019Shines@cs.fsu.edu# Common warning flags shared by both C and C++.
506019Shines@cs.fsu.eduWARNFLAGS := -W -pedantic-errors -Wextra -Werror \
516019Shines@cs.fsu.edu             -Wformat -Wformat-nonliteral -Wpointer-arith \
526019Shines@cs.fsu.edu             -Wcast-align -Wconversion -Wall -Werror
536019Shines@cs.fsu.edu
546312Sgblack@eecs.umich.edu# Sum up the flags.
556312Sgblack@eecs.umich.eduCXXFLAGS := -O ${WARNFLAGS} ${DBGCXXFLAGS} ${OPTCXXFLAGS} -std=c++0x
566312Sgblack@eecs.umich.edu
576312Sgblack@eecs.umich.eduDRAMPOWER_PATH ?= ../..
586312Sgblack@eecs.umich.eduMYPATH := ${DRAMPOWER_PATH}/test/libdrampowertest
596312Sgblack@eecs.umich.eduUSE_XERCES ?= 1
606312Sgblack@eecs.umich.edu
616312Sgblack@eecs.umich.edu# Name of the generated binary.
626312Sgblack@eecs.umich.eduBINARY := ${MYPATH}/library_test
636312Sgblack@eecs.umich.eduBINARY2 := ${MYPATH}/window_example
646312Sgblack@eecs.umich.edu
656019Shines@cs.fsu.eduifeq ($(USE_XERCES),1)
666019Shines@cs.fsu.edu	LIBS := -lxerces-c -ldrampowerxml -ldrampower
676312Sgblack@eecs.umich.eduelse
686312Sgblack@eecs.umich.edu	LIBS := -ldrampower
696312Sgblack@eecs.umich.eduendif
706312Sgblack@eecs.umich.edu
716393Ssaidi@eecs.umich.eduall:
726741Sgblack@eecs.umich.edu	g++ ${MYPATH}/lib_test.cc ${CXXFLAGS} -iquote ${DRAMPOWER_PATH}/src -DUSE_XERCES=${USE_XERCES} -L${DRAMPOWER_PATH}/src/ ${LIBS} -o $(BINARY)
736019Shines@cs.fsu.edu	g++ ${MYPATH}/window_example.cc ${CXXFLAGS} -iquote ${DRAMPOWER_PATH}/src -DUSE_XERCES=${USE_XERCES} -L${DRAMPOWER_PATH}/src/ ${LIBS} -o $(BINARY2)
746299Sgblack@eecs.umich.edu
756312Sgblack@eecs.umich.educlean:
766312Sgblack@eecs.umich.edu	rm -f $(BINARY)
776299Sgblack@eecs.umich.edu	rm -f $(BINARY2)
786721Sgblack@eecs.umich.edu
796721Sgblack@eecs.umich.educoverageclean:
806721Sgblack@eecs.umich.edu	$(RM) lib_test.gcno lib_test.gcda
817091Sgblack@eecs.umich.edu
826019Shines@cs.fsu.edutest: all
836308Sgblack@eecs.umich.edu	./$(BINARY)  ${DRAMPOWER_PATH}/memspecs/MICRON_1Gb_DDR2-1066_16bit_H.xml
846312Sgblack@eecs.umich.edu	./$(BINARY2) ${DRAMPOWER_PATH}/memspecs/MICRON_1Gb_DDR2-1066_16bit_H.xml
856312Sgblack@eecs.umich.edu
866308Sgblack@eecs.umich.edu.PHONY: clean test
876019Shines@cs.fsu.edu