Since some people disapprove of white space cleanups mixed in regular commits
[coreboot.git] / util / nvramtool / Makefile
1 #
2 # Makefile for nvram utility
3 #
4 # (C) 2005-2008 coresystems GmbH
5 # written by Stefan Reinauer <stepan@coresystems.de>
6 #
7
8 PROGRAM = nvramtool
9
10 CC      = gcc
11 STRIP   = strip
12 INSTALL = /usr/bin/install
13 PREFIX  = /usr/local
14 CFLAGS  = -O2 -g -Wall -W
15 #CFLAGS  = -Os -Wall
16
17 OBJS =  cmos_lowlevel.o cmos_ops.o common.o compute_ip_checksum.o \
18         hexdump.o input_file.o layout.o layout_file.o lbtable.o   \
19         nvramtool.o opts.o reg_expr.o
20
21 OS_ARCH        = $(shell uname)
22 ifeq ($(OS_ARCH), Darwin)
23 LDFLAGS = -framework DirectIO
24 endif
25
26 all: dep $(PROGRAM)
27
28 $(PROGRAM): $(OBJS)
29         $(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS)
30         $(STRIP) $(STRIP_ARGS) $(PROGRAM)
31
32 clean:
33         rm -f $(PROGRAM) *.o
34
35 distclean: clean
36         rm -f .dependencies
37
38 dep:
39         @$(CC) -MM *.c > .dependencies
40
41 install: $(PROGRAM)
42         mkdir -p $(DESTDIR)$(PREFIX)/sbin
43         $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin
44         mkdir -p $(DESTDIR)$(PREFIX)/share/man/man8
45         $(INSTALL) $(PROGRAM).8 $(DESTDIR)$(PREFIX)/share/man/man8
46
47 .PHONY: all clean distclean dep
48
49 -include .dependencies