mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-31 14:25:39 +00:00
add new build targets 'user' and 'user_install'.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1822 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
20
Makefile
20
Makefile
@@ -40,6 +40,9 @@ LINUX_HEADERS := $(LINUX)/include
|
||||
|
||||
# Determine whether we need to compile the kernel modules, or only the
|
||||
# user-space utilities. By default, the kernel modules are compiled.
|
||||
# Leave this set to 1. If you want to compile and install only
|
||||
# the library and the userspace programs,
|
||||
# use 'make user' and 'make user_install'
|
||||
#COMPILE_KERNEL := 0
|
||||
COMPILE_KERNEL := 1
|
||||
|
||||
@@ -246,10 +249,10 @@ endif
|
||||
# Making the dependency files - done automatically!
|
||||
dep :
|
||||
|
||||
all ::
|
||||
|
||||
install :: all
|
||||
|
||||
user ::
|
||||
user_install::
|
||||
all :: user
|
||||
install :: all user_install
|
||||
clean::
|
||||
$(RM) lm_sensors-*
|
||||
|
||||
@@ -275,6 +278,15 @@ version:
|
||||
echo -n 'Version: '; \
|
||||
echo '#define LM_VERSION "'`read VER; echo $$VER`\" >> version.h
|
||||
|
||||
help:
|
||||
@echo 'Make targets are:'
|
||||
@echo ' all (default): build modules and userspace programs'
|
||||
@echo ' install: install modules and userspace programs'
|
||||
@echo ' user: build userspace programs'
|
||||
@echo ' user_install: install userspace programs'
|
||||
@echo ' clean: cleanup'
|
||||
@echo ' package: create a distribution package'
|
||||
@echo 'Note: make dep is automatic'
|
||||
|
||||
# Here, we define all implicit rules we want to use.
|
||||
|
||||
|
@@ -31,6 +31,6 @@ install-etc:
|
||||
if [ ! -e $(DESTDIR)$(ETCINSTALL) ] ; then \
|
||||
$(INSTALL) -o root -g root -m 644 $(ETCTARGET) $(DESTDIR)$(ETCINSTALL); \
|
||||
fi
|
||||
install :: install-etc
|
||||
user_install :: install-etc
|
||||
|
||||
# No clean rule
|
||||
|
@@ -21,7 +21,7 @@
|
||||
MODULE_DIR := kernel/include
|
||||
KERNELINCLUDEDIR := $(MODULE_DIR)
|
||||
|
||||
KERNELINCLUDEFILES :=
|
||||
KERNELINCLUDEFILES := i2c-dev.h
|
||||
ifneq ($(shell if grep -q '^CONFIG_SENSORS=y' $(LINUX)/.config; then echo 1; fi),1)
|
||||
KERNELINCLUDEFILES += $(MODULE_DIR)/sensors.h
|
||||
endif
|
||||
@@ -35,7 +35,7 @@ $(KERNELINCLUDEDIR)/sensors.hd:
|
||||
( $(GREP) 'SENSORS SYSCTL START' /dev/null $(KERNELCHIPSDIR)/*.c | \
|
||||
$(SED) -e 's/:.*//' -e 's#^#$(KERNELINCLUDEDIR)/sensors.h: #' ) > $@
|
||||
|
||||
# Get dependancies of sensors.h
|
||||
# Get dependencies of sensors.h
|
||||
INCLUDEFILES += $(MODULE_DIR)/sensors.hd
|
||||
|
||||
install-all-kernel-include:
|
||||
@@ -44,7 +44,7 @@ install-all-kernel-include:
|
||||
$(INSTALL) -o root -g root -m 644 $(KERNELINCLUDEFILES) $(DESTDIR)$(SYSINCLUDEDIR) ; \
|
||||
fi
|
||||
|
||||
install :: install-all-kernel-include
|
||||
user_install :: install-all-kernel-include
|
||||
|
||||
clean-all-kernel-include:
|
||||
$(RM) $(KERNELINCLUDEDIR)/*.h.install $(KERNELINCLUDEDIR)/sensors.h $(KERNELINCLUDEDIR)/sensors.hd
|
||||
|
@@ -83,7 +83,7 @@ $(MODULE_DIR)/conf-parse.h: $(MODULE_DIR)/conf-parse.c
|
||||
INCLUDEFILES += $(LIBCSOURCES:.c=.ld) $(LIBCSOURCES:.c=.ad)
|
||||
|
||||
all-lib: $(LIBTARGETS)
|
||||
all :: all-lib
|
||||
user :: all-lib
|
||||
|
||||
# Generate warnings if the install directory isn't in /etc/ld.so.conf
|
||||
# or if the library wasn't there before (which means ldconfig must be run).
|
||||
@@ -126,7 +126,7 @@ install-lib: all-lib
|
||||
$(INSTALL) -o $(MANOWN) -g $(MANGRP) -m 644 $(LIBMAN5FILES) $(DESTDIR)$(LIBMAN5DIR)
|
||||
|
||||
|
||||
install :: install-lib
|
||||
user_install :: install-lib
|
||||
|
||||
clean-lib:
|
||||
$(RM) $(LIB_DIR)/*.ld $(LIB_DIR)/*.ad
|
||||
|
@@ -33,12 +33,12 @@ PROGDETECTSBININSTALL := $(MODULE_DIR)/sensors-detect \
|
||||
INCLUDEFILES += $(PROGDETECTSOURCES:.c=.rd)
|
||||
|
||||
all-prog-detect: $(PROGDETECTTARGETS)
|
||||
all :: all-prog-detect
|
||||
user :: all-prog-detect
|
||||
|
||||
install-prog-detect: all-prog-detect
|
||||
mkdir -p $(DESTDIR)$(SBINDIR)
|
||||
$(INSTALL) -o root -g root -m 755 $(PROGDETECTSBININSTALL) $(DESTDIR)$(SBINDIR)
|
||||
install :: install-prog-detect
|
||||
user_install :: install-prog-detect
|
||||
|
||||
clean-prog-detect:
|
||||
$(RM) $(PROGDETECTDIR)/*.rd $(PROGDETECTDIR)/*.ro $(PROGDETECTTARGETS)
|
||||
|
@@ -35,12 +35,12 @@ PROGDUMPBININSTALL := $(MODULE_DIR)/isadump $(MODULE_DIR)/i2cdump \
|
||||
INCLUDEFILES += $(PROGDUMPSOURCES:.c=.rd)
|
||||
|
||||
all-prog-dump: $(PROGDUMPTARGETS)
|
||||
all :: all-prog-dump
|
||||
user :: all-prog-dump
|
||||
|
||||
install-prog-dump: all-prog-dump
|
||||
mkdir -p $(DESTDIR)$(SBINDIR)
|
||||
$(INSTALL) -o root -g root -m 755 $(PROGDUMPBININSTALL) $(DESTDIR)$(SBINDIR)
|
||||
install :: install-prog-dump
|
||||
user_install :: install-prog-dump
|
||||
|
||||
clean-prog-dump:
|
||||
$(RM) $(PROGDUMPDIR)/*.rd $(PROGDUMPDIR)/*.ro $(PROGDUMPTARGETS)
|
||||
|
@@ -41,13 +41,13 @@ $(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
|
||||
$(CC) -o $@ $(PROGSENSORDSOURCES:.c=.ro) -Llib -lsensors -lrrd
|
||||
|
||||
all-prog-sensord: $(PROGSENSORDTARGETS)
|
||||
all :: all-prog-sensord
|
||||
user :: all-prog-sensord
|
||||
|
||||
install-prog-sensord: all-prog-sensord
|
||||
$(MKDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(PROGSENSORDMAN1DIR)
|
||||
$(INSTALL) -o root -g root -m 755 $(PROGSENSORDTARGETS) $(DESTDIR)$(SBINDIR)
|
||||
$(INSTALL) -o $(MANOWN) -g $(MANGRP) -m 644 $(PROGSENSORDMAN1FILES) $(DESTDIR)$(PROGSENSORDMAN1DIR)
|
||||
install :: install-prog-sensord
|
||||
user_install :: install-prog-sensord
|
||||
|
||||
clean-prog-sensord:
|
||||
$(RM) $(PROGSENSORDDIR)/*.rd $(PROGSENSORDDIR)/*.ro
|
||||
|
@@ -37,13 +37,13 @@ $(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
|
||||
$(CC) -o $@ $(PROGSENSORSSOURCES:.c=.ro) -Llib -lsensors
|
||||
|
||||
all-prog-sensors: $(PROGSENSORSTARGETS)
|
||||
all :: all-prog-sensors
|
||||
user :: all-prog-sensors
|
||||
|
||||
install-prog-sensors: all-prog-sensors
|
||||
mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(PROGSENSORSMAN1DIR)
|
||||
$(INSTALL) -o root -g root -m 755 $(PROGSENSORSTARGETS) $(DESTDIR)$(BINDIR)
|
||||
$(INSTALL) -o $(MANOWN) -g $(MANGRP) -m 644 $(PROGSENSORSMAN1FILES) $(DESTDIR)$(PROGSENSORSMAN1DIR)
|
||||
install :: install-prog-sensors
|
||||
user_install :: install-prog-sensors
|
||||
|
||||
clean-prog-sensors:
|
||||
$(RM) $(PROGSENSORSDIR)/*.rd $(PROGSENSORSDIR)/*.ro
|
||||
|
Reference in New Issue
Block a user