@@ -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 ) )
@@ -700,6 +648,13 @@ $$(BZIP2_XCFRAMEWORK-$(os)): $$(foreach sdk,$$(SDKS-$(os)),$$(BZIP2_FATLIB-$$(sd
700
648
701
649
BZip2-$(os ) : $$(BZIP2_XCFRAMEWORK-$(os ) )
702
650
651
+ clean-BZip2-$(os ) :
652
+ @echo ">>> Clean BZip2 build products on $(os ) "
653
+ rm -rf build/$(os ) /bzip2-$(BZIP2_VERSION ) -* \
654
+ build/$(os ) /bzip2 \
655
+ build/$(os ) /bzip2-*.log \
656
+ build/$(os ) /Support/BZip2.xcframework
657
+
703
658
# ##########################################################################
704
659
# Build: XZ (LZMA)
705
660
# ##########################################################################
@@ -715,6 +670,13 @@ $$(XZ_XCFRAMEWORK-$(os)): $$(foreach sdk,$$(SDKS-$(os)),$$(XZ_FATLIB-$$(sdk)))
715
670
716
671
XZ-$(os ) : $$(XZ_XCFRAMEWORK-$(os ) )
717
672
673
+ clean-XZ-$(os ) :
674
+ @echo ">>> Clean XZ build products on $(os ) "
675
+ rm -rf build/$(os ) /xz-$(XZ_VERSION ) -* \
676
+ build/$(os ) /xz \
677
+ build/$(os ) /xz-*.log \
678
+ build/$(os ) /Support/XZ.xcframework
679
+
718
680
# ##########################################################################
719
681
# Build: OpenSSL
720
682
# ##########################################################################
@@ -730,6 +692,13 @@ $$(OPENSSL_XCFRAMEWORK-$(os)): $$(foreach sdk,$$(SDKS-$(os)),$$(OPENSSL_FATLIB-$
730
692
731
693
OpenSSL-$(os ) : $$(OPENSSL_XCFRAMEWORK-$(os ) )
732
694
695
+ clean-OpenSSL-$(os ) :
696
+ @echo ">>> Clean OpenSSL build products on $(os ) "
697
+ rm -rf build/$(os ) /openssl-$(OPENSSL_VERSION ) -* \
698
+ build/$(os ) /openssl \
699
+ build/$(os ) /openssl-*.log \
700
+ build/$(os ) /Support/OpenSSL.xcframework
701
+
733
702
# ##########################################################################
734
703
# Build: libFFI
735
704
# ##########################################################################
@@ -741,14 +710,15 @@ ifneq ($(os),macOS)
741
710
LIBFFI_XCFRAMEWORK-$(os) =build/$(os ) /Support/libFFI.xcframework
742
711
LIBFFI_DIR-$(os) =build/$(os ) /libffi-$(LIBFFI_VERSION )
743
712
744
- $$(LIBFFI_DIR-$(os ) ) /darwin_common/include/ffi.h : downloads/libffi-$(LIBFFI_VERSION ) .tgz
713
+ $$(LIBFFI_DIR-$(os ) ) /darwin_common/include/ffi.h : downloads/libffi-$(LIBFFI_VERSION ) .tgz $$( PYTHON_XCFRAMEWORK-macOS )
745
714
@echo " >>> Unpack and configure libFFI sources on $( os) "
746
715
mkdir -p $$(LIBFFI_DIR-$(os ) )
747
716
tar zxf downloads/libffi-$(LIBFFI_VERSION ) .tgz --strip-components 1 -C $$(LIBFFI_DIR-$(os ) )
748
717
# Patch the build to add support for new platforms
749
718
cd $$(LIBFFI_DIR-$(os ) ) && patch -p1 < $(PROJECT_DIR ) /patch/libffi.patch
750
719
# Configure the build
751
720
cd $$(LIBFFI_DIR-$(os ) ) && \
721
+ PATH=$(PROJECT_DIR ) /$(PYTHON_DIR-macOS ) /_install/bin:$(PATH ) \
752
722
python$(PYTHON_VER ) generate-darwin-source-and-headers.py --only-$(shell echo $(os ) | tr '[:upper:]' '[:lower:]') \
753
723
2>&1 | tee -a ../libffi-$(os ) .config.log
754
724
@@ -759,9 +729,15 @@ $$(LIBFFI_XCFRAMEWORK-$(os)): $$(foreach sdk,$$(SDKS-$(os)),$$(LIBFFI_FATLIB-$$(
759
729
-output $$@ $$(foreach sdk,$$(SDKS-$(os ) ) ,-library $$(LIBFFI_FATLIB-$$(sdk ) ) -headers $$(LIBFFI_DIR-$(os ) ) /_install/$$(sdk ) /include) \
760
730
2>&1 | tee -a build/$(os ) /libffi-$(os ) .xcframework.log
761
731
732
+ endif
733
+
762
734
libFFI-$(os ) : $$(LIBFFI_XCFRAMEWORK-$(os ) )
763
735
764
- endif
736
+ clean-libFFI-$(os ) :
737
+ @echo ">>> Clean libFFI build products on $(os ) "
738
+ rm -rf build/$(os ) /libffi-$(LIBFFI_VERSION ) \
739
+ build/$(os ) /libffi-*.log \
740
+ build/$(os ) /Support/libFFI.xcframework
765
741
766
742
767
743
# ##########################################################################
@@ -845,6 +821,27 @@ $$(PYTHON_XCFRAMEWORK-$(os)): $$(foreach sdk,$$(SDKS-$(os)),$$(PYTHON_FATLIB-$$(
845
821
846
822
Python-$(os ) : dist/Python-$(PYTHON_VER ) -$(os ) -support.$(BUILD_NUMBER ) .tar.gz
847
823
824
+ clean-Python-$(os ) :
825
+ @echo ">>> Clean Python build products on $(os ) "
826
+ rm -rf \
827
+ dist/Python-$(PYTHON_VER ) -$(os ) \
828
+ build/$(os ) /Python-$(PYTHON_VERSION ) -* \
829
+ build/$(os ) /python \
830
+ build/$(os ) /python-*.log \
831
+ build/$(os ) /Support/Python.xcframework \
832
+ build/$(os ) /Support/Python
833
+
834
+ dev-clean-Python-$(os ) :
835
+ @echo ">>> Partially clean Python build products on $(os ) so that local code modifications can be made"
836
+ rm -rf \
837
+ dist/Python-$(PYTHON_VER ) -$(os ) -* \
838
+ build/$(os ) /Python-$(PYTHON_VERSION ) -*/python.exe \
839
+ build/$(os ) /Python-$(PYTHON_VERSION ) -*/_install \
840
+ build/$(os ) /python \
841
+ build/$(os ) /python-*.log \
842
+ build/$(os ) /Support/Python.xcframework \
843
+ build/$(os ) /Support/Python
844
+
848
845
# ##########################################################################
849
846
# Build
850
847
# ##########################################################################
@@ -907,12 +904,21 @@ endef # build
907
904
# Dump environment variables (for debugging purposes)
908
905
vars : $(foreach os,$(OS_LIST ) ,vars-$(os ) )
909
906
910
- # Expand cross-platform build targets for each output product
907
+ # Expand cross-platform build and clean targets for each output product
911
908
XZ : $(foreach os,$(OS_LIST ) ,XZ-$(os ) )
909
+ clean-XZ : $(foreach os,$(OS_LIST ) ,clean-XZ-$(os ) )
910
+
912
911
BZip2 : $(foreach os,$(OS_LIST ) ,BZip2-$(os ) )
912
+ clean-BZip2 : $(foreach os,$(OS_LIST ) ,clean-BZip2-$(os ) )
913
+
913
914
OpenSSL : $(foreach os,$(OS_LIST ) ,OpenSSL-$(os ) )
915
+ clean-OpenSSL : $(foreach os,$(OS_LIST ) ,clean-OpenSSL-$(os ) )
916
+
914
917
libFFI : $(foreach os,$(OS_LIST ) ,libFFI-$(os ) )
918
+ clean-libFFI : $(foreach os,$(OS_LIST ) ,clean-libFFI-$(os ) )
919
+
915
920
Python : $(foreach os,$(OS_LIST ) ,Python-$(os ) )
921
+ clean-Python : $(foreach os,$(OS_LIST ) ,clean-Python-$(os ) dev-clean-Python-$(os ) )
916
922
917
923
# Expand the build macro for every OS
918
924
$(foreach os,$(OS_LIST),$(eval $(call build,$(os))))
0 commit comments