Improve handling of NO_STATIC and NO_SHARED
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Sat, 2 Mar 2019 22:36:36 +0000 (23:36 +0100)
committerGitHub <noreply@github.com>
Sat, 2 Mar 2019 22:36:36 +0000 (23:36 +0100)
to avoid surprises from defining either as zero. Fixes #2035 by addressing some concerns from #1422

Makefile
Makefile.install

index 21096f8..273fde3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -96,7 +96,7 @@ endif
        @echo
 
 shared :
-ifndef NO_SHARED
+ifneq ($(NO_SHARED), 1)
 ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku))
        @$(MAKE) -C exports so
        @ln -fs $(LIBSONAME) $(LIBPREFIX).so
index 069c96c..fefecd9 100644 (file)
@@ -58,14 +58,14 @@ ifndef NO_LAPACKE
 endif
 
 #for install static library
-ifndef NO_STATIC
+ifneq ($(NO_STATIC),1)
        @echo Copying the static library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
        @install -pm644 $(LIBNAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
        @cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
        ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
 endif
 #for install shared library
-ifndef NO_SHARED
+ifneq ($(NO_SHARED),1)
        @echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
 ifeq ($(OSNAME), $(filter $(OSNAME),Linux SunOS Android Haiku))
        @install -pm755 $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
@@ -106,14 +106,14 @@ ifndef NO_LAPACKE
 endif
 
 #for install static library
-ifndef NO_STATIC
+ifneq ($(NO_STATIC),1)
        @echo Copying the static library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
        @installbsd -c -m 644 $(LIBNAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
        @cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
        ln -fs $(LIBNAME) $(LIBPREFIX).$(LIBSUFFIX)
 endif
 #for install shared library
-ifndef NO_SHARED
+ifneq ($(NO_SHARED),1)
        @echo Copying the shared library to $(DESTDIR)$(OPENBLAS_LIBRARY_DIR)
        @installbsd -c -m 755 $(LIBSONAME) "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)"
        @cd "$(DESTDIR)$(OPENBLAS_LIBRARY_DIR)" ; \
@@ -138,7 +138,7 @@ endif
        @echo "SET(OpenBLAS_VERSION \"${VERSION}\")" > "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"
        @echo "SET(OpenBLAS_INCLUDE_DIRS ${OPENBLAS_INCLUDE_DIR})" >> "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"
 
-ifndef NO_SHARED
+ifneq ($(NO_SHARED),1)
 #ifeq logical or
 ifeq ($(OSNAME), $(filter $(OSNAME),Linux FreeBSD NetBSD OpenBSD DragonFly))
        @echo "SET(OpenBLAS_LIBRARIES ${OPENBLAS_LIBRARY_DIR}/$(LIBPREFIX).so)" >> "$(DESTDIR)$(OPENBLAS_CMAKE_DIR)/$(OPENBLAS_CMAKE_CONFIG)"