mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-29 13:28:01 +00:00
Implement "make user_uninstall". Original patch contributed by
Rudolf Marek. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2604 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
parent
4fd3781e12
commit
e7e4c799da
15
Makefile
15
Makefile
@ -153,10 +153,12 @@ MACHINE := $(shell uname -m)
|
|||||||
SRCDIRS :=
|
SRCDIRS :=
|
||||||
ifneq ($(MAKECMDGOALS),user)
|
ifneq ($(MAKECMDGOALS),user)
|
||||||
ifneq ($(MAKECMDGOALS),user_install)
|
ifneq ($(MAKECMDGOALS),user_install)
|
||||||
|
ifneq ($(MAKECMDGOALS),user_uninstall)
|
||||||
SRCDIRS += mkpatch
|
SRCDIRS += mkpatch
|
||||||
SRCDIRS += kernel kernel/busses kernel/chips
|
SRCDIRS += kernel kernel/busses kernel/chips
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
SRCDIRS += kernel/include
|
SRCDIRS += kernel/include
|
||||||
SRCDIRS += lib prog/detect prog/dump prog/eeprom prog/pwm \
|
SRCDIRS += lib prog/detect prog/dump prog/eeprom prog/pwm \
|
||||||
prog/sensors prog/xeon ${PROG_EXTRA:%=prog/%} etc
|
prog/sensors prog/xeon ${PROG_EXTRA:%=prog/%} etc
|
||||||
@ -242,8 +244,14 @@ all::
|
|||||||
INCLUDEFILES :=
|
INCLUDEFILES :=
|
||||||
include $(patsubst %,%/Module.mk,$(SRCDIRS))
|
include $(patsubst %,%/Module.mk,$(SRCDIRS))
|
||||||
ifneq ($(MAKECMDGOALS),clean)
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
|
ifneq ($(MAKECMDGOALS),uninstall)
|
||||||
|
ifneq ($(MAKECMDGOALS),user_uninstall)
|
||||||
|
ifneq ($(MAKECMDGOALS),help)
|
||||||
include $(INCLUDEFILES)
|
include $(INCLUDEFILES)
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Man pages
|
# Man pages
|
||||||
MANPAGES := $(LIBMAN3FILES) $(LIBMAN5FILES) $(PROGDETECTMAN8FILES) $(PROGDUMPMAN8FILES) \
|
MANPAGES := $(LIBMAN3FILES) $(LIBMAN5FILES) $(PROGDETECTMAN8FILES) $(PROGDUMPMAN8FILES) \
|
||||||
@ -283,6 +291,12 @@ endif
|
|||||||
clean::
|
clean::
|
||||||
$(RM) lm_sensors-*
|
$(RM) lm_sensors-*
|
||||||
|
|
||||||
|
user_uninstall::
|
||||||
|
|
||||||
|
uninstall :: user_uninstall
|
||||||
|
@echo "*** Note:"
|
||||||
|
@echo "*** * Kernel modules were not uninstalled."
|
||||||
|
|
||||||
# This is tricky, but it works like a charm. It needs lots of utilities
|
# This is tricky, but it works like a charm. It needs lots of utilities
|
||||||
# though: cut, find, gzip, ln, tail and tar.
|
# though: cut, find, gzip, ln, tail and tar.
|
||||||
package: version clean
|
package: version clean
|
||||||
@ -311,6 +325,7 @@ help:
|
|||||||
@echo ' install: install modules and userspace programs'
|
@echo ' install: install modules and userspace programs'
|
||||||
@echo ' user: build userspace programs'
|
@echo ' user: build userspace programs'
|
||||||
@echo ' user_install: install userspace programs'
|
@echo ' user_install: install userspace programs'
|
||||||
|
@echo ' user_uninstall: remove userspace programs'
|
||||||
@echo ' clean: cleanup'
|
@echo ' clean: cleanup'
|
||||||
@echo ' package: create a distribution package'
|
@echo ' package: create a distribution package'
|
||||||
@echo 'Note: make dep is automatic'
|
@echo 'Note: make dep is automatic'
|
||||||
|
@ -36,6 +36,8 @@ $(KERNELINCLUDEDIR)/sensors.hd:
|
|||||||
# Get dependencies of sensors.h
|
# Get dependencies of sensors.h
|
||||||
INCLUDEFILES += $(MODULE_DIR)/sensors.hd
|
INCLUDEFILES += $(MODULE_DIR)/sensors.hd
|
||||||
|
|
||||||
|
REMOVEKERNELINC := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SYSINCLUDEDIR)/%,$(KERNELINCLUDEFILES))
|
||||||
|
|
||||||
install-all-kernel-include:
|
install-all-kernel-include:
|
||||||
if [ -n "$(KERNELINCLUDEFILES)" ] ; then \
|
if [ -n "$(KERNELINCLUDEFILES)" ] ; then \
|
||||||
$(MKDIR) $(DESTDIR)$(SYSINCLUDEDIR) ; \
|
$(MKDIR) $(DESTDIR)$(SYSINCLUDEDIR) ; \
|
||||||
@ -44,6 +46,9 @@ install-all-kernel-include:
|
|||||||
|
|
||||||
user_install :: install-all-kernel-include
|
user_install :: install-all-kernel-include
|
||||||
|
|
||||||
|
user_uninstall::
|
||||||
|
$(RM) $(REMOVEKERNELINC)
|
||||||
|
|
||||||
clean-all-kernel-include:
|
clean-all-kernel-include:
|
||||||
$(RM) $(KERNELINCLUDEDIR)/*.h.install $(KERNELINCLUDEDIR)/sensors.h $(KERNELINCLUDEDIR)/sensors.hd
|
$(RM) $(KERNELINCLUDEDIR)/*.h.install $(KERNELINCLUDEDIR)/sensors.h $(KERNELINCLUDEDIR)/sensors.hd
|
||||||
|
|
||||||
|
@ -92,6 +92,14 @@ $(MODULE_DIR)/conf-lex.ao: $(MODULE_DIR)/conf-lex.c
|
|||||||
$(MODULE_DIR)/conf-lex.lo: $(MODULE_DIR)/conf-lex.c
|
$(MODULE_DIR)/conf-lex.lo: $(MODULE_DIR)/conf-lex.c
|
||||||
$(CC) $(LIBCPPFLAGS) $(LIBCFLAGS) -Wno-unused -c $< -o $@
|
$(CC) $(LIBCPPFLAGS) $(LIBCFLAGS) -Wno-unused -c $< -o $@
|
||||||
|
|
||||||
|
REMOVELIBST := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(LIBDIR)/%,$(LIB_DIR)/$(LIBSTLIBNAME))
|
||||||
|
REMOVELIBSH := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(LIBDIR)/%,$(LIB_DIR)/$(LIBSHLIBNAME))
|
||||||
|
REMOVELNSO := $(DESTDIR)$(LIBDIR)/$(LIBSHSONAME)
|
||||||
|
REMOVELNBS := $(DESTDIR)$(LIBDIR)/$(LIBSHBASENAME)
|
||||||
|
REMOVELIBHF := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(LIBINCLUDEDIR)/%,$(LIBHEADERFILES))
|
||||||
|
REMOVEMAN3 := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(LIBMAN3DIR)/%,$(LIBMAN3FILES))
|
||||||
|
REMOVEMAN5 := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(LIBMAN5DIR)/%,$(LIBMAN5FILES))
|
||||||
|
|
||||||
all-lib: $(LIBTARGETS)
|
all-lib: $(LIBTARGETS)
|
||||||
user :: all-lib
|
user :: all-lib
|
||||||
|
|
||||||
@ -140,6 +148,10 @@ install-lib: all-lib
|
|||||||
|
|
||||||
user_install :: install-lib
|
user_install :: install-lib
|
||||||
|
|
||||||
|
user_uninstall::
|
||||||
|
$(RM) $(REMOVELIBST) $(REMOVELIBSH) $(REMOVELNSO) $(REMOVELNBS)
|
||||||
|
$(RM) $(REMOVELIBHF) $(REMOVEMAN3) $(REMOVEMAN5)
|
||||||
|
|
||||||
clean-lib:
|
clean-lib:
|
||||||
$(RM) $(LIB_DIR)/*.ld $(LIB_DIR)/*.ad
|
$(RM) $(LIB_DIR)/*.ld $(LIB_DIR)/*.ad
|
||||||
$(RM) $(LIB_DIR)/*.lo $(LIB_DIR)/*.ao
|
$(RM) $(LIB_DIR)/*.lo $(LIB_DIR)/*.ao
|
||||||
|
@ -35,6 +35,9 @@ PROGDETECTSBININSTALL := $(MODULE_DIR)/sensors-detect \
|
|||||||
# executables.
|
# executables.
|
||||||
INCLUDEFILES += $(PROGDETECTSOURCES:.c=.rd)
|
INCLUDEFILES += $(PROGDETECTSOURCES:.c=.rd)
|
||||||
|
|
||||||
|
REMOVEDETECTBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGDETECTSBININSTALL))
|
||||||
|
REMOVEDETECTMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGDETECTMAN8DIR)/%,$(PROGDETECTMAN8FILES))
|
||||||
|
|
||||||
all-prog-detect: $(PROGDETECTTARGETS)
|
all-prog-detect: $(PROGDETECTTARGETS)
|
||||||
user :: all-prog-detect
|
user :: all-prog-detect
|
||||||
|
|
||||||
@ -47,6 +50,10 @@ install-prog-detect: all-prog-detect
|
|||||||
$(INSTALL) -m 644 $(PROGDETECTMAN8FILES) $(DESTDIR)$(PROGDETECTMAN8DIR)
|
$(INSTALL) -m 644 $(PROGDETECTMAN8FILES) $(DESTDIR)$(PROGDETECTMAN8DIR)
|
||||||
user_install :: install-prog-detect
|
user_install :: install-prog-detect
|
||||||
|
|
||||||
|
user_uninstall::
|
||||||
|
$(RM) $(REMOVEDETECTBIN)
|
||||||
|
$(RM) $(REMOVEDETECTMAN)
|
||||||
|
|
||||||
clean-prog-detect:
|
clean-prog-detect:
|
||||||
$(RM) $(PROGDETECTDIR)/*.rd $(PROGDETECTDIR)/*.ro $(PROGDETECTTARGETS)
|
$(RM) $(PROGDETECTDIR)/*.rd $(PROGDETECTDIR)/*.ro $(PROGDETECTTARGETS)
|
||||||
clean :: clean-prog-detect
|
clean :: clean-prog-detect
|
||||||
|
@ -43,6 +43,9 @@ endif
|
|||||||
# executables.
|
# executables.
|
||||||
INCLUDEFILES += $(PROGDUMPSOURCES:.c=.rd)
|
INCLUDEFILES += $(PROGDUMPSOURCES:.c=.rd)
|
||||||
|
|
||||||
|
REMOVEDUMPBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGDUMPBININSTALL))
|
||||||
|
REMOVEDUMPMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGDUMPMAN8DIR)/%,$(PROGDUMPMAN8FILES))
|
||||||
|
|
||||||
all-prog-dump: $(PROGDUMPTARGETS)
|
all-prog-dump: $(PROGDUMPTARGETS)
|
||||||
user :: all-prog-dump
|
user :: all-prog-dump
|
||||||
|
|
||||||
@ -58,6 +61,10 @@ install-prog-dump: all-prog-dump
|
|||||||
$(INSTALL) -m 644 $(PROGDUMPMAN8FILES) $(DESTDIR)$(PROGDUMPMAN8DIR)
|
$(INSTALL) -m 644 $(PROGDUMPMAN8FILES) $(DESTDIR)$(PROGDUMPMAN8DIR)
|
||||||
user_install :: install-prog-dump
|
user_install :: install-prog-dump
|
||||||
|
|
||||||
|
user_uninstall::
|
||||||
|
$(RM) $(REMOVEDUMPBIN)
|
||||||
|
$(RM) $(REMOVEDUMPMAN)
|
||||||
|
|
||||||
clean-prog-dump:
|
clean-prog-dump:
|
||||||
$(RM) $(PROGDUMPDIR)/*.rd $(PROGDUMPDIR)/*.ro $(PROGDUMPTARGETS)
|
$(RM) $(PROGDUMPDIR)/*.rd $(PROGDUMPDIR)/*.ro $(PROGDUMPTARGETS)
|
||||||
clean :: clean-prog-dump
|
clean :: clean-prog-dump
|
||||||
|
@ -22,9 +22,13 @@ PROGEEPROMTARGETS := $(MODULE_DIR)/decode-dimms.pl \
|
|||||||
$(MODULE_DIR)/decode-edid.pl \
|
$(MODULE_DIR)/decode-edid.pl \
|
||||||
$(MODULE_DIR)/decode-vaio.pl
|
$(MODULE_DIR)/decode-vaio.pl
|
||||||
|
|
||||||
|
REMOVEEEPROMBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGEEPROMTARGETS))
|
||||||
|
|
||||||
install-prog-eeprom: $(PROGEEPROMTARGETS)
|
install-prog-eeprom: $(PROGEEPROMTARGETS)
|
||||||
$(MKDIR) $(DESTDIR)$(BINDIR)
|
$(MKDIR) $(DESTDIR)$(BINDIR)
|
||||||
$(INSTALL) -m 755 $(PROGEEPROMTARGETS) $(DESTDIR)$(BINDIR)
|
$(INSTALL) -m 755 $(PROGEEPROMTARGETS) $(DESTDIR)$(BINDIR)
|
||||||
|
|
||||||
user_install :: install-prog-eeprom
|
user_install :: install-prog-eeprom
|
||||||
|
|
||||||
|
user_uninstall::
|
||||||
|
$(RM) $(REMOVEEEPROMBIN)
|
||||||
|
@ -22,9 +22,13 @@ PROGPWMTARGETS := $(MODULE_DIR)/fancontrol \
|
|||||||
$(MODULE_DIR)/fancontrol.pl \
|
$(MODULE_DIR)/fancontrol.pl \
|
||||||
$(MODULE_DIR)/pwmconfig
|
$(MODULE_DIR)/pwmconfig
|
||||||
|
|
||||||
|
REMOVEPWMBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGPWMTARGETS))
|
||||||
|
|
||||||
install-prog-pwm: $(PROGPWMTARGETS)
|
install-prog-pwm: $(PROGPWMTARGETS)
|
||||||
$(MKDIR) $(DESTDIR)$(SBINDIR)
|
$(MKDIR) $(DESTDIR)$(SBINDIR)
|
||||||
$(INSTALL) -m 755 $(PROGPWMTARGETS) $(DESTDIR)$(SBINDIR)
|
$(INSTALL) -m 755 $(PROGPWMTARGETS) $(DESTDIR)$(SBINDIR)
|
||||||
|
|
||||||
user_install :: install-prog-pwm
|
user_install :: install-prog-pwm
|
||||||
|
|
||||||
|
user_uninstall::
|
||||||
|
$(RM) $(REMOVEPWMBIN)
|
||||||
|
@ -37,6 +37,9 @@ PROGSENSORDSOURCES := $(MODULE_DIR)/args.c $(MODULE_DIR)/chips.c $(MODULE_DIR)/l
|
|||||||
# executables.
|
# executables.
|
||||||
INCLUDEFILES += $(PROGSENSORDSOURCES:.c=.rd)
|
INCLUDEFILES += $(PROGSENSORDSOURCES:.c=.rd)
|
||||||
|
|
||||||
|
REMOVESENSORDBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGSENSORDTARGETS))
|
||||||
|
REMOVESENSORDMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORDMAN8DIR)/%,$(PROGSENSORDMAN8FILES))
|
||||||
|
|
||||||
$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
|
$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
|
||||||
$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORDSOURCES:.c=.ro) -Llib -lsensors -lrrd
|
$(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORDSOURCES:.c=.ro) -Llib -lsensors -lrrd
|
||||||
|
|
||||||
@ -49,6 +52,10 @@ install-prog-sensord: all-prog-sensord
|
|||||||
$(INSTALL) -m 644 $(PROGSENSORDMAN8FILES) $(DESTDIR)$(PROGSENSORDMAN8DIR)
|
$(INSTALL) -m 644 $(PROGSENSORDMAN8FILES) $(DESTDIR)$(PROGSENSORDMAN8DIR)
|
||||||
user_install :: install-prog-sensord
|
user_install :: install-prog-sensord
|
||||||
|
|
||||||
|
user_uninstall::
|
||||||
|
$(RM) $(REMOVESENSORDBIN)
|
||||||
|
$(RM) $(REMOVESENSORDMAN)
|
||||||
|
|
||||||
clean-prog-sensord:
|
clean-prog-sensord:
|
||||||
$(RM) $(PROGSENSORDDIR)/*.rd $(PROGSENSORDDIR)/*.ro
|
$(RM) $(PROGSENSORDDIR)/*.rd $(PROGSENSORDDIR)/*.ro
|
||||||
$(RM) $(PROGSENSORDTARGETS)
|
$(RM) $(PROGSENSORDTARGETS)
|
||||||
|
@ -33,6 +33,9 @@ PROGSENSORSSOURCES := $(MODULE_DIR)/main.c $(MODULE_DIR)/chips.c
|
|||||||
# executables.
|
# executables.
|
||||||
INCLUDEFILES += $(PROGSENSORSSOURCES:.c=.rd)
|
INCLUDEFILES += $(PROGSENSORSSOURCES:.c=.rd)
|
||||||
|
|
||||||
|
REMOVESENSORSBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGSENSORSTARGETS))
|
||||||
|
REMOVESENSORSMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORSMAN1DIR)/%,$(PROGSENSORSMAN1FILES))
|
||||||
|
|
||||||
LIBICONV := $(shell if /sbin/ldconfig -p | grep -q libiconv\\.so ; then echo \-liconv; else echo; fi)
|
LIBICONV := $(shell if /sbin/ldconfig -p | grep -q libiconv\\.so ; then echo \-liconv; else echo; fi)
|
||||||
|
|
||||||
$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
|
$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
|
||||||
@ -47,6 +50,10 @@ install-prog-sensors: all-prog-sensors
|
|||||||
$(INSTALL) -m 644 $(PROGSENSORSMAN1FILES) $(DESTDIR)$(PROGSENSORSMAN1DIR)
|
$(INSTALL) -m 644 $(PROGSENSORSMAN1FILES) $(DESTDIR)$(PROGSENSORSMAN1DIR)
|
||||||
user_install :: install-prog-sensors
|
user_install :: install-prog-sensors
|
||||||
|
|
||||||
|
user_uninstall::
|
||||||
|
$(RM) $(REMOVESENSORSBIN)
|
||||||
|
$(RM) $(REMOVESENSORSMAN)
|
||||||
|
|
||||||
clean-prog-sensors:
|
clean-prog-sensors:
|
||||||
$(RM) $(PROGSENSORSDIR)/*.rd $(PROGSENSORSDIR)/*.ro
|
$(RM) $(PROGSENSORSDIR)/*.rd $(PROGSENSORSDIR)/*.ro
|
||||||
$(RM) $(PROGSENSORSTARGETS)
|
$(RM) $(PROGSENSORSTARGETS)
|
||||||
|
@ -20,9 +20,13 @@ PROGXEONDIR := $(MODULE_DIR)
|
|||||||
|
|
||||||
PROGXEONTARGETS := $(MODULE_DIR)/decode-xeon.pl
|
PROGXEONTARGETS := $(MODULE_DIR)/decode-xeon.pl
|
||||||
|
|
||||||
|
REMOVEXEONBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGXEONTARGETS))
|
||||||
|
|
||||||
install-prog-xeon: $(PROGXEONTARGETS)
|
install-prog-xeon: $(PROGXEONTARGETS)
|
||||||
$(MKDIR) $(DESTDIR)$(BINDIR)
|
$(MKDIR) $(DESTDIR)$(BINDIR)
|
||||||
$(INSTALL) -m 755 $(PROGXEONTARGETS) $(DESTDIR)$(BINDIR)
|
$(INSTALL) -m 755 $(PROGXEONTARGETS) $(DESTDIR)$(BINDIR)
|
||||||
|
|
||||||
user_install :: install-prog-xeon
|
user_install :: install-prog-xeon
|
||||||
|
|
||||||
|
user_uninstall::
|
||||||
|
$(RM) $(REMOVEXEONBIN)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user