1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
#
# Makefile -- makefile for compiling the i8k Linux Utilities
#
# Copyright (C) 2001 Massimo Dal Zotto <dz@debian.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
POLL_TIMEOUT = 100
#MODVERSIONS = -DMODVERSIONS
VERSION = $(shell head -1 debian/changelog | sed 's/.*(//;s/).*//')
DISTFILE = i8kutils-$(VERSION).tar.bz2
SIGNFILE = $(DISTFILE).sign
SRCDIR = $(shell pwd | sed 's|.*/||g')
CC = gcc
CFLAGS = -O2 -Wall
KERNEL_FLAGS = -D__KERNEL__ -DMODULE $(MODVERSIONS)
KERNEL_SOURCE = /usr/src/linux
INCLUDE = -I. -I$(KERNEL_SOURCE)/include
ifdef MODVERSIONS
INCLUDE += -include $(KERNEL_SOURCE)/include/linux/modversions.h
endif
all: i8kbuttons i8kctl i8kmon
i8kbuttons: i8kbuttons.c
$(CC) -g $(CFLAGS) -DPOLL_TIMEOUT=$(POLL_TIMEOUT) -I. -o $@ $<
i8kctl: i8kctl.c
$(CC) -g $(CFLAGS) -I. -o $@ $<
ln -fs $@ i8kfan
install: i8kbuttons i8kctl i8kmon
cp -fp i8kbuttons i8kctl i8kmon $(DESTDIR)/usr/bin/
ln -fs i8kctl $(DESTDIR)/usr/bin/i8kfan
clean:
rm -f *.o *~ "#*#"
distclean: clean
rm -f i8kbuttons i8kctl i8kfan smm
dist: distclean
-fakeroot ./debian/rules clean
-make i8k.o
cd .. \
&& tar -cjvf $(DISTFILE) $(SRCDIR)/* \
&& gpg --armor --detach-sign --yes -o $(SIGNFILE) $(DISTFILE)
deb:
dpkg-buildpackage -rfakeroot -us -uc
# I8k module, not needed once it is included in the kernel sources
module: i8k.o
modversion:
$(MAKE) i8k.o MODVERSIONS=-DMODVERSIONS
i8k.o: i8k.c
$(CC) $(CFLAGS) $(KERNEL_FLAGS) $(INCLUDE) -o $@ -c $<
strip --strip-unneeded $@
module-install: i8k.o
mkdir -p /lib/modules/$$(uname -r)/misc/
cp -fp i8k.o /lib/modules/$$(uname -r)/misc/
chown 0.0 /lib/modules/$$(uname -r)/misc/i8k.o
insmod: i8k.o
lsmod | grep -qw i8k || insmod ./i8k.o || insmod -f ./i8k.o
rmmod:
lsmod | grep -qw i8k && rmmod i8k
# SMM test program, DON'T USE UNLESS YOU KNOW WHAT YOU ARE DOING!!!
smm: smm.c
$(CC) -g $(CFLAGS) -I. -o $@ $<
# end of file
|