@@ -111,7 +111,7 @@ all: $(OS_LIST)
111
111
112
112
.PHONY : \
113
113
all clean distclean update-patch vars \
114
- $(foreach product,$(PRODUCTS ) ,$(foreach os,$(OS_LIST ) ,$(product ) $(product ) -$(os ) clean-$(product ) ) ) \
114
+ $(foreach product,$(PRODUCTS ) ,$(foreach os,$(OS_LIST ) ,$(product ) $(product ) -$(os ) clean-$(product ) clean- $( product ) - $( os ) ) ) \
115
115
$(foreach os,$(OS_LIST ) ,$(os ) clean-$(os ) vars-$(os ) )
116
116
117
117
# Clean all builds
@@ -139,14 +139,6 @@ update-patch:
139
139
# Setup: BZip2
140
140
# ##########################################################################
141
141
142
- # Clean the bzip2 project
143
- clean-BZip2 :
144
- @echo " >>> Clean BZip2 build products"
145
- rm -rf build/* /bzip2-$(BZIP2_VERSION ) -* \
146
- build/* /bzip2 \
147
- build/* /bzip2-* .log \
148
- build/* /Support/BZip2.xcframework
149
-
150
142
# Download original BZip2 source code archive.
151
143
downloads/bzip2-$(BZIP2_VERSION ) .tgz :
152
144
@echo " >>> Download BZip2 sources"
@@ -160,14 +152,6 @@ downloads/bzip2-$(BZIP2_VERSION).tgz:
160
152
# Setup: XZ (LZMA)
161
153
# ##########################################################################
162
154
163
- # Clean the XZ project
164
- clean-XZ :
165
- @echo " >>> Clean XZ build products"
166
- rm -rf build/* /xz-$(XZ_VERSION ) -* \
167
- build/* /xz \
168
- build/* /xz-* .log \
169
- build/* /Support/XZ.xcframework
170
-
171
155
# Download original XZ source code archive.
172
156
downloads/xz-$(XZ_VERSION ) .tgz :
173
157
@echo " >>> Download XZ sources"
@@ -183,14 +167,6 @@ downloads/xz-$(XZ_VERSION).tgz:
183
167
# Felix Shchulze (@x2on) https://github.com/x2on/OpenSSL-for-iPhone
184
168
# ##########################################################################
185
169
186
- # Clean the OpenSSL project
187
- clean-OpenSSL :
188
- @echo " >>> Clean OpenSSL build products"
189
- rm -rf build/* /openssl-$(OPENSSL_VERSION ) -* \
190
- build/* /openssl \
191
- build/* /openssl-* .log \
192
- build/* /Support/OpenSSL.xcframework
193
-
194
170
# Download original OpenSSL source code archive.
195
171
downloads/openssl-$(OPENSSL_VERSION ) .tgz :
196
172
@echo " >>> Download OpenSSL sources"
@@ -208,13 +184,6 @@ downloads/openssl-$(OPENSSL_VERSION).tgz:
208
184
# Setup: libFFI
209
185
# ##########################################################################
210
186
211
- # Clean the libFFI project
212
- clean-libFFI :
213
- @echo " >>> Clean libFFI build products"
214
- rm -rf build/* /libffi-$(LIBFFI_VERSION ) \
215
- build/* /libffi-* .log \
216
- build/* /Support/libFFI.xcframework
217
-
218
187
# Download original XZ source code archive.
219
188
downloads/libffi-$(LIBFFI_VERSION ) .tgz :
220
189
@echo " >>> Download libFFI sources"
@@ -228,28 +197,6 @@ downloads/libffi-$(LIBFFI_VERSION).tgz:
228
197
# Setup: Python
229
198
# ##########################################################################
230
199
231
- # Clean the Python project
232
- clean-Python :
233
- @echo " >>> Clean Python build products"
234
- rm -rf \
235
- dist/Python-$(PYTHON_VER ) -* \
236
- build/* /Python-$(PYTHON_VERSION ) -* \
237
- build/* /python \
238
- build/* /python-* .log \
239
- build/* /Support/Python.xcframework \
240
- build/* /Support/Python
241
-
242
- dev-clean-Python :
243
- @echo " >>> Partially clean Python build products to the point where local code modifications can be made"
244
- rm -rf \
245
- dist/Python-$(PYTHON_VER ) -* \
246
- build/* /Python-$(PYTHON_VERSION ) -* /python.exe \
247
- build/* /Python-$(PYTHON_VERSION ) -* /_install \
248
- build/* /python \
249
- build/* /python-* .log \
250
- build/* /Support/Python.xcframework \
251
- build/* /Support/Python
252
-
253
200
# Download original Python source code archive.
254
201
downloads/Python-$(PYTHON_VERSION ) .tgz :
255
202
@echo " >>> Download Python sources"
@@ -466,6 +413,7 @@ $$(PYTHON_DIR-$(target))/Makefile: \
466
413
$$(XZ_XCFRAMEWORK-$(os ) ) \
467
414
$$(OPENSSL_XCFRAMEWORK-$(os ) ) \
468
415
$$(LIBFFI_XCFRAMEWORK-$(os ) ) \
416
+ $$(PYTHON_XCFRAMEWORK-macOS ) \
469
417
downloads/Python-$(PYTHON_VERSION ) .tgz
470
418
@echo " >>> Unpack and configure Python for $( target) "
471
419
mkdir -p $$(PYTHON_DIR-$(target ) )
@@ -702,6 +650,13 @@ $$(BZIP2_XCFRAMEWORK-$(os)): $$(foreach sdk,$$(SDKS-$(os)),$$(BZIP2_FATLIB-$$(sd
702
650
703
651
BZip2-$(os ) : $$(BZIP2_XCFRAMEWORK-$(os ) )
704
652
653
+ clean-BZip2-$(os ) :
654
+ @echo ">>> Clean BZip2 build products on $(os ) "
655
+ rm -rf build/$(os ) /bzip2-$(BZIP2_VERSION ) -* \
656
+ build/$(os ) /bzip2 \
657
+ build/$(os ) /bzip2-*.log \
658
+ build/$(os ) /Support/BZip2.xcframework
659
+
705
660
# ##########################################################################
706
661
# Build: XZ (LZMA)
707
662
# ##########################################################################
@@ -717,6 +672,13 @@ $$(XZ_XCFRAMEWORK-$(os)): $$(foreach sdk,$$(SDKS-$(os)),$$(XZ_FATLIB-$$(sdk)))
717
672
718
673
XZ-$(os ) : $$(XZ_XCFRAMEWORK-$(os ) )
719
674
675
+ clean-XZ-$(os ) :
676
+ @echo ">>> Clean XZ build products on $(os ) "
677
+ rm -rf build/$(os ) /xz-$(XZ_VERSION ) -* \
678
+ build/$(os ) /xz \
679
+ build/$(os ) /xz-*.log \
680
+ build/$(os ) /Support/XZ.xcframework
681
+
720
682
# ##########################################################################
721
683
# Build: OpenSSL
722
684
# ##########################################################################
@@ -732,6 +694,13 @@ $$(OPENSSL_XCFRAMEWORK-$(os)): $$(foreach sdk,$$(SDKS-$(os)),$$(OPENSSL_FATLIB-$
732
694
733
695
OpenSSL-$(os ) : $$(OPENSSL_XCFRAMEWORK-$(os ) )
734
696
697
+ clean-OpenSSL-$(os ) :
698
+ @echo ">>> Clean OpenSSL build products on $(os ) "
699
+ rm -rf build/$(os ) /openssl-$(OPENSSL_VERSION ) -* \
700
+ build/$(os ) /openssl \
701
+ build/$(os ) /openssl-*.log \
702
+ build/$(os ) /Support/OpenSSL.xcframework
703
+
735
704
# ##########################################################################
736
705
# Build: libFFI
737
706
# ##########################################################################
@@ -743,14 +712,15 @@ ifneq ($(os),macOS)
743
712
LIBFFI_XCFRAMEWORK-$(os) =build/$(os ) /Support/libFFI.xcframework
744
713
LIBFFI_DIR-$(os) =build/$(os ) /libffi-$(LIBFFI_VERSION )
745
714
746
- $$(LIBFFI_DIR-$(os ) ) /darwin_common/include/ffi.h : downloads/libffi-$(LIBFFI_VERSION ) .tgz
715
+ $$(LIBFFI_DIR-$(os ) ) /darwin_common/include/ffi.h : downloads/libffi-$(LIBFFI_VERSION ) .tgz $$( PYTHON_XCFRAMEWORK-macOS )
747
716
@echo " >>> Unpack and configure libFFI sources on $( os) "
748
717
mkdir -p $$(LIBFFI_DIR-$(os ) )
749
718
tar zxf downloads/libffi-$(LIBFFI_VERSION ) .tgz --strip-components 1 -C $$(LIBFFI_DIR-$(os ) )
750
719
# Patch the build to add support for new platforms
751
720
cd $$(LIBFFI_DIR-$(os ) ) && patch -p1 < $(PROJECT_DIR ) /patch/libffi.patch
752
721
# Configure the build
753
722
cd $$(LIBFFI_DIR-$(os ) ) && \
723
+ PATH=$(PROJECT_DIR ) /$(PYTHON_DIR-macOS ) /_install/bin:$(PATH ) \
754
724
python$(PYTHON_VER ) generate-darwin-source-and-headers.py --only-$(shell echo $(os ) | tr '[:upper:]' '[:lower:]') \
755
725
2>&1 | tee -a ../libffi-$(os ) .config.log
756
726
@@ -761,9 +731,15 @@ $$(LIBFFI_XCFRAMEWORK-$(os)): $$(foreach sdk,$$(SDKS-$(os)),$$(LIBFFI_FATLIB-$$(
761
731
-output $$@ $$(foreach sdk,$$(SDKS-$(os ) ) ,-library $$(LIBFFI_FATLIB-$$(sdk ) ) -headers $$(LIBFFI_DIR-$(os ) ) /_install/$$(sdk ) /include) \
762
732
2>&1 | tee -a build/$(os ) /libffi-$(os ) .xcframework.log
763
733
734
+ endif
735
+
764
736
libFFI-$(os ) : $$(LIBFFI_XCFRAMEWORK-$(os ) )
765
737
766
- endif
738
+ clean-libFFI-$(os ) :
739
+ @echo ">>> Clean libFFI build products on $(os ) "
740
+ rm -rf build/$(os ) /libffi-$(LIBFFI_VERSION ) \
741
+ build/$(os ) /libffi-*.log \
742
+ build/$(os ) /Support/libFFI.xcframework
767
743
768
744
769
745
# ##########################################################################
@@ -847,6 +823,27 @@ $$(PYTHON_XCFRAMEWORK-$(os)): $$(foreach sdk,$$(SDKS-$(os)),$$(PYTHON_FATLIB-$$(
847
823
848
824
Python-$(os ) : dist/Python-$(PYTHON_VER ) -$(os ) -support.$(BUILD_NUMBER ) .tar.gz
849
825
826
+ clean-Python-$(os ) :
827
+ @echo ">>> Clean Python build products on $(os ) "
828
+ rm -rf \
829
+ dist/Python-$(PYTHON_VER ) -$(os ) \
830
+ build/$(os ) /Python-$(PYTHON_VERSION ) -* \
831
+ build/$(os ) /python \
832
+ build/$(os ) /python-*.log \
833
+ build/$(os ) /Support/Python.xcframework \
834
+ build/$(os ) /Support/Python
835
+
836
+ dev-clean-Python-$(os ) :
837
+ @echo ">>> Partially clean Python build products on $(os ) so that local code modifications can be made"
838
+ rm -rf \
839
+ dist/Python-$(PYTHON_VER ) -$(os ) -* \
840
+ build/$(os ) /Python-$(PYTHON_VERSION ) -*/python.exe \
841
+ build/$(os ) /Python-$(PYTHON_VERSION ) -*/_install \
842
+ build/$(os ) /python \
843
+ build/$(os ) /python-*.log \
844
+ build/$(os ) /Support/Python.xcframework \
845
+ build/$(os ) /Support/Python
846
+
850
847
# ##########################################################################
851
848
# Build
852
849
# ##########################################################################
@@ -909,12 +906,22 @@ endef # build
909
906
# Dump environment variables (for debugging purposes)
910
907
vars : $(foreach os,$(OS_LIST ) ,vars-$(os ) )
911
908
912
- # Expand cross-platform build targets for each output product
909
+ # Expand cross-platform build and clean targets for each output product
913
910
XZ : $(foreach os,$(OS_LIST ) ,XZ-$(os ) )
911
+ clean-XZ : $(foreach os,$(OS_LIST ) ,clean-XZ-$(os ) )
912
+
914
913
BZip2 : $(foreach os,$(OS_LIST ) ,BZip2-$(os ) )
914
+ clean-BZip2 : $(foreach os,$(OS_LIST ) ,clean-BZip2-$(os ) )
915
+
915
916
OpenSSL : $(foreach os,$(OS_LIST ) ,OpenSSL-$(os ) )
917
+ clean-OpenSSL : $(foreach os,$(OS_LIST ) ,clean-OpenSSL-$(os ) )
918
+
916
919
libFFI : $(foreach os,$(OS_LIST ) ,libFFI-$(os ) )
920
+ clean-libFFI : $(foreach os,$(OS_LIST ) ,clean-libFFI-$(os ) )
921
+
917
922
Python : $(foreach os,$(OS_LIST ) ,Python-$(os ) )
923
+ clean-Python : $(foreach os,$(OS_LIST ) ,clean-Python-$(os ) )
924
+ dev-clean-Python : $(foreach os,$(OS_LIST ) ,dev-clean-Python-$(os ) )
918
925
919
926
# Expand the build macro for every OS
920
927
$(foreach os,$(OS_LIST),$(eval $(call build,$(os))))
0 commit comments