Peter Stuge | dad1e30 | 2008-11-22 17:13:36 +0000 | [diff] [blame] | 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 |
Paul Menzel | a46a712 | 2013-02-23 18:37:27 +0100 | [diff] [blame] | 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
Peter Stuge | dad1e30 | 2008-11-22 17:13:36 +0000 | [diff] [blame] | 19 | # |
| 20 | |
| 21 | PROGRAM = msrtool |
| 22 | |
| 23 | CC = @CC@ |
| 24 | INSTALL = @INSTALL@ |
| 25 | PREFIX = @PREFIX@ |
Anton Kochkov | 7c634ae | 2011-06-20 23:14:22 +0400 | [diff] [blame] | 26 | CFLAGS = @CFLAGS@ -fno-pic |
Peter Stuge | dad1e30 | 2008-11-22 17:13:36 +0000 | [diff] [blame] | 27 | LDFLAGS = @LDFLAGS@ |
| 28 | |
Anton Kochkov | 54c07a6 | 2012-07-04 07:35:45 +0400 | [diff] [blame] | 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 intel_nehalem.o |
Andriy Gapon | d80e57c | 2009-11-28 05:21:42 +0000 | [diff] [blame] | 30 | SYSTEMS = linux.o darwin.o freebsd.o |
Peter Stuge | dad1e30 | 2008-11-22 17:13:36 +0000 | [diff] [blame] | 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) |
Stefan Reinauer | 37f3935 | 2009-09-01 10:03:01 +0000 | [diff] [blame] | 42 | mkdir -p $(DESTDIR)$(PREFIX)/sbin |
| 43 | $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin |
Peter Stuge | dad1e30 | 2008-11-22 17:13:36 +0000 | [diff] [blame] | 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 |