blob: 7c5966c532e0dfcde81fc44f7e2144e6d6d8762e [file] [log] [blame]
Peter Stugedad1e302008-11-22 17:13:36 +00001# Makefile for msrtool
2#
Peter Stugedad1e302008-11-22 17:13:36 +00003#
Peter Stugedad1e302008-11-22 17:13:36 +00004# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License version 2 as
6# published by the Free Software Foundation.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
Peter Stugedad1e302008-11-22 17:13:36 +000013
14PROGRAM = msrtool
15
16CC = @CC@
17INSTALL = @INSTALL@
18PREFIX = @PREFIX@
Paul Menzel459d2192017-03-19 20:25:33 +010019CFLAGS = @CFLAGS@
Peter Stugedad1e302008-11-22 17:13:36 +000020LDFLAGS = @LDFLAGS@
21
Elyes HAOUAS6e6b36a2018-05-15 13:28:54 +020022TARGETS = geodegx2.o geodelx.o cs5536.o k8.o via_c7.o intel_pentium3_early.o intel_pentium3.o intel_pentium4_early.o intel_pentium4_later.o intel_pentium_d.o intel_core1.o intel_core2_early.o intel_core2_later.o intel_nehalem.o intel_atom.o
Andriy Gapond80e57c2009-11-28 05:21:42 +000023SYSTEMS = linux.o darwin.o freebsd.o
Peter Stugedad1e302008-11-22 17:13:36 +000024OBJS = $(PROGRAM).o msrutils.o sys.o $(SYSTEMS) $(TARGETS)
25
26all: $(PROGRAM)
27
28$(PROGRAM): $(OBJS) Makefile.deps
29 $(CC) -o $@ $(OBJS) $(LDFLAGS)
30
31$(PROGRAM).o: $(PROGRAM).c
32 $(CC) $(CFLAGS) -DVERSION='"@VERSION@"' -c $< -o $@
33
34install: $(PROGRAM)
Stefan Reinauer37f39352009-09-01 10:03:01 +000035 mkdir -p $(DESTDIR)$(PREFIX)/sbin
36 $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin
Peter Stugedad1e302008-11-22 17:13:36 +000037
38distprep: distclean Makefile.deps
39
40clean:
41 rm -f $(PROGRAM) $(OBJS)
42
43distclean: clean
44 rm -f Makefile
45
46mrproper: distclean
47 rm -f Makefile.deps
48
49dep:
50 rm -f Makefile.deps
51 $(MAKE) Makefile.deps
52
53Makefile.deps: $(patsubst %.o,%.c,$(OBJS))
54 $(CC) -MM $^ > $@
55
56.PHONY: all distprep clean distclean mrproper dep
57
58-include Makefile.deps