@@ -354,7 +354,7 @@ OPENSSL_DIR-$(target)=build/$(os)/openssl-$(OPENSSL_VERSION)-$(target)
354
354
OPENSSL_SSL_LIB-$(target ) =$$(OPENSSL_DIR-$(target ) ) /_install/lib/libssl.a
355
355
OPENSSL_CRYPTO_LIB-$(target ) =$$(OPENSSL_DIR-$(target ) ) /_install/lib/libcrypto.a
356
356
357
- $$(OPENSSL_DIR-$(target ) ) /Makefile : downloads/openssl-$(OPENSSL_VERSION ) .tgz
357
+ $$(OPENSSL_DIR-$(target ) ) /is_configured : downloads/openssl-$(OPENSSL_VERSION ) .tgz
358
358
@echo ">>> Unpack and configure OpenSSL sources for $(target ) "
359
359
mkdir -p $$(OPENSSL_DIR-$(target ) )
360
360
tar zxf downloads/openssl-$(OPENSSL_VERSION ) .tgz --strip-components 1 -C $$(OPENSSL_DIR-$(target ) )
@@ -390,16 +390,23 @@ else
390
390
--prefix="$(PROJECT_DIR)/$$(OPENSSL_DIR-$(target))/_install" \
391
391
--openssldir=/etc/ssl \
392
392
2>&1 | tee -a ../openssl-$(target).config.log
393
-
394
393
endif
395
-
396
- $$(OPENSSL_DIR-$(target ) ) /libssl.a: $$(OPENSSL_DIR-$(target ) ) /Makefile
394
+ # The OpenSSL Makefile is... interesting. Invoking `make all` or `make
395
+ # install` *modifies the Makefile*. Therefore, we can't use the Makefile as
396
+ # a build dependency, because building/installing dirties the target that
397
+ # was a dependency. To compensate, create a dummy file as a marker for
398
+ # whether OpenSSL has been configured, and use *that* as a reference.
399
+ date > $$(OPENSSL_DIR-$(target ) ) /is_configured
400
+
401
+ $$(OPENSSL_DIR-$(target ) ) /libssl.a: $$(OPENSSL_DIR-$(target ) ) /is_configured
397
402
@echo ">>> Build OpenSSL for $(target ) "
403
+ # OpenSSL's `all` target modifies the Makefile;
404
+ # use the raw targets that make up all and it's dependencies
398
405
cd $$(OPENSSL_DIR-$(target ) ) && \
399
406
CC="$$(CC-$(target ) ) " \
400
407
CROSS_TOP="$$(dir $$(SDK_ROOT-$(target ) ) ) .." \
401
408
CROSS_SDK="$$(notdir $$(SDK_ROOT-$(target ) ) ) " \
402
- make depend _all \
409
+ make all \
403
410
2>&1 | tee -a ../openssl-$(target ) .build.log
404
411
405
412
$$(OPENSSL_SSL_LIB-$(target ) ) : $$(OPENSSL_DIR-$(target ) ) /libssl.a
@@ -718,11 +725,6 @@ OPENSSL_XCFRAMEWORK-$(os)=build/$(os)/Support/OpenSSL.xcframework
718
725
719
726
$$(OPENSSL_XCFRAMEWORK-$(os ) ) : $$(foreach sdk,$$(SDKS-$(os ) ) ,$$(OPENSSL_FATLIB-$$(sdk ) ) )
720
727
@echo ">>> Create OpenSSL.XCFramework on $(os ) "
721
- # The OpenSSL Makefile leaves the build in a "dirty" state; running the same build
722
- # twice in a row results in parts of the build being repeated, which then causes
723
- # other targets in *this* Makefile to trigger. To avoid problems, delete the
724
- # XCFramework every time and rebuild it.
725
- rm -rf $$(OPENSSL_XCFRAMEWORK-$(os ) )
726
728
mkdir -p $$(OPENSSL_XCFRAMEWORK-$(os ) )
727
729
xcodebuild -create-xcframework \
728
730
-output $$@ $$(foreach sdk,$$(SDKS-$(os ) ) ,-library $$(OPENSSL_FATLIB-$$(sdk ) ) -headers build/$(os ) /openssl/$$(sdk ) /include) \
0 commit comments