blob: 91bb0456fbf712856a90c41ad91ea41cdf1b7e9a [file] [log] [blame]
Vadim Bendebury6d18fd02012-09-27 19:24:07 -07001##
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
Patrick Georgib890a122015-03-26 15:17:45 +010017## Foundation, Inc.
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070018##
19
20PROGRAM = cbmem
21ROOT = ../../src
Paul Menzelc3fc1e02013-04-05 11:39:42 +020022CC ?= $(CROSS_COMPILE)gcc
Vadim Bendebury7c6b6bb2012-10-19 10:57:18 -070023CFLAGS ?= -O2
24CFLAGS += -Wall -Werror
Aaron Durbindc9f5cd2015-09-08 13:34:43 -050025CPPFLAGS += -I $(ROOT)/commonlib/include
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070026
27OBJS = $(PROGRAM).o
28
Vadim Bendebury7c6b6bb2012-10-19 10:57:18 -070029all: $(PROGRAM)
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070030
31$(PROGRAM): $(OBJS)
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070032
33clean:
34 rm -f $(PROGRAM) *.o *~
35
36distclean: clean
37 rm -f .dependencies
38
Vadim Bendebury7c6b6bb2012-10-19 10:57:18 -070039.dependencies:
Stefan Taunere978fc22013-06-30 01:05:30 +020040 @$(CC) $(CFLAGS) $(CPPFLAGS) -MM *.c > .dependencies
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070041
Vadim Bendebury7c6b6bb2012-10-19 10:57:18 -070042.PHONY: all clean distclean
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070043
44-include .dependencies
Paul Menzel8ebc72c2014-01-04 12:19:18 +010045
46junit.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 $@