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 | ## |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 15 | |
Denis 'GNUtoo' Carikli | c2b5108 | 2015-11-11 05:40:11 +0100 | [diff] [blame] | 16 | PROGRAM = cbmem |
| 17 | ROOT = ../../src |
| 18 | CC ?= $(CROSS_COMPILE)gcc |
| 19 | INSTALL ?= /usr/bin/install |
| 20 | PREFIX ?= /usr/local |
| 21 | CFLAGS ?= -O2 |
| 22 | CFLAGS += -Wall -Werror |
Aaron Durbin | dc9f5cd | 2015-09-08 13:34:43 -0500 | [diff] [blame] | 23 | CPPFLAGS += -I $(ROOT)/commonlib/include |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 24 | |
| 25 | OBJS = $(PROGRAM).o |
| 26 | |
Vadim Bendebury | 7c6b6bb | 2012-10-19 10:57:18 -0700 | [diff] [blame] | 27 | all: $(PROGRAM) |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 28 | |
| 29 | $(PROGRAM): $(OBJS) |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 30 | |
| 31 | clean: |
Martin Roth | 0be83c0 | 2015-10-21 14:50:00 -0600 | [diff] [blame] | 32 | rm -f $(PROGRAM) *.o *~ junit.xml |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 33 | |
Denis 'GNUtoo' Carikli | c2b5108 | 2015-11-11 05:40:11 +0100 | [diff] [blame] | 34 | install: $(PROGRAM) |
| 35 | $(INSTALL) -d $(DESTDIR)$(PREFIX)/sbin/ |
| 36 | $(INSTALL) cbmem $(DESTDIR)$(PREFIX)/sbin/ |
| 37 | |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 38 | distclean: clean |
| 39 | rm -f .dependencies |
| 40 | |
Vadim Bendebury | 7c6b6bb | 2012-10-19 10:57:18 -0700 | [diff] [blame] | 41 | .dependencies: |
Stefan Tauner | e978fc2 | 2013-06-30 01:05:30 +0200 | [diff] [blame] | 42 | @$(CC) $(CFLAGS) $(CPPFLAGS) -MM *.c > .dependencies |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 43 | |
Vadim Bendebury | 7c6b6bb | 2012-10-19 10:57:18 -0700 | [diff] [blame] | 44 | .PHONY: all clean distclean |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 45 | |
| 46 | -include .dependencies |
Paul Menzel | 8ebc72c | 2014-01-04 12:19:18 +0100 | [diff] [blame] | 47 | |