blob: bf9012e22b42d83824a92427bc05f0b16ceb6dc4 [file] [log] [blame]
Peter Stugedad1e302008-11-22 17:13:36 +00001# 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
21PROGRAM = msrtool
22
23CC = @CC@
24INSTALL = @INSTALL@
25PREFIX = @PREFIX@
Anton Kochkov7c634ae2011-06-20 23:14:22 +040026CFLAGS = @CFLAGS@ -fno-pic
Peter Stugedad1e302008-11-22 17:13:36 +000027LDFLAGS = @LDFLAGS@
28
Anton Kochkov7c634ae2011-06-20 23:14:22 +040029TARGETS = 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
Andriy Gapond80e57c2009-11-28 05:21:42 +000030SYSTEMS = linux.o darwin.o freebsd.o
Peter Stugedad1e302008-11-22 17:13:36 +000031OBJS = $(PROGRAM).o msrutils.o sys.o $(SYSTEMS) $(TARGETS)
32
33all: $(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
41install: $(PROGRAM)
Stefan Reinauer37f39352009-09-01 10:03:01 +000042 mkdir -p $(DESTDIR)$(PREFIX)/sbin
43 $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin
Peter Stugedad1e302008-11-22 17:13:36 +000044
45distprep: distclean Makefile.deps
46
47clean:
48 rm -f $(PROGRAM) $(OBJS)
49
50distclean: clean
51 rm -f Makefile
52
53mrproper: distclean
54 rm -f Makefile.deps
55
56dep:
57 rm -f Makefile.deps
58 $(MAKE) Makefile.deps
59
60Makefile.deps: $(patsubst %.o,%.c,$(OBJS))
61 $(CC) -MM $^ > $@
62
63.PHONY: all distprep clean distclean mrproper dep
64
65-include Makefile.deps