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 | # |
Peter Stuge | dad1e30 | 2008-11-22 17:13:36 +0000 | [diff] [blame] | 16 | |
| 17 | PROGRAM = msrtool |
| 18 | |
| 19 | CC = @CC@ |
| 20 | INSTALL = @INSTALL@ |
| 21 | PREFIX = @PREFIX@ |
Paul Menzel | 459d219 | 2017-03-19 20:25:33 +0100 | [diff] [blame] | 22 | CFLAGS = @CFLAGS@ |
Peter Stuge | dad1e30 | 2008-11-22 17:13:36 +0000 | [diff] [blame] | 23 | LDFLAGS = @LDFLAGS@ |
| 24 | |
Elyes HAOUAS | 6e6b36a | 2018-05-15 13:28:54 +0200 | [diff] [blame] | 25 | TARGETS = 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 Gapon | d80e57c | 2009-11-28 05:21:42 +0000 | [diff] [blame] | 26 | SYSTEMS = linux.o darwin.o freebsd.o |
Peter Stuge | dad1e30 | 2008-11-22 17:13:36 +0000 | [diff] [blame] | 27 | OBJS = $(PROGRAM).o msrutils.o sys.o $(SYSTEMS) $(TARGETS) |
| 28 | |
| 29 | all: $(PROGRAM) |
| 30 | |
| 31 | $(PROGRAM): $(OBJS) Makefile.deps |
| 32 | $(CC) -o $@ $(OBJS) $(LDFLAGS) |
| 33 | |
| 34 | $(PROGRAM).o: $(PROGRAM).c |
| 35 | $(CC) $(CFLAGS) -DVERSION='"@VERSION@"' -c $< -o $@ |
| 36 | |
| 37 | install: $(PROGRAM) |
Stefan Reinauer | 37f3935 | 2009-09-01 10:03:01 +0000 | [diff] [blame] | 38 | mkdir -p $(DESTDIR)$(PREFIX)/sbin |
| 39 | $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin |
Peter Stuge | dad1e30 | 2008-11-22 17:13:36 +0000 | [diff] [blame] | 40 | |
| 41 | distprep: distclean Makefile.deps |
| 42 | |
| 43 | clean: |
| 44 | rm -f $(PROGRAM) $(OBJS) |
| 45 | |
| 46 | distclean: clean |
| 47 | rm -f Makefile |
| 48 | |
| 49 | mrproper: distclean |
| 50 | rm -f Makefile.deps |
| 51 | |
| 52 | dep: |
| 53 | rm -f Makefile.deps |
| 54 | $(MAKE) Makefile.deps |
| 55 | |
| 56 | Makefile.deps: $(patsubst %.o,%.c,$(OBJS)) |
| 57 | $(CC) -MM $^ > $@ |
| 58 | |
| 59 | .PHONY: all distprep clean distclean mrproper dep |
| 60 | |
| 61 | -include Makefile.deps |