Handle differences between engine IDs and their dynamic library names (and
[openssl.git] / engines / Makefile
index 8aa8fa691590a7cb40fb0f17dc747bf72bf6651c..bf19edfe0b64fc0c9fce0e8a1b4022b23bbb837d 100644 (file)
@@ -7,14 +7,6 @@ TOP=   ..
 CC=    cc
 INCLUDES= -I../include
 CFLAG=-g
-INSTALL_PREFIX=
-OPENSSLDIR=     /usr/local/ssl
-INSTALLTOP=/usr/local/ssl
-PERL=           perl
-NEWMAKE=       make
-MAKE=          $(NEWMAKE)
-MAKEDEPPROG=   makedepend
-MAKEDEPEND=    $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 MAKEFILE=      Makefile
 AR=            ar r
 
@@ -74,11 +66,8 @@ lib: $(LIBOBJ)
                set -e; \
                for l in $(LIBNAMES); do \
                        $(MAKE) -f ../Makefile.shared \
-                               CC="$(CC)" LIBNAME=$$l LIBEXTRAS=e_$$l.o \
+                               LIBNAME=$$l LIBEXTRAS=e_$$l.o \
                                LIBDEPS='-L.. -lcrypto $(EX_LIBS)' \
-                               CFLAG="$(CFLAG)" LDFLAGS="$(LDFLAGS)" \
-                               SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \
-                               PLATFORM="$(PLATFORM)" \
                                link_o.$(SHLIB_TARGET); \
                done; \
        else \
@@ -93,13 +82,19 @@ files:
 links:
 
 # XXXXX This currently only works on systems that use .so as suffix
-# for shared libraries.
+# for shared libraries as well as for Cygwin which uses the
+# dlfcn_name_converter and therefore stores the engines with .so suffix, too.
 install:
+       @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
        @if [ -n "$(SHARED_LIBS)" ]; then \
                set -e; \
                for l in $(LIBNAMES); do \
                        ( echo installing $$l; \
-                         cp lib$$l.so $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.so.new; \
+                         if [ "$(PLATFORM)" != "Cygwin" ]; then \
+                                 cp lib$$l.so $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.so.new; \
+                         else \
+                                 cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.so.new; \
+                         fi; \
                          chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.so.new; \
                          mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.so.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines/lib$$l.so ); \
                done; \
@@ -120,7 +115,11 @@ lint:
        lint -DLINT $(INCLUDES) $(SRC)>fluff
 
 depend:
-       $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
+       @if [ -z "$(THIS)" ]; then \
+           $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \
+       else \
+           $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC); \
+       fi
 
 dclean:
        $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new