-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Makefile
3308 lines (3084 loc) · 126 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
## User-specified vars
ifeq ($(SZA),)
$(error Must specify SZA)
endif
ifeq ($(EDITION),)
$(error Must specify EDITION)
endif
ifeq ($(STAGING_PREFIX),)
$(error Must specify STAGING_PREFIX)
endif
ifeq ($(BUILD_TYPE),)
$(error Must specify BUILD_TYPE)
endif
ifeq ($(BUILD),)
$(error Must specify BUILD platform)
endif
ifeq ($(BUILD_TYPE),cross)
ifeq ($(HOST),)
$(error Must specify HOST platform)
endif
ifeq ($(TARGET),)
$(error Must specify TARGET platform)
endif
ifeq ($(BUILD_TOOLCHAIN),)
$(error Must specify BUILD_TOOLCHAIN)
endif
endif
ifeq ($(LANGS),)
$(error Must specify LANGS)
endif
ifeq ($(EXCEPTIONS),)
$(error Must specify EXCEPTIONS)
endif
ifeq ($(THREAD_TYPE),)
$(error Must specify THREAD_TYPE)
endif
ifeq ($(HOST_TOOLCHAIN),)
$(error Must specify HOST_TOOLCHAIN)
endif
ifeq ($(GMP_SRC),)
$(error Must specify GMP_SRC)
endif
ifeq ($(MPFR_SRC),)
$(error Must specify MPFR_SRC)
endif
ifeq ($(MPC_SRC),)
$(error Must specify MPC_SRC)
endif
ifneq ($(filter gdb,$(MAKE_PACKAGES)),)
ifeq ($(PYTHON_DIR),)
$(error Must specify PYTHON_DIR)
endif
ifeq ($(PYTHON_DLL),)
$(error Must specify PYTHON_DLL)
endif
ifeq ($(EXPAT_SRC),)
$(error Must specify EXPAT_SRC)
endif
ifeq ($(NCURSES_SRC),)
$(error Must specify NCURSES_SRC)
endif
ifeq ($(READLINE_SRC),)
$(error Must specify READLINE_SRC)
endif
ifeq ($(TERMCAP_SRC),)
$(error Must specify TERMCAP_SRC)
endif
endif
ifeq ($(BUILD_TYPE),native)
ifeq ($(DISTRIB_BASE),)
$(error Must specify DISTRIB_BASE)
endif
endif
JOBS_ARG :=
## Composited vars
BUILD_BASE := $(shell pwd)
BUILD_BASE_WIN := $(shell /bin/sh -c "pwd -W")
THIS_MAKEFILE_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
SCRATCH := $(BUILD_BASE)/build-$(EDITION)
SCRATCH_WIN := $(BUILD_BASE_WIN)/build-$(EDITION)
BUILDFROM := $(BUILD_BASE)/host-toolchain-$(EDITION)
DISTRIB := $(BUILD_BASE)/distrib/$(EDITION)-$(EXCEPTIONS)
ifeq ($(BUILD_TYPE),native)
HOST := $(BUILD)
TARGET := $(BUILD)
endif
ifneq ($(PKGVERSION),)
PKGVERSION_OPT := --with-pkgversion="$(PKGVERSION)"
endif
PKG_BINUTILS := $(BUILD_BASE)/binutils-pkg-$(EDITION)
PKG_RUNTIME := $(BUILD_BASE)/runtime-pkg-$(EDITION)
PKG_GCC := $(BUILD_BASE)/gcc-pkg-$(EDITION)-$(EXCEPTIONS)
PKG_GDB := $(BUILD_BASE)/gdb-pkg-$(EDITION)
ifeq ($(BIARCH),1)
BINUTILS_TARGETS_OPT := --enable-targets=x86_64-w64-mingw32,i686-w64-mingw32
GDB_TARGETS_OPT := --enable-targets=x86_64-w64-mingw32,i686-w64-mingw32
GCC_TARGETS_OPT := --enable-targets=all
ENABLE_LIB32_OPT := --enable-lib32
else
BINUTILS_TARGETS_OPT := --disable-multilib
GCC_TARGETS_OPT := --disable-multilib
endif
MAYBEGCCVERSUFFIX=
ifeq ($(EXCEPTIONS),sjlj)
EXCEPTIONS_OPT := --enable-sjlj-exceptions
EXCEPTIONS_CAPS=SJLJ
endif
ifeq ($(EXCEPTIONS),dw2)
EXCEPTIONS_OPT := --disable-sjlj-exceptions --program-suffix=-dw2
MAYBEGCCVERSUFFIX=-dw2
EXCEPTIONS_CAPS=DW2
endif
ifeq ($(SUPPORT_SHARED),1)
SUPPORT_SHARED_OPT := --disable-static --enable-shared
else
SUPPORT_SHARED_OPT := --enable-static --disable-shared
endif
ifeq ($(RUNTIME_SHARED),1)
RUNTIME_SHARED_OPT := --disable-static --enable-shared
else
RUNTIME_SHARED_OPT := --enable-static --disable-shared
endif
ifeq ($(LTO_BUILD),1)
LTO_OPT := -flto
endif
ifeq ($(findstring w64,$(TARGET)),)
DEFAULT_MANIFEST_ARCH := x86
else
ifeq ($(BIARCH),1)
DEFAULT_MANIFEST_ARCH := x86_64_multi
else
DEFAULT_MANIFEST_ARCH := x86_64
endif
endif
ifneq ($(NETMANIFEST),)
NEW_NET_MFT := $(NETMANIFEST).new.txt
endif
## Stamp target vars
STAMP_HOST_TOOLCHAIN_COPY := $(BUILDFROM)/master-stamp-host-toolchain-copy-$(EDITION)
STAMP_NEW_NET_MANIFEST := $(BUILD_BASE)/distrib/master-stamp-new-net-manifest
STAMP_GMP_BUILD := $(SCRATCH)/gmp/master-stamp-gmp-build-$(EDITION)
STAMP_GMP_HOST_INSTALL := $(BUILDFROM)/master-stamp-gmp-host-install-$(EDITION)
STAMP_GMP_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-gmp-stage-install-$(EDITION)
STAMP_MPFR_BUILD := $(SCRATCH)/mpfr/master-stamp-mpfr-build-$(EDITION)
STAMP_MPFR_HOST_INSTALL := $(BUILDFROM)/master-stamp-mpfr-host-install-$(EDITION)
STAMP_MPFR_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-mpfr-stage-install-$(EDITION)
STAMP_MPC_BUILD := $(SCRATCH)/mpc/master-stamp-mpc-build-$(EDITION)
STAMP_MPC_HOST_INSTALL := $(BUILDFROM)/master-stamp-mpc-host-install-$(EDITION)
STAMP_MPC_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-mpc-stage-install-$(EDITION)
STAMP_ISL_BUILD := $(SCRATCH)/isl/master-stamp-isl-build-$(EDITION)
STAMP_ISL_HOST_INSTALL := $(BUILDFROM)/master-stamp-isl-host-install-$(EDITION)
STAMP_ISL_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-isl-stage-install-$(EDITION)
STAMP_CLOOG_BUILD := $(SCRATCH)/cloog/master-stamp-cloog-build-$(EDITION)
STAMP_CLOOG_HOST_INSTALL := $(BUILDFROM)/master-stamp-cloog-host-install-$(EDITION)
STAMP_CLOOG_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-cloog-stage-install-$(EDITION)
STAMP_LIBICONV_BUILD := $(SCRATCH)/libiconv/master-stamp-libiconv-build-$(EDITION)
STAMP_LIBICONV_HOST_INSTALL := $(BUILDFROM)/master-stamp-libiconv-host-install-$(EDITION)
STAMP_LIBICONV_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-libiconv-stage-install-$(EDITION)
STAMP_ZSTD_BUILD := $(SCRATCH)/zstd/master-stamp-zstd-build-$(EDITION)
STAMP_ZSTD_HOST_INSTALL := $(BUILDFROM)/master-stamp-zstd-host-install-$(EDITION)
STAMP_ZSTD_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-zstd-stage-install-$(EDITION)
STAMP_MINGW_GET_BASE := $(STAGING_PREFIX)/master-stamp-mingw-get-base
STAMP_WINPTHREADS_BUILD := $(SCRATCH)/winpthreads/master-stamp-winpthreads-build-$(EDITION)
STAMP_WINPTHREADS_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-winpthreads-stage-install-$(EDITION)
STAMP_BINUTILS_BUILD := $(SCRATCH)/binutils/master-stamp-binutils-build-$(EDITION)
STAMP_BINUTILS_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-binutils-stage-install-$(EDITION)
STAMP_BINUTILS_PKG_INSTALL := $(PKG_BINUTILS)/master-stamp-binutils-pkg-install-$(EDITION)
STAMP_BINUTILS_DISTRIB := $(DISTRIB)/master-stamp-binutils-distrib-$(EDITION)
STAMP_BINUTILS_MANIFEST := $(DISTRIB)/master-stamp-binutils-manifest-$(EDITION)
STAMP_RUNTIME_HEADERS_BUILD := $(SCRATCH)/runtime-headers/master-stamp-runtime-headers-build-$(EDITION)
STAMP_RUNTIME_HEADERS_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-runtime-headers-stage-install-$(EDITION)
STAMP_GCC_CORE_BUILD := $(SCRATCH)/gcc-$(EXCEPTIONS)/master-stamp-gcc-core-build-$(EDITION)-$(EXCEPTIONS)
STAMP_GCC_CORE_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-gcc-core-stage-install-$(EDITION)-$(EXCEPTIONS)
STAMP_RUNTIME_BUILD := $(SCRATCH)/runtime/master-stamp-runtime-build-$(EDITION)
STAMP_RUNTIME_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-runtime-stage-install-$(EDITION)
STAMP_RUNTIME_PKG_INSTALL := $(PKG_RUNTIME)/master-stamp-runtime-pkg-install-$(EDITION)
STAMP_RUNTIME_DISTRIB := $(DISTRIB)/master-stamp-runtime-distrib-$(EDITION)
STAMP_RUNTIME_MANIFEST := $(DISTRIB)/master-stamp-runtime-manifest-$(EDITION)
STAMP_DEFAULT_MANIFEST_BUILD := $(SCRATCH)/default-manifest/master-stamp-default-manifest-build
STAMP_DEFAULT_MANIFEST_HOST_INSTALL := $(BUILDFROM)/master-stamp-default-manifest-host-install-$(EDITION)
STAMP_DEFAULT_MANIFEST_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-default-manifest-stage-install
STAMP_DEFAULT_MANIFEST_PKG_INSTALL := $(DISTRIB)/master-stamp-default-manifest-pkg-install
STAMP_DEFAULT_MANIFEST_DISTRIB := $(DISTRIB)/master-stamp-default-manifest-distrib-$(EDITION)
STAMP_DEFAULT_MANIFEST_MFTUPDATE := $(DISTRIB)/master-stamp-default-manifest-mftupdate-$(EDITION)
STAMP_STAGE_COPY32 := $(STAGING_PREFIX)/master-stamp-stage-copy32-$(EDITION)
STAMP_GCC_BUILD := $(SCRATCH)/gcc-$(EXCEPTIONS)/master-stamp-gcc-build-$(EDITION)-$(EXCEPTIONS)
STAMP_GCC_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-gcc-stage-install-$(EDITION)-$(EXCEPTIONS)
STAMP_GCC_PKG_INSTALL := $(PKG_GCC)/master-stamp-gcc-pkg-install-$(EDITION)-$(EXCEPTIONS)
STAMP_GCC_DISTRIB := $(DISTRIB)/master-stamp-gcc-distrib-$(EDITION)-$(EXCEPTIONS)
STAMP_GCC_MANIFEST := $(DISTRIB)/master-stamp-gcc-manifest-$(EDITION)-$(EXCEPTIONS)
STAMP_DISTRIB_LIBGCC_32_DW2_DLL := $(BUILD_BASE)/distrib/tdm32-dw2/master-stamp-libgcc-dll-distrib
STAMP_EXPAT_BUILD := $(SCRATCH)/expat/master-stamp-expat-build-$(EDITION)
STAMP_EXPAT_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-expat-stage-install-$(EDITION)
STAMP_READLINE_BUILD := $(SCRATCH)/readline/master-stamp-readline-build-$(EDITION)
STAMP_READLINE_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-readline-stage-install-$(EDITION)
STAMP_NCURSES_BUILD := $(SCRATCH)/expat/master-stamp-ncurses-build-$(EDITION)
STAMP_NCURSES_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-ncurses-stage-install-$(EDITION)
STAMP_TERMCAP_BUILD := $(SCRATCH)/expat/master-stamp-termcap-build-$(EDITION)
STAMP_TERMCAP_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-termcap-stage-install-$(EDITION)
STAMP_PYTHON_COPY := $(SCRATCH)/python_src/master-stamp-python-copy-src
STAMP_GDB_BUILD := $(SCRATCH)/gdb/master-stamp-gdb-build-$(EDITION)
STAMP_GDB_STAGE_INSTALL := $(STAGING_PREFIX)/master-stamp-gdb-stage-install-$(EDITION)
STAMP_GDB_PKG_INSTALL := $(PKG_GDB)/master-stamp-gdb-pkg-install-$(EDITION)
STAMP_GDB_DISTRIB := $(DISTRIB)/master-stamp-gdb-distrib-$(EDITION)
STAMP_GDB_MANIFEST := $(DISTRIB)/master-stamp-gdb-manifest-$(EDITION)
STAMP_DISTRIB_MG_ROOT := $(BUILD_BASE)/distrib/mingw-get-root/master-stamp-copy-mingw-get-root
STAMP_DISTRIB_MG_STAGE := $(BUILD_BASE)/distrib/mingw-get-root/master-stamp-mingw-get-stage
STAMP_NETMANIFEST_UPSTREAM_DEPS := $(BUILD_BASE)/distrib/master-stamp-manifest-upstream-deps
###########
# default
###########
.PHONY: default
ifneq ($(filter binutils,$(MAKE_PACKAGES)),)
ifeq ($(BINUTILS_SRC),)
$(error Must specify BINUTILS_SRC)
endif
ifeq ($(BINUTILS_VER),)
$(error Must specify BINUTILS_VER)
endif
default: $(STAMP_BINUTILS_MANIFEST)
$(STAMP_MANIFEST): $(STAMP_BINUTILS_DISTRIB)
endif
ifneq ($(filter runtime,$(MAKE_PACKAGES)),)
ifeq ($(RUNTIME_SRC),)
$(error Must specify RUNTIME_SRC)
endif
ifeq ($(RUNTIME_BRANCH),)
$(error Must specify RUNTIME_BRANCH)
endif
ifeq ($(RUNTIME_VER),)
$(error Must specify RUNTIME_VER)
endif
ifeq ($(GCC_SERIES),)
$(error Must specify GCC_SERIES)
endif
default: $(STAMP_RUNTIME_MANIFEST)
endif
ifneq ($(GCC_SRC),)
default: $(STAMP_GCC_STAGE_INSTALL)
endif
ifneq ($(filter gcc,$(MAKE_PACKAGES)),)
ifeq ($(GCC_VER),)
$(error Must specify GCC_VER)
endif
ifeq ($(GCC_SERIES),)
$(error Must specify GCC_SERIES)
endif
default: $(STAMP_GCC_MANIFEST)
endif
ifneq ($(filter gdb,$(MAKE_PACKAGES)),)
ifeq ($(GDB_SRC),)
$(error Must specify GDB_SRC)
endif
ifeq ($(GDB_VER),)
$(error Must specify GDB_VER)
endif
default: $(STAMP_GDB_MANIFEST)
endif
ifneq ($(filter default-manifest,$(MAKE_PACKAGES)),)
ifeq ($(DEFAULT_MANIFEST_SRC),)
$(error Must specify DEFAULT_MANIFEST_SRC)
endif
ifeq ($(DEFAULT_MANIFEST_VER),)
$(error Must specify DEFAULT_MANIFEST_VER)
endif
default: $(STAMP_DEFAULT_MANIFEST_MFTUPDATE)
endif
ifeq ($(MINGW_BASE_MINGWRT_VER),)
MINGW_BASE_MINGWRT_SPEC := mingwrt
else
MINGW_BASE_MINGWRT_SPEC := "mingwrt=$(MINGW_BASE_MINGWRT_VER)"
endif
ifeq ($(MINGW_BASE_W32API_VER),)
MINGW_BASE_W32API_SPEC := w32api
else
MINGW_BASE_W32API_SPEC := "w32api=$(MINGW_BASE_W32API_VER)"
endif
ifeq ($(MINGW_BASE_BINUTILS_VER),)
MINGW_BASE_BINUTILS_SPEC := binutils
else
MINGW_BASE_BINUTILS_SPEC := "binutils=$(MINGW_BASE_BINUTILS_VER)"
endif
ifeq ($(MINGW_BASE_M32MAKE_VER),)
MINGW_BASE_M32MAKE_SPEC := mingw32-make
else
MINGW_BASE_M32MAKE_SPEC := "mingw32-make=$(MINGW_BASE_M32MAKE_VER)"
endif
ifeq ($(MINGW_BASE_GDB_VER),)
MINGW_BASE_GDB_SPEC := gdb
else
MINGW_BASE_GDB_SPEC := "gdb=$(MINGW_BASE_GDB_VER)"
endif
ifeq ($(MINGW_BASE_PTHREADS_VER),)
MINGW_BASE_PTHREADS_SPEC := pthreads-w32
else
MINGW_BASE_PTHREADS_SPEC := "pthreads-w32=$(MINGW_BASE_PTHREADS_VER)"
endif
ifeq ($(MINGW_BASE_GCC_VER),)
MINGW_BASE_GCC_SPEC_ADDL :=
else
MINGW_BASE_GCC_SPEC_ADDL := "=$(MINGW_BASE_GCC_VER)"
endif
ifneq ($(filter manifest-upstream-deps,$(MAKE_PACKAGES)),)
default: $(STAMP_NETMANIFEST_UPSTREAM_DEPS)
endif
###########
# host-toolchain-copy
###########
.PHONY: host-toolchain-copy
host-toolchain-copy: $(STAMP_HOST_TOOLCHAIN_COPY)
$(STAMP_HOST_TOOLCHAIN_COPY):
@echo "=== gccmaster: Copy host toolchain to scratch area ==="
rm -fR $(BUILDFROM)
mkdir -p $(BUILDFROM)
cp -Rp $(HOST_TOOLCHAIN)/* $(BUILDFROM)/
ifeq ($(BUILD_TYPE),cross)
-cp -p $(BUILDFROM)/bin/$(HOST)-gnatmake.exe $(BUILDFROM)/bin/gnatmake.exe
-cp -p $(BUILDFROM)/bin/$(HOST)-gnatbind.exe $(BUILDFROM)/bin/gnatbind.exe
-cp -p $(BUILDFROM)/bin/$(HOST)-gnatlink.exe $(BUILDFROM)/bin/gnatlink.exe
-cp -p $(BUILDFROM)/bin/$(HOST)-gnatls.exe $(BUILDFROM)/bin/gnatls.exe
endif
#ifeq ($(BUILD_TYPE),native)
# cp -Rp $(HOST_TOOLCHAIN)/* $(STAGING_PREFIX)/
#endif
touch $@
###########
# new-net-mft
###########
.PHONY: new-net-mft
new-net-mft: $(STAMP_NEW_NET_MANIFEST)
$(STAMP_NEW_NET_MANIFEST): $(NETMANIFEST)
@echo "=== gccmaster: Copy net manifest to new file ==="
mkdir -p $(DISTRIB)
rm -f $(NEW_NET_MFT)
cp -p $(NETMANIFEST) $(NEW_NET_MFT)
touch $@
###########
# gmp
###########
.PHONY: gmp gmp-host-install gmp-stage-install
gmp: $(STAMP_GMP_BUILD)
gmp-host-install: $(STAMP_GMP_HOST_INSTALL)
gmp-stage-install: $(STAMP_GMP_STAGE_INSTALL)
ifneq ($(findstring x86_64,$(HOST)),)
ABIARG := "ABI=64"
endif
$(STAMP_GMP_BUILD): $(STAMP_HOST_TOOLCHAIN_COPY)
@echo "=== gccmaster: Build gmp ==="
rm -fR $(SCRATCH)/gmp
mkdir -p $(SCRATCH)/gmp
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/gmp \
&& \
$(GMP_SRC)/configure --prefix=$(BUILDFROM)/$(HOST) --build=$(BUILD) \
--host=$(HOST) $(SUPPORT_SHARED_OPT) $(ABIARG) \
CFLAGS="-O2 -g $(LTO_OPT)" LDFLAGS="$(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG)
endif
ifeq ($(BUILD_TYPE),native)
ifeq ($(findstring x86_64,$(HOST)),)
mkdir -p $(SCRATCH)/gmp/build
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/gmp/build \
&& \
$(GMP_SRC)/configure --prefix=$(SCRATCH)/gmp/stage --build=$(HOST) \
--enable-fat $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 $(LTO_OPT)" \
CXXFLAGS="-O2 $(LTO_OPT)" \
LDFLAGS="-s $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) && $(MAKE) install V=1 $(JOBS_ARG)
else
ifeq ($(BIARCH),1)
mkdir -p $(SCRATCH)/gmp/build32
mkdir -p $(SCRATCH)/gmp/build64
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/gmp/build32 \
&& \
$(GMP_SRC)/configure --prefix=$(SCRATCH)/gmp/stage/32 --build=$(HOST) \
$(SUPPORT_SHARED_OPT) \
LD="ld.exe -m i386pe" CFLAGS="-O2 -m32 $(LTO_OPT)" \
CXXFLAGS="-O2 -m32 $(LTO_OPT)" LDFLAGS="-m32 -s $(LTO_OPT)" ABI=32 \
&& \
$(MAKE) V=1 $(JOBS_ARG) && $(MAKE) install V=1 $(JOBS_ARG)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/gmp/build64 \
&& \
$(GMP_SRC)/configure --prefix=$(SCRATCH)/gmp/stage/64 \
--build=$(HOST) --enable-cxx $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 $(LTO_OPT)" CXXFLAGS="-O2 $(LTO_OPT)" \
LDFLAGS="-s $(LTO_OPT)" ABI=64 \
&& \
$(MAKE) V=1 $(JOBS_ARG) && $(MAKE) install V=1 $(JOBS_ARG)
endif
endif
endif
touch $@
$(STAMP_GMP_HOST_INSTALL): $(STAMP_GMP_BUILD)
@echo "=== gccmaster: Install gmp in scratch toolchain ==="
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/gmp \
&& \
$(MAKE) V=1 $(JOBS_ARG) install
endif
ifeq ($(BUILD_TYPE),native)
$(MAKE) -f $(THIS_MAKEFILE_DIR)/install_from_stage.makefile \
SRC=$(SCRATCH)/gmp/stage DEST=$(BUILDFROM)/$(HOST) BIARCH=$(BIARCH)
endif
touch $@
$(STAMP_GMP_STAGE_INSTALL): $(STAMP_GMP_BUILD)
@echo "=== gccmaster: Install gmp in staging prefix ==="
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/gmp \
&& \
$(MAKE) V=1 $(JOBS_ARG) install prefix=$(STAGING_PREFIX)
endif
ifeq ($(BUILD_TYPE),native)
$(MAKE) -f $(THIS_MAKEFILE_DIR)/install_from_stage.makefile \
SRC=$(SCRATCH)/gmp/stage DEST=$(STAGING_PREFIX)/$(HOST) BIARCH=$(BIARCH)
endif
touch $@
###########
# mpfr
###########
.PHONY: mpfr mpfr-host-install mpfr-stage-install
mpfr: $(STAMP_MPFR_BUILD)
mpfr-host-install: $(STAMP_MPFR_HOST_INSTALL)
mpfr-stage-install: $(STAMP_MPFR_STAGE_INSTALL)
$(STAMP_MPFR_BUILD): $(STAMP_HOST_TOOLCHAIN_COPY) $(STAMP_GMP_HOST_INSTALL)
@echo "=== gccmaster: Build mpfr ==="
rm -fR $(SCRATCH)/mpfr
mkdir -p $(SCRATCH)/mpfr
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/mpfr \
&& \
$(MPFR_SRC)/configure --prefix=$(BUILDFROM)/$(HOST) --build=$(BUILD) \
--host=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 -g $(LTO_OPT)" LDFLAGS="$(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG)
endif
ifeq ($(BUILD_TYPE),native)
ifeq ($(findstring x86_64,$(HOST)),)
mkdir -p $(SCRATCH)/mpfr/build
export PATH="$(BUILDFROM)/bin:$(BUILDFROM)/$(HOST)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/mpfr/build \
&& \
$(MPFR_SRC)/configure --prefix=$(SCRATCH)/mpfr/stage \
--build=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 $(LTO_OPT)" LDFLAGS="-s $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) && $(MAKE) install V=1 $(JOBS_ARG)
else
ifeq ($(BIARCH),1)
mkdir -p $(SCRATCH)/mpfr/build32
mkdir -p $(SCRATCH)/mpfr/build64
export PATH="$(BUILDFROM)/bin:$(BUILDFROM)/$(HOST)/bin32:$(PATH)" \
&& \
cd $(SCRATCH)/mpfr/build32 \
&& \
$(MPFR_SRC)/configure --prefix=$(SCRATCH)/mpfr/stage/32 \
--build=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 -m32 $(LTO_OPT)" LDFLAGS="-m32 -s $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) && $(MAKE) install V=1 $(JOBS_ARG)
export PATH="$(BUILDFROM)/bin:$(BUILDFROM)/$(HOST)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/mpfr/build64 \
&& \
$(MPFR_SRC)/configure --prefix=$(SCRATCH)/mpfr/stage/64 \
--build=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-I$(SCRATCH)/gmp/stage/64/include -O2 $(LTO_OPT)" LDFLAGS="-s $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) && $(MAKE) install V=1 $(JOBS_ARG)
endif
endif
endif
touch $@
$(STAMP_MPFR_HOST_INSTALL): $(STAMP_MPFR_BUILD)
@echo "=== gccmaster: Install mpfr in scratch toolchain ==="
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/mpfr \
&& \
$(MAKE) install V=1 $(JOBS_ARG)
endif
ifeq ($(BUILD_TYPE),native)
$(MAKE) -f $(THIS_MAKEFILE_DIR)/install_from_stage.makefile \
SRC=$(SCRATCH)/mpfr/stage DEST=$(BUILDFROM)/$(HOST) BIARCH=$(BIARCH)
endif
touch $@
$(STAMP_MPFR_STAGE_INSTALL): $(STAMP_MPFR_BUILD)
@echo "=== gccmaster: Install mpfr in staging prefix ==="
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/mpfr \
&& \
$(MAKE) V=1 $(JOBS_ARG) install prefix=$(STAGING_PREFIX)
endif
ifeq ($(BUILD_TYPE),native)
$(MAKE) -f $(THIS_MAKEFILE_DIR)/install_from_stage.makefile \
SRC=$(SCRATCH)/mpfr/stage DEST=$(STAGING_PREFIX)/$(HOST) BIARCH=$(BIARCH)
endif
touch $@
###########
# mpc
###########
.PHONY: mpc mpc-host-install mpc-stage-install
mpc: $(STAMP_MPC_BUILD)
mpc-host-install: $(STAMP_MPC_HOST_INSTALL)
mpc: $(STAMP_MPC_STAGE_INSTALL)
$(STAMP_MPC_BUILD): $(STAMP_HOST_TOOLCHAIN_COPY) $(STAMP_GMP_HOST_INSTALL)
$(STAMP_MPC_BUILD): $(STAMP_MPFR_HOST_INSTALL)
@echo "=== gccmaster: Build mpc ==="
rm -fR $(SCRATCH)/mpc
mkdir -p $(SCRATCH)/mpc
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/mpc \
&& \
$(MPC_SRC)/configure --prefix=$(BUILDFROM)/$(HOST) --build=$(BUILD) \
--host=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 -g $(LTO_OPT)" LDFLAGS="$(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG)
endif
ifeq ($(BUILD_TYPE),native)
ifeq ($(findstring x86_64,$(HOST)),)
mkdir -p $(SCRATCH)/mpc/build
export PATH="$(BUILDFROM)/bin:$(BUILDFROM)/$(HOST)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/mpc/build \
&& \
$(MPC_SRC)/configure --prefix=$(SCRATCH)/mpc/stage \
--build=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 $(LTO_OPT)" LDFLAGS="-s $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) LDFLAGS="-s -no-undefined" \
&& \
$(MAKE) V=1 $(JOBS_ARG) install
else
ifeq ($(BIARCH),1)
mkdir -p $(SCRATCH)/mpc/build32
mkdir -p $(SCRATCH)/mpc/build64
export PATH="$(BUILDFROM)/bin:$(BUILDFROM)/$(HOST)/bin32:$(PATH)" \
&& \
cd $(SCRATCH)/mpc/build32 \
&& \
$(MPC_SRC)/configure --prefix=$(SCRATCH)/mpc/stage/32 \
--build=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 -m32 $(LTO_OPT)" LDFLAGS="-m32 -s $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) LDFLAGS="-s -no-undefined" \
&& \
$(MAKE) V=1 $(JOBS_ARG) install
export PATH="$(BUILDFROM)/bin:$(BUILDFROM)/$(HOST)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/mpc/build64 \
&& \
$(MPC_SRC)/configure --prefix=$(SCRATCH)/mpc/stage/64 \
--build=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 $(LTO_OPT)" LDFLAGS="-s $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) LDFLAGS="-s -no-undefined" \
&& \
$(MAKE) V=1 $(JOBS_ARG) install
endif
endif
endif
touch $@
$(STAMP_MPC_HOST_INSTALL): $(STAMP_MPC_BUILD)
@echo "=== gccmaster: Install mpc in scratch toolchain ==="
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/mpc \
&& \
$(MAKE) V=1 $(JOBS_ARG) install
endif
ifeq ($(BUILD_TYPE),native)
$(MAKE) -f $(THIS_MAKEFILE_DIR)/install_from_stage.makefile \
SRC=$(SCRATCH)/mpc/stage DEST=$(BUILDFROM)/$(HOST) BIARCH=$(BIARCH)
endif
touch $@
$(STAMP_MPC_STAGE_INSTALL): $(STAMP_MPC_BUILD)
@echo "=== gccmaster: Install mpc in staging prefix ==="
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/mpc \
&& \
$(MAKE) V=1 $(JOBS_ARG) install prefix=$(STAGING_PREFIX)
endif
ifeq ($(BUILD_TYPE),native)
$(MAKE) -f $(THIS_MAKEFILE_DIR)/install_from_stage.makefile \
SRC=$(SCRATCH)/mpc/stage DEST=$(STAGING_PREFIX)/$(HOST) BIARCH=$(BIARCH)
endif
touch $@
###########
# isl
###########
.PHONY: isl isl-host-install isl-stage-install
isl: $(STAMP_ISL_BUILD)
isl-host-install: $(STAMP_ISL_HOST_INSTALL)
isl-stage-install: $(STAMP_ISL_STAGE_INSTALL)
#libisl_la_LDFLAGS="-version-info $(ISL_VERSION_INFO) -no-undefined"
$(STAMP_ISL_BUILD): $(STAMP_HOST_TOOLCHAIN_COPY) $(STAMP_GMP_HOST_INSTALL)
@echo "=== gccmaster: Build isl ==="
rm -fR $(SCRATCH)/isl
mkdir -p $(SCRATCH)/isl
ifeq ($(BUILD_TYPE),native)
ifeq ($(findstring x86_64,$(HOST)),)
mkdir -p $(SCRATCH)/isl/build
export PATH="$(BUILDFROM)/bin:$(BUILDFROM)/$(HOST)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/isl/build \
&& \
$(ISL_SRC)/configure --prefix=$(SCRATCH)/isl/stage \
--build=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 $(LTO_OPT)" CXXFLAGS="-O2 $(LTO_OPT)" \
LDFLAGS="-s $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) LDFLAGS="-s -no-undefined" \
&& \
$(MAKE) V=1 $(JOBS_ARG) install
else
ifeq ($(BIARCH),1)
mkdir -p $(SCRATCH)/isl/build32
mkdir -p $(SCRATCH)/isl/build64
export PATH="$(BUILDFROM)/bin:$(BUILDFROM)/$(HOST)/bin32:$(PATH)" \
&& \
cd $(SCRATCH)/isl/build32 \
&& \
$(ISL_SRC)/configure --prefix=$(SCRATCH)/isl/stage/32 \
--build=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 -m32 $(LTO_OPT)" CXXFLAGS="-O2 -m32 $(LTO_OPT)" \
LDFLAGS="-s -m32 $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) LDFLAGS="-s -m32 $(LTO_OPT) -no-undefined" \
CFLAGS="-O2 -m32 $(LTO_OPT)" CXXFLAGS="-O2 -m32 $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) install
export PATH="$(BUILDFROM)/bin:$(BUILDFROM)/$(HOST)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/isl/build64 \
&& \
$(ISL_SRC)/configure --prefix=$(SCRATCH)/isl/stage/64 \
--build=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 $(LTO_OPT)" CXXFLAGS="-O2 $(LTO_OPT)" \
LDFLAGS="-s $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) LDFLAGS="-s $(LTO_OPT) -no-undefined" \
CFLAGS="-O2 $(LTO_OPT)" CXXFLAGS="-O2 $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) install
endif
endif
endif
touch $@
$(STAMP_ISL_HOST_INSTALL): $(STAMP_ISL_BUILD)
@echo "=== gccmaster: Install isl in scratch toolchain ==="
ifeq ($(BUILD_TYPE),native)
$(MAKE) -f $(THIS_MAKEFILE_DIR)/install_from_stage.makefile \
SRC=$(SCRATCH)/isl/stage DEST=$(BUILDFROM)/$(HOST) BIARCH=$(BIARCH)
endif
touch $@
$(STAMP_ISL_STAGE_INSTALL): $(STAMP_ISL_BUILD)
@echo "=== gccmaster: Install isl in staging prefix ==="
ifeq ($(BUILD_TYPE),native)
$(MAKE) -f $(THIS_MAKEFILE_DIR)/install_from_stage.makefile \
SRC=$(SCRATCH)/isl/stage DEST=$(STAGING_PREFIX)/$(HOST) BIARCH=$(BIARCH)
endif
touch $@
###########
# cloog
###########
.PHONY: cloog cloog-host-install cloog-stage-install
cloog: $(STAMP_CLOOG_BUILD)
cloog-host-install: $(STAMP_CLOOG_HOST_INSTALL)
cloog-stage-install: $(STAMP_CLOOG_STAGE_INSTALL)
$(STAMP_CLOOG_BUILD): $(STAMP_HOST_TOOLCHAIN_COPY) $(STAMP_GMP_HOST_INSTALL)
$(STAMP_CLOOG_BUILD): $(STAMP_ISL_HOST_INSTALL)
@echo "=== gccmaster: Build cloog ==="
rm -fR $(SCRATCH)/cloog
mkdir -p $(SCRATCH)/cloog
ifeq ($(BUILD_TYPE),native)
ifeq ($(findstring x86_64,$(HOST)),)
mkdir -p $(SCRATCH)/cloog/build
export PATH="$(BUILDFROM)/bin:$(BUILDFROM)/$(HOST)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/cloog/build \
&& \
$(CLOOG_SRC)/configure --prefix=$(SCRATCH)/cloog/stage \
--build=$(HOST) $(SUPPORT_SHARED_OPT) --with-isl=system --with-bits=gmp \
CFLAGS="-O2 $(LTO_OPT)" CXXFLAGS="-O2 $(LTO_OPT)" \
LDFLAGS="-s $(LTO_OPT)" \
&& \
$(MAKE) libcloog_isl_la_LDFLAGS="-version-info 3:0:0 -no-undefined" \
&& \
$(MAKE) install
else
ifeq ($(BIARCH),1)
mkdir -p $(SCRATCH)/cloog/build32
mkdir -p $(SCRATCH)/cloog/build64
export PATH="$(BUILDFROM)/bin:$(BUILDFROM)/$(HOST)/bin32:$(PATH)" \
&& \
cd $(SCRATCH)/cloog/build32 \
&& \
$(CLOOG_SRC)/configure --prefix=$(SCRATCH)/cloog/stage/32 \
--build=$(HOST) $(SUPPORT_SHARED_OPT) --with-isl=system --with-bits=gmp \
CFLAGS="-O2 -m32 $(LTO_OPT)" CXXFLAGS="-O2 -m32 $(LTO_OPT)" \
LDFLAGS="-s -m32 $(LTO_OPT)" \
&& \
$(MAKE) libcloog_isl_la_LDFLAGS="-version-info 3:0:0 -no-undefined" \
&& \
$(MAKE) install
export PATH="$(BUILDFROM)/bin:$(BUILDFROM)/$(HOST)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/cloog/build64 \
&& \
$(CLOOG_SRC)/configure --prefix=$(SCRATCH)/cloog/stage/64 \
--build=$(HOST) $(SUPPORT_SHARED_OPT) --with-isl=system --with-bits=gmp \
CFLAGS="-O2 $(LTO_OPT)" CXXFLAGS="-O2 $(LTO_OPT)" \
LDFLAGS="-s $(LTO_OPT)" \
&& \
$(MAKE) libcloog_isl_la_LDFLAGS="-version-info 3:0:0 -no-undefined" \
&& \
$(MAKE) install
endif
endif
endif
touch $@
$(STAMP_CLOOG_HOST_INSTALL): $(STAMP_CLOOG_BUILD)
@echo "=== gccmaster: Install cloog in scratch toolchain ==="
ifeq ($(BUILD_TYPE),native)
$(MAKE) -f $(THIS_MAKEFILE_DIR)/install_from_stage.makefile \
SRC=$(SCRATCH)/cloog/stage DEST=$(BUILDFROM)/$(HOST) BIARCH=$(BIARCH)
endif
touch $@
$(STAMP_CLOOG_STAGE_INSTALL): $(STAMP_CLOOG_BUILD)
@echo "=== gccmaster: Install cloog in staging prefix ==="
ifeq ($(BUILD_TYPE),native)
$(MAKE) -f $(THIS_MAKEFILE_DIR)/install_from_stage.makefile \
SRC=$(SCRATCH)/cloog/stage DEST=$(STAGING_PREFIX)/$(HOST) BIARCH=$(BIARCH)
endif
touch $@
###########
# libiconv
###########
.PHONY: libiconv libiconv-host-install libiconv-stage-install
libiconv: $(STAMP_LIBICONV_BUILD)
libiconv-host-install: $(STAMP_LIBICONV_HOST_INSTALL)
libiconv-stage-install: $(STAMP_LIBICONV_STAGE_INSTALL)
$(STAMP_LIBICONV_BUILD): $(STAMP_HOST_TOOLCHAIN_COPY)
@echo "=== gccmaster: Build libiconv ==="
rm -fR $(SCRATCH)/libiconv
mkdir -p $(SCRATCH)/libiconv
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/libiconv \
&& \
$(LIBICONV_SRC)/configure --prefix=$(BUILDFROM)/$(HOST) --build=$(BUILD) \
--host=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 -g $(LTO_OPT)" LDFLAGS="$(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG)
endif
ifeq ($(BUILD_TYPE),native)
ifeq ($(findstring x86_64,$(HOST)),)
mkdir -p $(SCRATCH)/libiconv/build
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/libiconv/build \
&& \
$(LIBICONV_SRC)/configure --prefix=$(SCRATCH)/libiconv/stage \
--build=$(HOST) --host=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 $(LTO_OPT)" LDFLAGS="-s $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) && $(MAKE) install V=1 $(JOBS_ARG)
else
ifeq ($(BIARCH),1)
mkdir -p $(SCRATCH)/libiconv/build32
mkdir -p $(SCRATCH)/libiconv/build64
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/libiconv/build32 \
&& \
$(LIBICONV_SRC)/configure --prefix=$(SCRATCH)/libiconv/stage/32 \
--build=$(HOST) --host=$(HOST) $(SUPPORT_SHARED_OPT) \
CFLAGS="-O2 -m32 $(LTO_OPT)" LDFLAGS="-s -m32 $(LTO_OPT)" \
RC="windres -F pe-i386" WINDRES="windres -F pe-i386" \
&& \
$(MAKE) V=1 $(JOBS_ARG) && $(MAKE) install V=1 $(JOBS_ARG)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/libiconv/build64 \
&& \
$(LIBICONV_SRC)/configure --prefix=$(SCRATCH)/libiconv/stage/64 \
--build=$(HOST) --host=$(HOST) --enable-shared=no \
CFLAGS="-O2 $(LTO_OPT)" LDFLAGS="-s $(LTO_OPT)" \
&& \
$(MAKE) V=1 $(JOBS_ARG) && $(MAKE) V=1 $(JOBS_ARG) install
endif
endif
endif
touch $@
$(STAMP_LIBICONV_HOST_INSTALL): $(STAMP_LIBICONV_BUILD)
@echo "=== gccmaster: Install libiconv in scratch toolchain ==="
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/libiconv \
&& \
$(MAKE) V=1 $(JOBS_ARG) install
endif
ifeq ($(BUILD_TYPE),native)
$(MAKE) -f $(THIS_MAKEFILE_DIR)/install_from_stage.makefile \
SRC=$(SCRATCH)/libiconv/stage DEST=$(BUILDFROM)/$(HOST) BIARCH=$(BIARCH)
endif
touch $@
$(STAMP_LIBICONV_STAGE_INSTALL): $(STAMP_LIBICONV_BUILD)
@echo "=== gccmaster: Install libiconv in staging prefix ==="
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cd $(SCRATCH)/libiconv \
&& \
$(MAKE) install prefix=$(STAGING_PREFIX) V=1 $(JOBS_ARG)
endif
ifeq ($(BUILD_TYPE),native)
$(MAKE) -f $(THIS_MAKEFILE_DIR)/install_from_stage.makefile \
SRC=$(SCRATCH)/libiconv/stage DEST=$(STAGING_PREFIX)/$(HOST) BIARCH=$(BIARCH)
endif
touch $@
###########
# zstd
###########
.PHONY: zstd zstd-host-install zstd-stage-install
zstd: $(STAMP_ZSTD_BUILD)
zstd-host-install: $(STAMP_ZSTD_HOST_INSTALL)
zstd-stage-install: $(STAMP_ZSTD_STAGE_INSTALL)
$(STAMP_ZSTD_BUILD): $(STAMP_HOST_TOOLCHAIN_COPY)
@echo "=== gccmaster: Build zstd ==="
rm -fR $(SCRATCH)/zstd
mkdir -p $(SCRATCH)/zstd
ifeq ($(BUILD_TYPE),cross)
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cp -Rp $(ZSTD_SRC)/* $(SCRATCH)/zstd/ \
&& \
cd $(SCRATCH)/zstd \
&& \
$(MAKE) V=1 $(JOBS_ARG) CC=gcc CFLAGS="-O2 -g $(LTO_OPT)" LDFLAGS="$(LTO_OPT)" lib-release
endif
ifeq ($(BUILD_TYPE),native)
ifeq ($(findstring x86_64,$(HOST)),)
mkdir -p $(SCRATCH)/zstd/build
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cp -Rp $(ZSTD_SRC)/* $(SCRATCH)/zstd/build/ \
&& \
cd $(SCRATCH)/zstd/build \
&& \
$(MAKE) V=1 $(JOBS_ARG) CC=gcc CFLAGS="-O3 $(LTO_OPT)" LDFLAGS="-s $(LTO_OPT)" lib-release
else
ifeq ($(BIARCH),1)
mkdir -p $(SCRATCH)/zstd/build32
mkdir -p $(SCRATCH)/zstd/build64
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cp -Rp $(ZSTD_SRC)/* $(SCRATCH)/zstd/build32/ \
&& \
cd $(SCRATCH)/zstd/build32 \
&& \
$(MAKE) V=1 $(JOBS_ARG) CC=gcc CFLAGS="-O3 -m32 $(LTO_OPT)" LDFLAGS="-s -m32 $(LTO_OPT)" \
RC="windres -F pe-i386" WINDRES="windres -F pe-i386" lib-release
export PATH="$(BUILDFROM)/bin:$(PATH)" \
&& \
cp -Rp $(ZSTD_SRC)/* $(SCRATCH)/zstd/build64/ \
&& \
cd $(SCRATCH)/zstd/build64 \
&& \
$(MAKE) V=1 $(JOBS_ARG) CC=gcc CFLAGS="-O3 $(LTO_OPT)" LDFLAGS="-s $(LTO_OPT)" lib-release