root/lm-sensors/trunk/prog/sensord/Module.mk @ 2604

Revision 2604, 2.6 KB (checked in by khali, 11 years ago)

Implement "make user_uninstall". Original patch contributed by

Rudolf Marek.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1#  Module.mk - Makefile for a Linux module for reading sensor data.
2#  Copyright (c) 1998, 1999  Frodo Looijaard <frodol@dds.nl>
3#
4#  This program is free software; you can redistribute it and/or modify
5#  it under the terms of the GNU General Public License as published by
6#  the Free Software Foundation; either version 2 of the License, or
7#  (at your option) any later version.
8#
9#  This program is distributed in the hope that it will be useful,
10#  but WITHOUT ANY WARRANTY; without even the implied warranty of
11#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12#  GNU General Public License for more details.
13#
14#  You should have received a copy of the GNU General Public License
15#  along with this program; if not, write to the Free Software
16#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18# The round robin database (RRD) development headers and libraries are
19# REQUIRED. Get this package from:
20#   http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
21
22# Note that MODULE_DIR (the directory in which this file resides) is a
23# 'simply expanded variable'. That means that its value is substituted
24# verbatim in the rules, until it is redefined.
25MODULE_DIR := prog/sensord
26PROGSENSORDDIR := $(MODULE_DIR)
27
28PROGSENSORDMAN8DIR := $(MANDIR)/man8
29PROGSENSORDMAN8FILES := $(MODULE_DIR)/sensord.8
30
31# Regrettably, even 'simply expanded variables' will not put their currently
32# defined value verbatim into the command-list of rules...
33PROGSENSORDTARGETS := $(MODULE_DIR)/sensord
34PROGSENSORDSOURCES := $(MODULE_DIR)/args.c $(MODULE_DIR)/chips.c $(MODULE_DIR)/lib.c $(MODULE_DIR)/rrd.c $(MODULE_DIR)/sense.c $(MODULE_DIR)/sensord.c
35
36# Include all dependency files. We use '.rd' to indicate this will create
37# executables.
38INCLUDEFILES += $(PROGSENSORDSOURCES:.c=.rd)
39
40REMOVESENSORDBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGSENSORDTARGETS))
41REMOVESENSORDMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORDMAN8DIR)/%,$(PROGSENSORDMAN8FILES))
42
43$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
44        $(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORDSOURCES:.c=.ro) -Llib -lsensors -lrrd
45
46all-prog-sensord: $(PROGSENSORDTARGETS)
47user :: all-prog-sensord
48
49install-prog-sensord: all-prog-sensord
50        $(MKDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(PROGSENSORDMAN8DIR)
51        $(INSTALL) -m 755 $(PROGSENSORDTARGETS) $(DESTDIR)$(SBINDIR)
52        $(INSTALL) -m 644 $(PROGSENSORDMAN8FILES) $(DESTDIR)$(PROGSENSORDMAN8DIR)
53user_install :: install-prog-sensord
54
55user_uninstall::
56        $(RM) $(REMOVESENSORDBIN)
57        $(RM) $(REMOVESENSORDMAN)
58
59clean-prog-sensord:
60        $(RM) $(PROGSENSORDDIR)/*.rd $(PROGSENSORDDIR)/*.ro
61        $(RM) $(PROGSENSORDTARGETS)
62clean :: clean-prog-sensord
Note: See TracBrowser for help on using the browser.