| 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 | # The round robin database (RRD) development headers and libraries are |
|---|
| 20 | # REQUIRED. Get this package from: |
|---|
| 21 | # http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/ |
|---|
| 22 | |
|---|
| 23 | # Note that MODULE_DIR (the directory in which this file resides) is a |
|---|
| 24 | # 'simply expanded variable'. That means that its value is substituted |
|---|
| 25 | # verbatim in the rules, until it is redefined. |
|---|
| 26 | MODULE_DIR := prog/sensord |
|---|
| 27 | PROGSENSORDDIR := $(MODULE_DIR) |
|---|
| 28 | |
|---|
| 29 | PROGSENSORDMAN8DIR := $(MANDIR)/man8 |
|---|
| 30 | PROGSENSORDMAN8FILES := $(MODULE_DIR)/sensord.8 |
|---|
| 31 | |
|---|
| 32 | # Regrettably, even 'simply expanded variables' will not put their currently |
|---|
| 33 | # defined value verbatim into the command-list of rules... |
|---|
| 34 | PROGSENSORDTARGETS := $(MODULE_DIR)/sensord |
|---|
| 35 | PROGSENSORDSOURCES := $(MODULE_DIR)/args.c $(MODULE_DIR)/chips.c $(MODULE_DIR)/lib.c $(MODULE_DIR)/rrd.c $(MODULE_DIR)/sense.c $(MODULE_DIR)/sensord.c |
|---|
| 36 | |
|---|
| 37 | # Include all dependency files. We use '.rd' to indicate this will create |
|---|
| 38 | # executables. |
|---|
| 39 | INCLUDEFILES += $(PROGSENSORDSOURCES:.c=.rd) |
|---|
| 40 | |
|---|
| 41 | REMOVESENSORDBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGSENSORDTARGETS)) |
|---|
| 42 | REMOVESENSORDMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORDMAN8DIR)/%,$(PROGSENSORDMAN8FILES)) |
|---|
| 43 | |
|---|
| 44 | $(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBSHBASENAME) |
|---|
| 45 | $(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORDSOURCES:.c=.ro) -Llib -lsensors -lrrd |
|---|
| 46 | |
|---|
| 47 | all-prog-sensord: $(PROGSENSORDTARGETS) |
|---|
| 48 | user :: all-prog-sensord |
|---|
| 49 | |
|---|
| 50 | install-prog-sensord: all-prog-sensord |
|---|
| 51 | $(MKDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(PROGSENSORDMAN8DIR) |
|---|
| 52 | $(INSTALL) -m 755 $(PROGSENSORDTARGETS) $(DESTDIR)$(SBINDIR) |
|---|
| 53 | $(INSTALL) -m 644 $(PROGSENSORDMAN8FILES) $(DESTDIR)$(PROGSENSORDMAN8DIR) |
|---|
| 54 | user_install :: install-prog-sensord |
|---|
| 55 | |
|---|
| 56 | user_uninstall:: |
|---|
| 57 | $(RM) $(REMOVESENSORDBIN) |
|---|
| 58 | $(RM) $(REMOVESENSORDMAN) |
|---|
| 59 | |
|---|
| 60 | clean-prog-sensord: |
|---|
| 61 | $(RM) $(PROGSENSORDDIR)/*.rd $(PROGSENSORDDIR)/*.ro |
|---|
| 62 | $(RM) $(PROGSENSORDTARGETS) |
|---|
| 63 | clean :: clean-prog-sensord |
|---|