root/lm-sensors/trunk/prog/sensors/Module.mk

Revision 6044, 2.5 KB (checked in by khali, 5 weeks ago)

sensors: Fix libiconv linkage need detection in rare corner case.

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