forked from Lerc/freepascal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
3137 lines (3137 loc) · 77.4 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
#
# Don't edit, this file is generated by FPCMake Version 2.0.0
#
default: help
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android i386-aros m68k-linux m68k-netbsd m68k-amiga m68k-atari m68k-palmos m68k-macosclassic m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macosclassic powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-haiku x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-iphonesim x86_64-android x86_64-aros x86_64-dragonfly arm-linux arm-netbsd arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android arm-aros arm-freertos arm-ios powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android mips64el-linux jvm-java jvm-android i8086-embedded i8086-msdos i8086-win16 aarch64-linux aarch64-darwin aarch64-win64 aarch64-android aarch64-ios wasm-wasm sparc64-linux riscv32-linux riscv32-embedded riscv64-linux riscv64-embedded xtensa-linux xtensa-embedded xtensa-freertos z80-embedded z80-zxspectrum z80-msxdos
BSDs = freebsd netbsd openbsd darwin dragonfly
UNIXs = linux $(BSDs) solaris qnx haiku aix
LIMIT83fs = go32v2 os2 emx watcom msdos win16 atari
OSNeedsComspecToRunBatch = go32v2 watcom
FORCE:
.PHONY: FORCE
override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
ifneq ($(findstring darwin,$(OSTYPE)),)
inUnix=1 #darwin
SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
else
ifeq ($(findstring ;,$(PATH)),)
inUnix=1
SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
else
SEARCHPATH:=$(subst ;, ,$(PATH))
endif
endif
SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
ifeq ($(PWD),)
PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
ifeq ($(PWD),)
$(error You need the GNU utils package to use this Makefile)
else
PWD:=$(firstword $(PWD))
SRCEXEEXT=
endif
else
PWD:=$(firstword $(PWD))
SRCEXEEXT=.exe
endif
ifndef inUnix
ifeq ($(OS),Windows_NT)
inWinNT=1
else
ifdef OS2_SHELL
inOS2=1
endif
endif
else
ifneq ($(findstring cygdrive,$(PATH)),)
inCygWin=1
endif
endif
ifdef inUnix
SRCBATCHEXT=.sh
else
ifdef inOS2
SRCBATCHEXT=.cmd
else
SRCBATCHEXT=.bat
endif
endif
ifdef COMSPEC
ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
ifndef RUNBATCH
RUNBATCH=$(COMSPEC) /C
endif
endif
endif
ifdef inUnix
PATHSEP=/
else
PATHSEP:=$(subst /,\,/)
ifdef inCygWin
PATHSEP=/
endif
endif
ifdef PWD
BASEDIR:=$(subst \,/,$(shell $(PWD)))
ifdef inCygWin
ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
endif
endif
else
BASEDIR=.
endif
ifdef inOS2
ifndef ECHO
ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
ifeq ($(ECHO),)
ECHO=echo
else
ECHO:=$(firstword $(ECHO))
endif
else
ECHO:=$(firstword $(ECHO))
endif
endif
export ECHO
endif
override DEFAULT_FPCDIR=.
ifndef FPC
ifdef PP
FPC=$(PP)
endif
endif
ifndef FPC
FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
ifneq ($(FPCPROG),)
FPCPROG:=$(firstword $(FPCPROG))
ifneq ($(CPU_TARGET),)
FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
else
FPC:=$(shell $(FPCPROG) -PB)
endif
ifneq ($(findstring Error,$(FPC)),)
override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
else
ifeq ($(strip $(wildcard $(FPC))),)
FPC:=$(firstword $(FPCPROG))
endif
endif
else
override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
endif
endif
override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
FOUNDFPC:=$(strip $(wildcard $(FPC)))
ifeq ($(FOUNDFPC),)
FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
ifeq ($(FOUNDFPC),)
$(error Compiler $(FPC) not found)
endif
endif
ifndef FPC_COMPILERINFO
FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
endif
ifndef FPC_VERSION
FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
endif
export FPC FPC_VERSION FPC_COMPILERINFO
unexport CHECKDEPEND ALLDEPENDENCIES
ifndef CPU_TARGET
ifdef CPU_TARGET_DEFAULT
CPU_TARGET=$(CPU_TARGET_DEFAULT)
endif
endif
ifndef OS_TARGET
ifdef OS_TARGET_DEFAULT
OS_TARGET=$(OS_TARGET_DEFAULT)
endif
endif
ifndef CPU_SOURCE
CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
endif
ifndef CPU_TARGET
CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
endif
ifndef OS_SOURCE
OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
endif
ifndef OS_TARGET
OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
endif
FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
ifeq ($(CPU_TARGET),armeb)
ARCH=arm
override FPCOPT+=-Cb
else
ifeq ($(CPU_TARGET),armel)
ARCH=arm
override FPCOPT+=-CaEABI
else
ARCH=$(CPU_TARGET)
endif
endif
ifeq ($(FULL_TARGET),arm-embedded)
ifeq ($(SUBARCH),)
$(error When compiling for arm-embedded, a sub-architecture (e.g. SUBARCH=armv4t or SUBARCH=armv7m) must be defined)
endif
override FPCOPT+=-Cp$(SUBARCH)
endif
ifeq ($(FULL_TARGET),avr-embedded)
ifeq ($(SUBARCH),)
$(error When compiling for avr-embedded, a sub-architecture (e.g. SUBARCH=avr25 or SUBARCH=avr35) must be defined)
endif
override FPCOPT+=-Cp$(SUBARCH)
endif
ifeq ($(FULL_TARGET),mipsel-embedded)
ifeq ($(SUBARCH),)
$(error When compiling for mipsel-embedded, a sub-architecture (e.g. SUBARCH=pic32mx) must be defined)
endif
override FPCOPT+=-Cp$(SUBARCH)
endif
ifeq ($(FULL_TARGET),xtensa-embedded)
ifeq ($(SUBARCH),)
$(error When compiling for xtensa-embedded, a sub-architecture (e.g. SUBARCH=lx106 or SUBARCH=lx6) must be defined)
endif
override FPCOPT+=-Cp$(SUBARCH)
endif
ifeq ($(FULL_TARGET),xtensa-freertos)
ifeq ($(SUBARCH),)
$(error When compiling for xtensa-freertos, a sub-architecture (e.g. SUBARCH=lx106 or SUBARCH=lx6) must be defined)
endif
override FPCOPT+=-Cp$(SUBARCH)
endif
ifeq ($(FULL_TARGET),arm-freertos)
ifeq ($(SUBARCH),)
$(error When compiling for arm-freertos, a sub-architecture (e.g. SUBARCH=armv6m or SUBARCH=armv7em) must be defined)
endif
override FPCOPT+=-Cp$(SUBARCH)
endif
ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
TARGETSUFFIX=$(OS_TARGET)
SOURCESUFFIX=$(OS_SOURCE)
else
ifneq ($(findstring $(OS_TARGET),$(LIMIT83fs)),)
TARGETSUFFIX=$(OS_TARGET)
else
TARGETSUFFIX=$(FULL_TARGET)
endif
SOURCESUFFIX=$(FULL_SOURCE)
endif
ifneq ($(FULL_TARGET),$(FULL_SOURCE))
CROSSCOMPILE=1
endif
ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
endif
endif
ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
BSDhier=1
endif
ifeq ($(OS_TARGET),linux)
linuxHier=1
endif
ifndef CROSSCOMPILE
BUILDFULLNATIVE=1
export BUILDFULLNATIVE
endif
ifdef BUILDFULLNATIVE
BUILDNATIVE=1
export BUILDNATIVE
endif
export OS_TARGET OS_SOURCE ARCH CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
ifdef FPCDIR
override FPCDIR:=$(subst \,/,$(FPCDIR))
ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
override FPCDIR=wrong
endif
else
override FPCDIR=wrong
endif
ifdef DEFAULT_FPCDIR
ifeq ($(FPCDIR),wrong)
override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
override FPCDIR=wrong
endif
endif
endif
ifeq ($(FPCDIR),wrong)
ifdef inUnix
override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
ifeq ($(wildcard $(FPCDIR)/units),)
override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
endif
else
override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
override FPCDIR:=$(FPCDIR)/..
ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
override FPCDIR:=$(FPCDIR)/..
ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
override FPCDIR:=$(BASEDIR)
ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl)),)
override FPCDIR=c:/pp
endif
endif
endif
endif
endif
ifndef CROSSBINDIR
CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
endif
ifneq ($(findstring $(OS_TARGET),darwin iphonesim ios),)
ifneq ($(findstring $(OS_SOURCE),darwin ios),)
DARWIN2DARWIN=1
endif
endif
ifndef BINUTILSPREFIX
ifndef CROSSBINDIR
ifdef CROSSCOMPILE
ifneq ($(OS_TARGET),msdos)
ifndef DARWIN2DARWIN
ifneq ($(CPU_TARGET),jvm)
BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
ifeq ($(OS_TARGET),android)
ifeq ($(CPU_TARGET),arm)
BINUTILSPREFIX=arm-linux-androideabi-
else
ifeq ($(CPU_TARGET),i386)
BINUTILSPREFIX=i686-linux-android-
else
BINUTILSPREFIX=$(CPU_TARGET)-linux-android-
endif
endif
endif
endif
endif
else
BINUTILSPREFIX=$(OS_TARGET)-
endif
endif
endif
endif
UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
ifeq ($(UNITSDIR),)
UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
endif
PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages)
ifndef FPCFPMAKE
ifdef CROSSCOMPILE
ifeq ($(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR)))),)
FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
ifneq ($(FPCPROG),)
FPCPROG:=$(firstword $(FPCPROG))
FPCFPMAKE:=$(shell $(FPCPROG) -PB)
ifeq ($(strip $(wildcard $(FPCFPMAKE))),)
FPCFPMAKE:=$(firstword $(FPCPROG))
endif
else
override FPCFPMAKE=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
endif
else
FPCFPMAKE=$(strip $(wildcard $(addsuffix /compiler/ppc$(SRCEXEEXT),$(FPCDIR))))
FPMAKE_SKIP_CONFIG=-n
export FPCFPMAKE
export FPMAKE_SKIP_CONFIG
endif
else
FPMAKE_SKIP_CONFIG=-n
FPCFPMAKE=$(FPC)
endif
endif
override PACKAGE_NAME=fpc
override PACKAGE_VERSION=3.3.1
REQUIREDVERSION=3.2.0
REQUIREDVERSION2=3.0.4
ifndef inOS2
override FPCDIR:=$(BASEDIR)
export FPCDIR
endif
ifndef BUILDDIR
BUILDDIR=$(BASEDIR)/build
endif
ifndef PPNEW
ifeq ($(CPU_TARGET),m68k)
PPSUF=68k
endif
ifeq ($(CPU_TARGET),i386)
PPSUF=386
endif
ifeq ($(CPU_TARGET),x86_64)
PPSUF=x64
endif
ifeq ($(CPU_TARGET),sparc)
PPSUF=sparc
endif
ifeq ($(CPU_TARGET),sparc64)
PPSUF=sparc64
endif
ifeq ($(CPU_TARGET),powerpc)
PPSUF=ppc
endif
ifeq ($(CPU_TARGET),powerpc64)
PPSUF=ppc64
endif
ifeq ($(CPU_TARGET),alpha)
PPSUF=axp
endif
ifeq ($(CPU_TARGET),arm)
PPSUF=arm
endif
ifeq ($(CPU_TARGET),armeb)
PPSUF=arm
endif
ifeq ($(CPU_TARGET),jvm)
PPSUF=jvm
endif
ifeq ($(CPU_TARGET),mips)
PPSUF=mips
endif
ifeq ($(CPU_TARGET),mipsel)
PPSUF=mipsel
endif
ifeq ($(CPU_TARGET),i8086)
PPSUF=8086
endif
ifeq ($(CPU_TARGET),avr)
PPSUF=avr
endif
ifeq ($(CPU_TARGET),aarch64)
PPSUF=a64
endif
ifeq ($(CPU_TARGET),riscv32)
PPSUF=rv32
endif
ifeq ($(CPU_TARGET),riscv64)
PPSUF=rv64
endif
ifeq ($(CPU_TARGET),xtensa)
PPSUF=xtensa
endif
ifeq ($(CPU_TARGET),z80)
PPSUF=z80
endif
ifdef CROSSCOMPILE
ifneq ($(CPU_TARGET),jvm)
PPPRE=ppcross
else
PPPRE=ppc
endif
else
PPPRE=ppc
endif
PPNEW=$(BASEDIR)/compiler/$(PPPRE)$(PPSUF)$(SRCEXEEXT)
endif
ifndef FPCFPMAKENEW
ifdef CROSSCOMPILE
FPCFPMAKENEW=$(BASEDIR)/compiler/ppc$(SRCEXEEXT)
else
FPCFPMAKENEW=$(PPNEW)
endif
endif
ifneq ($(wildcard install),)
CVSINSTALL=install
else
CVSINSTALL=.
endif
ifdef SNAPSHOT
INSTALLTARGET=install
else
ifdef CROSSINSTALL
INSTALLTARGET=install
else
INSTALLTARGET=distinstall
endif
endif
ifdef SNAPSHOT
ALLTARGET=all
else
ifndef ALLTARGET
SHAREDTARGETS=
SMARTTARGETS=win32 go32v2 linux freebsd netbsd openbsd netware netwlibc darwin
ifneq ($(findstring $(OS_TARGET),$(SHAREDTARGETS)),)
ALLTARGET=shared
else
ifneq ($(findstring $(OS_TARGET),$(SMARTTARGETS)),)
ALLTARGET=smart
else
ALLTARGET=all
endif
endif
endif
endif
ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
PKGUNITSPRE=u
else
PKGUNITSPRE=units-
endif
ifdef CROSSINSTALL
PKGPRE=$(FULL_TARGET)-
else
PKGPRE=
endif
override RELEASE=1
export RELEASE
ifndef DIST_DESTDIR
export DIST_DESTDIR:=$(BASEDIR)
endif
BASEPACKDIR=$(BASEDIR)/basepack
ifndef FPCMAKENEW
ifdef CROSSCOMPILE
FPCMAKENEW=$(BASEDIR)/utils/fpcm/fpcmake$(SRCEXEEXT)
else
FPCMAKENEW=$(BASEDIR)/utils/fpcm/bin/$(SOURCESUFFIX)/fpcmake$(SRCEXEEXT)
endif
endif
ifneq ($(OPT),)
OPTNEW+=$(OPT)
endif
ifneq ($(findstring $(OS_TARGET),linux),)
ifneq ($(findstring $(CPU_TARGET),i386 arm),)
override OPTNEW+=-CVglobal-dynamic
endif
endif
CLEANOPTS=FPC=$(PPNEW)
BUILDOPTS=FPC=$(PPNEW) FPCFPMAKE=$(FPCFPMAKENEW) RELEASE=1 'OPT=$(OPTNEW)' 'FPCMAKEOPT=$(OPT)'
INSTALLOPTS=FPC=$(PPNEW) ZIPDESTDIR=$(BASEDIR) FPCMAKE=$(FPCMAKENEW)
BuildOnlyBaseCPUs=jvm
ifneq ($(wildcard utils),)
NOUTILSTARGETS=embedded gba nds msdos win16 macosclassic $(BuildOnlyBaseCPUs) freertos
ifeq ($(findstring $(OS_TARGET),$(NOUTILSTARGETS)),)
ifdef BUILDFULLNATIVE
UTILS=1
endif
endif
endif
ifeq ($(FULL_TARGET),i386-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-go32v2)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-win32)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-os2)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-freebsd)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-beos)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-haiku)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-netbsd)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-solaris)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-netware)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-openbsd)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-wdosx)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-darwin)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-emx)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-watcom)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-netwlibc)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-wince)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-symbian)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-nativent)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-iphonesim)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-android)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i386-aros)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),m68k-netbsd)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),m68k-amiga)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),m68k-atari)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),m68k-palmos)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),m68k-macosclassic)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),m68k-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc-netbsd)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc-amiga)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc-macosclassic)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc-darwin)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc-morphos)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc-wii)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc-aix)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),sparc-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),sparc-netbsd)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),sparc-solaris)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),sparc-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-freebsd)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-haiku)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-netbsd)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-solaris)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-openbsd)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-win64)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-iphonesim)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-android)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-aros)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),x86_64-dragonfly)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),arm-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),arm-netbsd)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),arm-palmos)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),arm-wince)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),arm-gba)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),arm-nds)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),arm-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),arm-symbian)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),arm-android)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),arm-aros)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),arm-freertos)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),arm-ios)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc64-darwin)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc64-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),powerpc64-aix)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),avr-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),armeb-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),armeb-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),mips-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),mipsel-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),mipsel-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),mipsel-android)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),mips64el-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),jvm-java)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),jvm-android)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i8086-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i8086-msdos)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),i8086-win16)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),aarch64-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),aarch64-darwin)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),aarch64-win64)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),aarch64-android)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),aarch64-ios)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),wasm-wasm)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),sparc64-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),riscv32-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),riscv32-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),riscv64-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),riscv64-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),xtensa-linux)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),xtensa-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),xtensa-freertos)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),z80-embedded)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),z80-zxspectrum)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
ifeq ($(FULL_TARGET),z80-msxdos)
override TARGET_DIRS+=compiler rtl utils packages installer
endif
override INSTALL_FPCPACKAGE=y
ifdef REQUIRE_UNITSDIR
override UNITSDIR+=$(REQUIRE_UNITSDIR)
endif
ifdef REQUIRE_PACKAGESDIR
override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
endif
ifdef ZIPINSTALL
ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
UNIXHier=1
endif
else
ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
UNIXHier=1
endif
endif
ifndef INSTALL_PREFIX
ifdef PREFIX
INSTALL_PREFIX=$(PREFIX)
endif
endif
ifndef INSTALL_PREFIX
ifdef UNIXHier
INSTALL_PREFIX=/usr/local
else
ifdef INSTALL_FPCPACKAGE
INSTALL_BASEDIR:=/pp
else
INSTALL_BASEDIR:=/$(PACKAGE_NAME)
endif
endif
endif
export INSTALL_PREFIX
ifdef INSTALL_FPCSUBDIR
export INSTALL_FPCSUBDIR
endif
ifndef DIST_DESTDIR
DIST_DESTDIR:=$(BASEDIR)
endif
export DIST_DESTDIR
ifndef COMPILER_UNITTARGETDIR
ifdef PACKAGEDIR_MAIN
COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
else
COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
endif
endif
ifndef COMPILER_TARGETDIR
COMPILER_TARGETDIR=.
endif
ifndef INSTALL_BASEDIR
ifdef UNIXHier
ifdef INSTALL_FPCPACKAGE
INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
else
INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
endif
else
INSTALL_BASEDIR:=$(INSTALL_PREFIX)
endif
endif
ifndef INSTALL_BINDIR
ifdef UNIXHier
INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
else
INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
ifdef INSTALL_FPCPACKAGE
ifdef CROSSCOMPILE
ifdef CROSSINSTALL
INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
else
INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
endif
else
INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
endif
endif
endif
endif
ifndef INSTALL_UNITDIR
INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
ifdef INSTALL_FPCPACKAGE
ifdef PACKAGE_NAME
INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
endif
endif
endif
ifndef INSTALL_LIBDIR
ifdef UNIXHier
INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
else
INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
endif
endif
ifndef INSTALL_SOURCEDIR
ifdef UNIXHier
ifdef BSDhier
SRCPREFIXDIR=share/src
else
ifdef linuxHier
SRCPREFIXDIR=share/src
else
SRCPREFIXDIR=src
endif
endif
ifdef INSTALL_FPCPACKAGE
ifdef INSTALL_FPCSUBDIR
INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
else
INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
endif
else
INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
endif
else
ifdef INSTALL_FPCPACKAGE
ifdef INSTALL_FPCSUBDIR
INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
else
INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
endif
else
INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
endif
endif
endif
ifndef INSTALL_DOCDIR
ifdef UNIXHier
ifdef BSDhier
DOCPREFIXDIR=share/doc
else
ifdef linuxHier
DOCPREFIXDIR=share/doc
else
DOCPREFIXDIR=doc
endif
endif
ifdef INSTALL_FPCPACKAGE
INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
else
INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
endif
else
ifdef INSTALL_FPCPACKAGE
INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
else
INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
endif
endif
endif
ifndef INSTALL_EXAMPLEDIR
ifdef UNIXHier
ifdef INSTALL_FPCPACKAGE
ifdef BSDhier
INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
else
ifdef linuxHier
INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
else
INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
endif
endif
else
ifdef BSDhier
INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
else
ifdef linuxHier
INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
else
INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
endif
endif
endif
else
ifdef INSTALL_FPCPACKAGE
INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
else
INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
endif
endif
endif