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 |
Yegor Timoshenko | c2e4941 | 2018-10-07 01:58:27 +0000 | [diff] [blame] | 19 | INSTALL ?= /usr/bin/env install |
Denis 'GNUtoo' Carikli | c2b5108 | 2015-11-11 05:40:11 +0100 | [diff] [blame] | 20 | PREFIX ?= /usr/local |
| 21 | CFLAGS ?= -O2 |
Jacob Garber | 0476332 | 2019-06-27 17:24:37 -0600 | [diff] [blame] | 22 | CFLAGS += -Wall -Wextra -Wmissing-prototypes -Werror |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 23 | CPPFLAGS += -I . -I $(ROOT)/commonlib/include |
Idwer Vollering | 724753d | 2020-01-06 16:37:25 +0100 | [diff] [blame] | 24 | CPPFLAGS += -include commonlib/compiler.h |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 25 | |
| 26 | OBJS = $(PROGRAM).o |
| 27 | |
Vadim Bendebury | 7c6b6bb | 2012-10-19 10:57:18 -0700 | [diff] [blame] | 28 | all: $(PROGRAM) |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 29 | |
| 30 | $(PROGRAM): $(OBJS) |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 31 | |
| 32 | clean: |
Nico Huber | e3c05c4 | 2018-10-04 23:45:54 +0200 | [diff] [blame] | 33 | rm -f $(PROGRAM) *.o .dependencies *~ junit.xml |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 34 | |
Denis 'GNUtoo' Carikli | c2b5108 | 2015-11-11 05:40:11 +0100 | [diff] [blame] | 35 | install: $(PROGRAM) |
| 36 | $(INSTALL) -d $(DESTDIR)$(PREFIX)/sbin/ |
| 37 | $(INSTALL) cbmem $(DESTDIR)$(PREFIX)/sbin/ |
| 38 | |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 39 | distclean: clean |
Vadim Bendebury | 6d18fd0 | 2012-09-27 19:24:07 -0700 | [diff] [blame] | 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 |