blob: ef45bed0417162d4ac5c012d8ba77f764334b61b [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##
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070015
Denis 'GNUtoo' Cariklic2b51082015-11-11 05:40:11 +010016PROGRAM = cbmem
17ROOT = ../../src
18CC ?= $(CROSS_COMPILE)gcc
19INSTALL ?= /usr/bin/install
20PREFIX ?= /usr/local
21CFLAGS ?= -O2
22CFLAGS += -Wall -Werror
Aaron Durbindc9f5cd2015-09-08 13:34:43 -050023CPPFLAGS += -I $(ROOT)/commonlib/include
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070024
25OBJS = $(PROGRAM).o
26
Vadim Bendebury7c6b6bb2012-10-19 10:57:18 -070027all: $(PROGRAM)
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070028
29$(PROGRAM): $(OBJS)
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070030
31clean:
Martin Roth0be83c02015-10-21 14:50:00 -060032 rm -f $(PROGRAM) *.o *~ junit.xml
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070033
Denis 'GNUtoo' Cariklic2b51082015-11-11 05:40:11 +010034install: $(PROGRAM)
35 $(INSTALL) -d $(DESTDIR)$(PREFIX)/sbin/
36 $(INSTALL) cbmem $(DESTDIR)$(PREFIX)/sbin/
37
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070038distclean: clean
39 rm -f .dependencies
40
Vadim Bendebury7c6b6bb2012-10-19 10:57:18 -070041.dependencies:
Stefan Taunere978fc22013-06-30 01:05:30 +020042 @$(CC) $(CFLAGS) $(CPPFLAGS) -MM *.c > .dependencies
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070043
Vadim Bendebury7c6b6bb2012-10-19 10:57:18 -070044.PHONY: all clean distclean
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070045
46-include .dependencies
Paul Menzel8ebc72c2014-01-04 12:19:18 +010047