msrtool: added support for Intel CPUs
[coreboot.git] / util / msrtool / Makefile.in
1 # Makefile for msrtool
2 #
3 # This file is part of msrtool.
4 #
5 # Copyright (c) 2008 Peter Stuge <peter@stuge.se>
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License version 2 as
9 # published by the Free Software Foundation.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19 #
20
21 PROGRAM = msrtool
22
23 CC      = @CC@
24 INSTALL = @INSTALL@
25 PREFIX  = @PREFIX@
26 CFLAGS  = @CFLAGS@ -fno-pic
27 LDFLAGS = @LDFLAGS@
28
29 TARGETS = geodegx2.o geodelx.o cs5536.o k8.o intel_pentium3_early.o intel_pentium3.o intel_pentium4_early.o intel_pentium4_later.o intel_core1.o intel_core2_early.o intel_core2_later.o
30 SYSTEMS = linux.o darwin.o freebsd.o
31 OBJS    = $(PROGRAM).o msrutils.o sys.o $(SYSTEMS) $(TARGETS)
32
33 all: $(PROGRAM)
34
35 $(PROGRAM): $(OBJS) Makefile.deps
36         $(CC) -o $@ $(OBJS) $(LDFLAGS)
37
38 $(PROGRAM).o: $(PROGRAM).c
39         $(CC) $(CFLAGS) -DVERSION='"@VERSION@"' -c $< -o $@
40
41 install: $(PROGRAM)
42         mkdir -p $(DESTDIR)$(PREFIX)/sbin
43         $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin
44
45 distprep: distclean Makefile.deps
46
47 clean:
48         rm -f $(PROGRAM) $(OBJS)
49
50 distclean: clean
51         rm -f Makefile
52
53 mrproper: distclean
54         rm -f Makefile.deps
55
56 dep:
57         rm -f Makefile.deps
58         $(MAKE) Makefile.deps
59
60 Makefile.deps: $(patsubst %.o,%.c,$(OBJS))
61         $(CC) -MM $^ > $@
62
63 .PHONY: all distprep clean distclean mrproper dep
64
65 -include Makefile.deps