2
0
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:
Jean Delvare 2004-06-20 14:18:28 +00:00
parent 4fd3781e12
commit e7e4c799da
10 changed files with 72 additions and 0 deletions

View File

@ -153,10 +153,12 @@ MACHINE := $(shell uname -m)
SRCDIRS :=
ifneq ($(MAKECMDGOALS),user)
ifneq ($(MAKECMDGOALS),user_install)
ifneq ($(MAKECMDGOALS),user_uninstall)
SRCDIRS += mkpatch
SRCDIRS += kernel kernel/busses kernel/chips
endif
endif
endif
SRCDIRS += kernel/include
SRCDIRS += lib prog/detect prog/dump prog/eeprom prog/pwm \
prog/sensors prog/xeon ${PROG_EXTRA:%=prog/%} etc
@ -242,8 +244,14 @@ all::
INCLUDEFILES :=
include $(patsubst %,%/Module.mk,$(SRCDIRS))
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),uninstall)
ifneq ($(MAKECMDGOALS),user_uninstall)
ifneq ($(MAKECMDGOALS),help)
include $(INCLUDEFILES)
endif
endif
endif
endif
# Man pages
MANPAGES := $(LIBMAN3FILES) $(LIBMAN5FILES) $(PROGDETECTMAN8FILES) $(PROGDUMPMAN8FILES) \
@ -283,6 +291,12 @@ endif
clean::
$(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
# though: cut, find, gzip, ln, tail and tar.
package: version clean
@ -311,6 +325,7 @@ help:
@echo ' install: install modules and userspace programs'
@echo ' user: build userspace programs'
@echo ' user_install: install userspace programs'
@echo ' user_uninstall: remove userspace programs'
@echo ' clean: cleanup'
@echo ' package: create a distribution package'
@echo 'Note: make dep is automatic'

View File

@ -36,6 +36,8 @@ $(KERNELINCLUDEDIR)/sensors.hd:
# Get dependencies of sensors.h
INCLUDEFILES += $(MODULE_DIR)/sensors.hd
REMOVEKERNELINC := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SYSINCLUDEDIR)/%,$(KERNELINCLUDEFILES))
install-all-kernel-include:
if [ -n "$(KERNELINCLUDEFILES)" ] ; then \
$(MKDIR) $(DESTDIR)$(SYSINCLUDEDIR) ; \
@ -44,6 +46,9 @@ install-all-kernel-include:
user_install :: install-all-kernel-include
user_uninstall::
$(RM) $(REMOVEKERNELINC)
clean-all-kernel-include:
$(RM) $(KERNELINCLUDEDIR)/*.h.install $(KERNELINCLUDEDIR)/sensors.h $(KERNELINCLUDEDIR)/sensors.hd

View File

@ -92,6 +92,14 @@ $(MODULE_DIR)/conf-lex.ao: $(MODULE_DIR)/conf-lex.c
$(MODULE_DIR)/conf-lex.lo: $(MODULE_DIR)/conf-lex.c
$(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)
user :: all-lib
@ -140,6 +148,10 @@ install-lib: all-lib
user_install :: install-lib
user_uninstall::
$(RM) $(REMOVELIBST) $(REMOVELIBSH) $(REMOVELNSO) $(REMOVELNBS)
$(RM) $(REMOVELIBHF) $(REMOVEMAN3) $(REMOVEMAN5)
clean-lib:
$(RM) $(LIB_DIR)/*.ld $(LIB_DIR)/*.ad
$(RM) $(LIB_DIR)/*.lo $(LIB_DIR)/*.ao

View File

@ -35,6 +35,9 @@ PROGDETECTSBININSTALL := $(MODULE_DIR)/sensors-detect \
# executables.
INCLUDEFILES += $(PROGDETECTSOURCES:.c=.rd)
REMOVEDETECTBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGDETECTSBININSTALL))
REMOVEDETECTMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGDETECTMAN8DIR)/%,$(PROGDETECTMAN8FILES))
all-prog-detect: $(PROGDETECTTARGETS)
user :: all-prog-detect
@ -47,6 +50,10 @@ install-prog-detect: all-prog-detect
$(INSTALL) -m 644 $(PROGDETECTMAN8FILES) $(DESTDIR)$(PROGDETECTMAN8DIR)
user_install :: install-prog-detect
user_uninstall::
$(RM) $(REMOVEDETECTBIN)
$(RM) $(REMOVEDETECTMAN)
clean-prog-detect:
$(RM) $(PROGDETECTDIR)/*.rd $(PROGDETECTDIR)/*.ro $(PROGDETECTTARGETS)
clean :: clean-prog-detect

View File

@ -43,6 +43,9 @@ endif
# executables.
INCLUDEFILES += $(PROGDUMPSOURCES:.c=.rd)
REMOVEDUMPBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGDUMPBININSTALL))
REMOVEDUMPMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGDUMPMAN8DIR)/%,$(PROGDUMPMAN8FILES))
all-prog-dump: $(PROGDUMPTARGETS)
user :: all-prog-dump
@ -58,6 +61,10 @@ install-prog-dump: all-prog-dump
$(INSTALL) -m 644 $(PROGDUMPMAN8FILES) $(DESTDIR)$(PROGDUMPMAN8DIR)
user_install :: install-prog-dump
user_uninstall::
$(RM) $(REMOVEDUMPBIN)
$(RM) $(REMOVEDUMPMAN)
clean-prog-dump:
$(RM) $(PROGDUMPDIR)/*.rd $(PROGDUMPDIR)/*.ro $(PROGDUMPTARGETS)
clean :: clean-prog-dump

View File

@ -22,9 +22,13 @@ PROGEEPROMTARGETS := $(MODULE_DIR)/decode-dimms.pl \
$(MODULE_DIR)/decode-edid.pl \
$(MODULE_DIR)/decode-vaio.pl
REMOVEEEPROMBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGEEPROMTARGETS))
install-prog-eeprom: $(PROGEEPROMTARGETS)
$(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL) -m 755 $(PROGEEPROMTARGETS) $(DESTDIR)$(BINDIR)
user_install :: install-prog-eeprom
user_uninstall::
$(RM) $(REMOVEEEPROMBIN)

View File

@ -22,9 +22,13 @@ PROGPWMTARGETS := $(MODULE_DIR)/fancontrol \
$(MODULE_DIR)/fancontrol.pl \
$(MODULE_DIR)/pwmconfig
REMOVEPWMBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGPWMTARGETS))
install-prog-pwm: $(PROGPWMTARGETS)
$(MKDIR) $(DESTDIR)$(SBINDIR)
$(INSTALL) -m 755 $(PROGPWMTARGETS) $(DESTDIR)$(SBINDIR)
user_install :: install-prog-pwm
user_uninstall::
$(RM) $(REMOVEPWMBIN)

View File

@ -37,6 +37,9 @@ PROGSENSORDSOURCES := $(MODULE_DIR)/args.c $(MODULE_DIR)/chips.c $(MODULE_DIR)/l
# executables.
INCLUDEFILES += $(PROGSENSORDSOURCES:.c=.rd)
REMOVESENSORDBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGSENSORDTARGETS))
REMOVESENSORDMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORDMAN8DIR)/%,$(PROGSENSORDMAN8FILES))
$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
$(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)
user_install :: install-prog-sensord
user_uninstall::
$(RM) $(REMOVESENSORDBIN)
$(RM) $(REMOVESENSORDMAN)
clean-prog-sensord:
$(RM) $(PROGSENSORDDIR)/*.rd $(PROGSENSORDDIR)/*.ro
$(RM) $(PROGSENSORDTARGETS)

View File

@ -33,6 +33,9 @@ PROGSENSORSSOURCES := $(MODULE_DIR)/main.c $(MODULE_DIR)/chips.c
# executables.
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)
$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBSHBASENAME)
@ -47,6 +50,10 @@ install-prog-sensors: all-prog-sensors
$(INSTALL) -m 644 $(PROGSENSORSMAN1FILES) $(DESTDIR)$(PROGSENSORSMAN1DIR)
user_install :: install-prog-sensors
user_uninstall::
$(RM) $(REMOVESENSORSBIN)
$(RM) $(REMOVESENSORSMAN)
clean-prog-sensors:
$(RM) $(PROGSENSORSDIR)/*.rd $(PROGSENSORSDIR)/*.ro
$(RM) $(PROGSENSORSTARGETS)

View File

@ -20,9 +20,13 @@ PROGXEONDIR := $(MODULE_DIR)
PROGXEONTARGETS := $(MODULE_DIR)/decode-xeon.pl
REMOVEXEONBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(BINDIR)/%,$(PROGXEONTARGETS))
install-prog-xeon: $(PROGXEONTARGETS)
$(MKDIR) $(DESTDIR)$(BINDIR)
$(INSTALL) -m 755 $(PROGXEONTARGETS) $(DESTDIR)$(BINDIR)
user_install :: install-prog-xeon
user_uninstall::
$(RM) $(REMOVEXEONBIN)