Further BUILDENV clean-up, 'make depend' is operational again.
[openssl.git] / Makefile.org
index de6d7280af3323c6b2a843bb410be4d25a886a07..15b62d9567174e8b0e195c054f016bcfba508830 100644 (file)
@@ -111,15 +111,13 @@ SDIRS=  \
        bn ec rsa dsa ecdsa dh ecdh dso engine \
        buffer bio stack lhash rand err \
        evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
-       store
+       store pqueue
 
 # tests to perform.  "alltests" is a special word indicating that all tests
 # should be performed.
 TESTS = alltests
 
 MAKEFILE= Makefile
-NEWMAKE=  make
-MAKE=     $(NEWMAKE)
 
 MANDIR=$(OPENSSLDIR)/man
 MAN1=1
@@ -149,10 +147,12 @@ HEADER=         e_os.h
 all: Makefile build_all openssl.pc
 
 BUILDENV=      PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \
-               SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}'     \
                CC='${CC}' CFLAG='${CFLAG}'                     \
                AS='${CC}' ASFLAG='${CFLAG} -c'                 \
                AR='${AR}' PERL='${PERL}' RANLIB='${RANLIB}'    \
+               SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/lib'           \
+               INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}'   \
+               DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}'       \
                LDFLAGS="$(LDFLAGS)" SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \
                KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}'   \
                EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}'       \
@@ -165,16 +165,20 @@ BUILDENV= PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \
                RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}'       \
                SHA1_ASM_OBJ='${SHA1_ASM_OBJ}'                  \
                MD5_ASM_OBJ='${MD5_ASM_OBJ}'                    \
-               RMD160_ASM_OBJ='${RMD160_ASM_OBJ}'
+               RMD160_ASM_OBJ='${RMD160_ASM_OBJ}'              \
+               THIS=$${THIS:-$@}
 
 BUILD_CMD=if echo " $(DIRS) " | grep " $$dir " >/dev/null 2>/dev/null; then \
        if [ -d "$$dir" ]; then \
                (cd $$dir && echo "making $$target in $$dir..." && \
-               $(MAKE) -e $(BUILDENV) $$target ) || exit 1; \
+               $(MAKE) $(BUILDENV) $$target ) || exit 1; \
        else \
                $(MAKE) $$dir; \
        fi; fi
 
+reflect:
+       [ -n "$(THIS)" ] && $(MAKE) $(THIS) $(BIULDENV)
+
 sub_all: build_all
 build_all: build_libs build_apps build_tests build_tools
 
@@ -229,7 +233,7 @@ clean-shared:
 
 link-shared:
        @ set -e; for i in ${SHLIBDIRS}; do \
-               $(NEWMAKE) -f $(HERE)/Makefile.shared \
+               $(MAKE) -f $(HERE)/Makefile.shared \
                        LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
                        LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
                        symlink.$(SHLIB_TARGET); \
@@ -243,12 +247,10 @@ do_$(SHLIB_TARGET):
                if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
                        libs="$(LIBKRB5) $$libs"; \
                fi; \
-               $(NEWMAKE) -f Makefile.shared \
-                       $(BUILDENV) \
+               $(MAKE) -f Makefile.shared $(BUILDENV) \
                        LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
                        LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
                        LIBDEPS="$$libs $(EX_LIBS)" \
-                       LIBRPATH="$(INSTALLTOP)/lib" \
                        link_a.$(SHLIB_TARGET); \
                libs="-l$$i $$libs"; \
        done
@@ -266,8 +268,8 @@ openssl.pc: Makefile
            echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
            echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
 
-Makefile: Makefile.org
-       @echo "Makefile is older than Makefile.org."
+Makefile: Makefile.org Configure config
+       @echo "Makefile is older than Makefile.org, Configure or config."
        @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
        @false
 
@@ -337,7 +339,7 @@ test:   tests
 
 tests: rehash
        @(cd test && echo "testing..." && \
-       $(MAKE) -e $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
+       $(MAKE) $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
        util/opensslwrap.sh version -a
 
 report:
@@ -348,7 +350,7 @@ depend:
        do \
        if [ -d "$$i" ]; then \
                (cd $$i && echo "making dependencies $$i..." && \
-               $(MAKE) SDIRS='${SDIRS}' CFLAG='-DOPENSSL_NO_DEPRECATED ${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ) || exit 1; \
+               $(MAKE) $(BUILDENV) CFLAG='-DOPENSSL_NO_DEPRECATED ${CFLAG}' depend ) || exit 1; \
        fi; \
        done;
 
@@ -368,6 +370,7 @@ tags:
 errors:
        $(PERL) util/mkerr.pl -recurse -write
        (cd engines; $(MAKE) PERL=$(PERL) errors)
+       $(PERL) util/ck_errf.pl */*.c */*/*.c
 
 stacks:
        $(PERL) util/mkstack.pl -write
@@ -447,7 +450,7 @@ install_sw:
        do \
        if [ -d "$$i" ]; then \
                (cd $$i; echo "installing $$i..."; \
-               $(MAKE) $(BUILDENV) INSTALL_PREFIX='${INSTALL_PREFIX}' OPENSSLDIR='${OPENSSLDIR}' install ); \
+               $(MAKE) $(BUILDENV) install ); \
        fi; \
        done
        @set -e; for i in $(LIBS) ;\
@@ -483,7 +486,7 @@ install_sw:
                done; \
                (       here="`pwd`"; \
                        cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
-                       $(NEWMAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
+                       $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
                if [ "$(INSTALLTOP)" != "/usr" ]; then \
                        echo 'OpenSSL shared libraries have been installed in:'; \
                        echo '  $(INSTALLTOP)'; \
@@ -503,7 +506,7 @@ install_docs:
        @pod2man="`cd util; ./pod2mantest $(PERL)`"; \
        here="`pwd`"; \
        filecase=; \
-       if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" ]; then \
+       if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
                filecase=-i; \
        fi; \
        set -e; for i in doc/apps/*.pod; do \