Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 1 | ## |
| 2 | ## This file is part of the coreboot project. |
| 3 | ## |
| 4 | ## Copyright (C) 2012 The ChromiumOS Authors. All rights reserved. |
| 5 | ## |
| 6 | ## This program is free software; you can redistribute it and/or modify |
| 7 | ## it under the terms of the GNU General Public License as published by |
| 8 | ## the Free Software Foundation; version 2 of the License. |
| 9 | ## |
| 10 | ## This program is distributed in the hope that it will be useful, |
| 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | ## GNU General Public License for more details. |
| 14 | ## |
| 15 | ## You should have received a copy of the GNU General Public License |
| 16 | ## along with this program; if not, write to the Free Software |
| 17 | ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | ## |
| 19 | |
| 20 | PROGRAM = cbmem |
| 21 | ROOT = ../../src |
Paul Menzel | c3fc1e0 | 2013-04-05 11:39:42 +0200 | [diff] [blame] | 22 | CC ?= $(CROSS_COMPILE)gcc |
Vadim Bendebury | 7c6b6bb | 2012-10-19 10:57:18 -0700 | [diff] [blame] | 23 | CFLAGS ?= -O2 |
| 24 | CFLAGS += -Wall -Werror |
| 25 | CPPFLAGS += -iquote $(ROOT)/include -iquote $(ROOT)/src/arch/x86 |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 26 | |
| 27 | OBJS = $(PROGRAM).o |
| 28 | |
Vadim Bendebury | 7c6b6bb | 2012-10-19 10:57:18 -0700 | [diff] [blame] | 29 | all: $(PROGRAM) |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 30 | |
| 31 | $(PROGRAM): $(OBJS) |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 32 | |
| 33 | clean: |
| 34 | rm -f $(PROGRAM) *.o *~ |
| 35 | |
| 36 | distclean: clean |
| 37 | rm -f .dependencies |
| 38 | |
Vadim Bendebury | 7c6b6bb | 2012-10-19 10:57:18 -0700 | [diff] [blame] | 39 | .dependencies: |
Stefan Tauner | e978fc2 | 2013-06-30 01:05:30 +0200 | [diff] [blame] | 40 | @$(CC) $(CFLAGS) $(CPPFLAGS) -MM *.c > .dependencies |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 41 | |
Vadim Bendebury | 7c6b6bb | 2012-10-19 10:57:18 -0700 | [diff] [blame] | 42 | .PHONY: all clean distclean |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 43 | |
| 44 | -include .dependencies |
Paul Menzel | 8ebc72c | 2014-01-04 12:19:18 +0100 | [diff] [blame] | 45 | |
| 46 | junit.xml: |
| 47 | echo '<?xml version="1.0" encoding="utf-8"?><testsuite>' > $@.tmp |
| 48 | $(MAKE) clean; \ |
| 49 | echo "<testcase classname='cbmem' name='cbmem'>" >> $@.tmp; \ |
| 50 | $(MAKE) >> $@.tmp.2 2>&1 && type="system-out" || type="failure"; \ |
| 51 | if [ $$type = "failure" ]; then \ |
| 52 | echo "<failure type='buildFailed'>" >> $@.tmp; \ |
| 53 | else \ |
| 54 | echo "<$$type>" >> $@.tmp; \ |
| 55 | fi; \ |
| 56 | echo '<![CDATA[' >> $@.tmp; \ |
| 57 | cat $@.tmp.2 >> $@.tmp; \ |
| 58 | echo "]]></$$type>" >>$@.tmp; \ |
| 59 | rm -f $@.tmp.2; \ |
| 60 | echo "</testcase>" >> $@.tmp; \ |
| 61 | echo "</testsuite>" >> $@.tmp |
| 62 | mv $@.tmp $@ |