root/lm-sensors/branches/lm-sensors-3.0.0/prog/sensors/Module.mk @ 4991

Revision 4991, 2.5 KB (checked in by khali, 6 years ago)

Install sensors as sensors again.

  • 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# Note that MODULE_DIR (the directory in which this file resides) is a
19# 'simply expanded variable'. That means that its value is substituted
20# verbatim in the rules, until it is redefined.
21MODULE_DIR := prog/sensors
22PROGSENSORSDIR := $(MODULE_DIR)
23
24PROGSENSORSMAN1DIR := $(MANDIR)/man1
25PROGSENSORSMAN1FILES := $(MODULE_DIR)/sensors.1
26
27# Regrettably, even 'simply expanded variables' will not put their currently
28# defined value verbatim into the command-list of rules...
29PROGSENSORSTARGETS := $(MODULE_DIR)/sensors
30PROGSENSORSSOURCES := $(MODULE_DIR)/main.c $(MODULE_DIR)/chips.c
31
32# Include all dependency files. We use '.rd' to indicate this will create
33# executables.
34INCLUDEFILES += $(PROGSENSORSSOURCES:.c=.rd)
35
36REMOVESENSORSBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGSENSORSTARGETS))
37REMOVESENSORSMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORSMAN1DIR)/%,$(PROGSENSORSMAN1FILES))
38
39LIBICONV := $(shell if /sbin/ldconfig -p | grep -q libiconv\\.so ; then echo \-liconv; else echo; fi)
40
41$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
42        $(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors
43
44all-prog-sensors: $(PROGSENSORSTARGETS)
45user :: all-prog-sensors
46
47install-prog-sensors: all-prog-sensors
48        $(MKDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(PROGSENSORSMAN1DIR)
49        $(INSTALL) -m 755 $(PROGSENSORSTARGETS) $(DESTDIR)$(BINDIR)
50        $(INSTALL) -m 644 $(PROGSENSORSMAN1FILES) $(DESTDIR)$(PROGSENSORSMAN1DIR)
51user_install :: install-prog-sensors
52
53user_uninstall::
54        $(RM) $(REMOVESENSORSBIN)
55        $(RM) $(REMOVESENSORSMAN)
56
57clean-prog-sensors:
58        $(RM) $(PROGSENSORSDIR)/*.rd $(PROGSENSORSDIR)/*.ro
59        $(RM) $(PROGSENSORSTARGETS)
60clean :: clean-prog-sensors
Note: See TracBrowser for help on using the browser.