blob: 55a4e10402f63b652c8d3c78d95ebe001fbec5db [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
Yegor Timoshenkoc2e49412018-10-07 01:58:27 +000019INSTALL ?= /usr/bin/env install
Denis 'GNUtoo' Cariklic2b51082015-11-11 05:40:11 +010020PREFIX ?= /usr/local
21CFLAGS ?= -O2
Jacob Garber04763322019-06-27 17:24:37 -060022CFLAGS += -Wall -Wextra -Wmissing-prototypes -Werror
Stefan Reinauer6a001132017-07-13 02:20:27 +020023CPPFLAGS += -I . -I $(ROOT)/commonlib/include
Idwer Vollering724753d2020-01-06 16:37:25 +010024CPPFLAGS += -include commonlib/compiler.h
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070025
26OBJS = $(PROGRAM).o
27
Vadim Bendebury7c6b6bb2012-10-19 10:57:18 -070028all: $(PROGRAM)
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070029
30$(PROGRAM): $(OBJS)
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070031
32clean:
Nico Hubere3c05c42018-10-04 23:45:54 +020033 rm -f $(PROGRAM) *.o .dependencies *~ junit.xml
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070034
Denis 'GNUtoo' Cariklic2b51082015-11-11 05:40:11 +010035install: $(PROGRAM)
36 $(INSTALL) -d $(DESTDIR)$(PREFIX)/sbin/
37 $(INSTALL) cbmem $(DESTDIR)$(PREFIX)/sbin/
38
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070039distclean: clean
Vadim Bendebury6d18fd02012-09-27 19:24:07 -070040
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