diff --git a/CHANGES b/CHANGES index ac14ffef..65b97620 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,7 @@ SVN-HEAD isadump: Use geteuid instead of getuid so that setuid bit works isaset: Use geteuid instead of getuid so that setuid bit works Makefile: Include generated source files in dependency checking + Make it possible to skip building of the static library sensors-detect: Add nNidia nForce MCP78S SMBus detection Display Super-I/O address even if LD is disabled Differentiate between PC8374L and WPCD377I diff --git a/Makefile b/Makefile index d425f6c0..6f2d0d9c 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,10 @@ MANDIR := $(PREFIX)/man MACHINE := $(shell uname -m) # Extra non-default programs to build; e.g., sensord -# PROG_EXTRA := sensord +#PROG_EXTRA := sensord + +# Build and install static library +BUILD_STATIC_LIB := 1 # Set these to add preprocessor or compiler flags, or use # environment variables diff --git a/lib/Module.mk b/lib/Module.mk index a7aefc44..3390c74f 100644 --- a/lib/Module.mk +++ b/lib/Module.mk @@ -43,8 +43,11 @@ LIBSHLIBNAME := libsensors.so.$(LIBVER) LIBSTLIBNAME := libsensors.a LIBSHSONAME := libsensors.so.$(LIBMAINVER) -LIBTARGETS := $(MODULE_DIR)/$(LIBSTLIBNAME) $(MODULE_DIR)/$(LIBSHLIBNAME) \ +LIBTARGETS := $(MODULE_DIR)/$(LIBSHLIBNAME) \ $(MODULE_DIR)/$(LIBSHSONAME) $(MODULE_DIR)/$(LIBSHBASENAME) +ifeq ($(BUILD_STATIC_LIB),1) +LIBTARGETS += $(MODULE_DIR)/$(LIBSTLIBNAME) +endif LIBCSOURCES := $(MODULE_DIR)/data.c $(MODULE_DIR)/general.c \ $(MODULE_DIR)/error.c $(MODULE_DIR)/access.c \ @@ -125,7 +128,9 @@ install-lib: all-lib echo ' Run the following command: /sbin/ldconfig' ; \ echo '******************************************************************************' ; \ fi +ifeq ($(BUILD_STATIC_LIB),1) $(INSTALL) -m 644 $(LIB_DIR)/$(LIBSTLIBNAME) $(DESTDIR)$(LIBDIR) +endif $(INSTALL) -m 755 $(LIB_DIR)/$(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR) $(LN) $(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBSHSONAME) $(LN) $(LIBSHSONAME) $(DESTDIR)$(LIBDIR)/$(LIBSHBASENAME) @@ -156,7 +161,10 @@ install-lib: all-lib user_install :: install-lib user_uninstall:: - $(RM) $(REMOVELIBST) $(REMOVELIBSH) $(REMOVELNSO) $(REMOVELNBS) + $(RM) $(REMOVELIBSH) $(REMOVELNSO) $(REMOVELNBS) +ifeq ($(BUILD_STATIC_LIB),1) + $(RM) $(REMOVELIBST) +endif $(RM) $(REMOVELIBHF) $(REMOVEMAN3) $(REMOVEMAN5) # Remove directory if empty, ignore failure $(RMDIR) $(DESTDIR)$(LIBINCLUDEDIR) 2> /dev/null || true