cbmem: Makefile: Add install target
[coreboot.git] / util / cbmem / Makefile
blobef45bed0417162d4ac5c012d8ba77f764334b61b
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.
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
23 CPPFLAGS += -I $(ROOT)/commonlib/include
25 OBJS = $(PROGRAM).o
27 all: $(PROGRAM)
29 $(PROGRAM): $(OBJS)
31 clean:
32 rm -f $(PROGRAM) *.o *~ junit.xml
34 install: $(PROGRAM)
35 $(INSTALL) -d $(DESTDIR)$(PREFIX)/sbin/
36 $(INSTALL) cbmem $(DESTDIR)$(PREFIX)/sbin/
38 distclean: clean
39 rm -f .dependencies
41 .dependencies:
42 @$(CC) $(CFLAGS) $(CPPFLAGS) -MM *.c > .dependencies
44 .PHONY: all clean distclean
46 -include .dependencies