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