Skip to content

Commit b9fe79a

Browse files
committed
Add some protection against rebuilds on OpenSSL.
1 parent bfd6df8 commit b9fe79a

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

Makefile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,16 +299,26 @@ else
299299

300300
endif
301301

302-
$$(OPENSSL_SSL_LIB-$(target)) $$(OPENSSL_CRYPTO_LIB-$(target)): $$(OPENSSL_DIR-$(target))/Makefile
303-
@echo ">>> Build and install OpenSSL for $(target)"
302+
$$(OPENSSL_DIR-$(target))/libssl.a: $$(OPENSSL_DIR-$(target))/Makefile
303+
@echo ">>> Build OpenSSL for $(target)"
304304
# Make and install just the software (not the docs)
305305
cd $$(OPENSSL_DIR-$(target)) && \
306306
CC="$$(CC-$(target))" \
307307
CROSS_TOP="$$(dir $$(SDK_ROOT-$(target))).." \
308308
CROSS_SDK="$$(notdir $$(SDK_ROOT-$(target)))" \
309-
make install_sw \
309+
make depend _all\
310310
2>&1 | tee ../openssl-$(target).build.log
311311

312+
$$(OPENSSL_SSL_LIB-$(target)) $$(OPENSSL_CRYPTO_LIB-$(target)): $$(OPENSSL_DIR-$(target))/libssl.a
313+
@echo ">>> Install OpenSSL for $(target)"
314+
# Install just the software (not the docs)
315+
cd $$(OPENSSL_DIR-$(target)) && \
316+
CC="$$(CC-$(target))" \
317+
CROSS_TOP="$$(dir $$(SDK_ROOT-$(target))).." \
318+
CROSS_SDK="$$(notdir $$(SDK_ROOT-$(target)))" \
319+
make install_sw \
320+
2>&1 | tee ../openssl-$(target).install.log
321+
312322
###########################################################################
313323
# Target: BZip2
314324
###########################################################################
@@ -586,6 +596,11 @@ OPENSSL_XCFRAMEWORK-$(os)=build/$(os)/Support/OpenSSL.xcframework
586596

587597
$$(OPENSSL_XCFRAMEWORK-$(os)): $$(foreach sdk,$$(SDKS-$(os)),$$(OPENSSL_FATLIB-$$(sdk)))
588598
@echo ">>> Create OpenSSL.XCFramework on $(os)"
599+
# The OpenSSL Makefile leaves the build in a "dirty" state; running the same build
600+
# twice in a row results in parts of the build being repeated, which then causes
601+
# other targets in *this* Makefile to trigger. To avoid problems, delete the
602+
# XCFramework every time and rebuild it.
603+
rm -rf $$(OPENSSL_XCFRAMEWORK-$(os))
589604
mkdir -p $$(OPENSSL_XCFRAMEWORK-$(os))
590605
xcodebuild -create-xcframework \
591606
-output $$@ $$(foreach sdk,$$(SDKS-$(os)),-library $$(OPENSSL_FATLIB-$$(sdk)) -headers build/$(os)/openssl/$$(sdk)/include)

0 commit comments

Comments
 (0)