-
Notifications
You must be signed in to change notification settings - Fork 175
/
Makefile
2635 lines (2635 loc) · 62.2 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 [2009/08/02]
#
default: help
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
BSDs = freebsd netbsd openbsd darwin
UNIXs = linux $(BSDs) solaris qnx
LIMIT83fs = go32v2 os2 emx watcom
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
ifneq ($(words $(FPC_COMPILERINFO)),5)
FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
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
ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
TARGETSUFFIX=$(OS_TARGET)
SOURCESUFFIX=$(OS_SOURCE)
else
TARGETSUFFIX=$(FULL_TARGET)
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
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 units)),)
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 units)),)
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 units)),)
override FPCDIR:=$(FPCDIR)/..
ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
override FPCDIR:=$(BASEDIR)
ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
override FPCDIR=c:/pp
endif
endif
endif
endif
endif
ifndef CROSSBINDIR
CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
endif
ifeq ($(OS_TARGET),darwin)
ifeq ($(OS_SOURCE),darwin)
DARWIN2DARWIN=1
endif
endif
ifndef BINUTILSPREFIX
ifndef CROSSBINDIR
ifdef CROSSCOMPILE
ifndef DARWIN2DARWIN
BINUTILSPREFIX=$(CPU_TARGET)-$(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 $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
override PACKAGE_NAME=fpc
override PACKAGE_VERSION=2.5.1
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),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
ifdef CROSSCOMPILE
PPPRE=ppcross
else
PPPRE=ppc
endif
PPNEW=$(BASEDIR)/compiler/$(PPPRE)$(PPSUF)$(SRCEXEEXT)
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
ifeq ($(FULL_SOURCE),$(FULL_TARGET))
FPCMAKENEW=$(BASEDIR)/utils/fpcm/fpcmake$(EXEEXT)
else
FPCMAKENEW=fpcmake
endif
CLEANOPTS=FPC=$(PPNEW)
BUILDOPTS=FPC=$(PPNEW) RELEASE=1
INSTALLOPTS=FPC=$(PPNEW) ZIPDESTDIR=$(BASEDIR) FPCMAKE=$(FPCMAKENEW)
ifndef CROSSCOMPILE
ifneq ($(wildcard ide),)
IDETARGETS=go32v2 win32 linux freebsd os2 emx beos haiku
ifneq ($(findstring $(OS_TARGET),$(IDETARGETS)),)
IDE=1
endif
endif
endif
ifeq ($(FULL_TARGET),i386-linux)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-go32v2)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-win32)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-os2)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-freebsd)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-beos)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-haiku)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-netbsd)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-solaris)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-qnx)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-netware)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-openbsd)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-wdosx)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-darwin)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-emx)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-watcom)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-netwlibc)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-wince)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-embedded)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),i386-symbian)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),m68k-linux)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),m68k-freebsd)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),m68k-netbsd)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),m68k-amiga)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),m68k-atari)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),m68k-openbsd)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),m68k-palmos)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),m68k-embedded)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),powerpc-linux)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),powerpc-netbsd)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),powerpc-amiga)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),powerpc-macos)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),powerpc-darwin)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),powerpc-morphos)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),powerpc-embedded)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),sparc-linux)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),sparc-netbsd)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),sparc-solaris)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),sparc-embedded)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),x86_64-linux)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),x86_64-freebsd)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),x86_64-darwin)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),x86_64-win64)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),x86_64-embedded)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),arm-linux)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),arm-palmos)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),arm-darwin)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),arm-wince)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),arm-gba)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),arm-nds)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),arm-embedded)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),arm-symbian)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),powerpc64-linux)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),powerpc64-darwin)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),powerpc64-embedded)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),avr-embedded)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),armeb-linux)
override TARGET_DIRS+=compiler rtl utils packages ide installer
endif
ifeq ($(FULL_TARGET),armeb-embedded)
override TARGET_DIRS+=compiler rtl utils packages ide 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
ifndef INSTALL_DATADIR
INSTALL_DATADIR=$(INSTALL_BASEDIR)
endif
ifndef INSTALL_SHAREDDIR
INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
endif
ifdef CROSSCOMPILE
ifndef CROSSBINDIR
CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
ifeq ($(CROSSBINDIR),)
CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
endif
endif
else
CROSSBINDIR=
endif
BATCHEXT=.bat
LOADEREXT=.as
EXEEXT=.exe
PPLEXT=.ppl
PPUEXT=.ppu
OEXT=.o
ASMEXT=.s
SMARTEXT=.sl
STATICLIBEXT=.a
SHAREDLIBEXT=.so
SHAREDLIBPREFIX=libfp
STATICLIBPREFIX=libp
IMPORTLIBPREFIX=libimp
RSTEXT=.rst
ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
ifeq ($(OS_TARGET),go32v1)
STATICLIBPREFIX=
SHORTSUFFIX=v1
endif
ifeq ($(OS_TARGET),go32v2)
STATICLIBPREFIX=
SHORTSUFFIX=dos
IMPORTLIBPREFIX=
endif
ifeq ($(OS_TARGET),watcom)
STATICLIBPREFIX=
OEXT=.obj
ASMEXT=.asm
SHAREDLIBEXT=.dll
SHORTSUFFIX=wat
IMPORTLIBPREFIX=
endif
ifeq ($(OS_TARGET),linux)
BATCHEXT=.sh
EXEEXT=
HASSHAREDLIB=1
SHORTSUFFIX=lnx
endif
ifeq ($(OS_TARGET),freebsd)
BATCHEXT=.sh
EXEEXT=
HASSHAREDLIB=1
SHORTSUFFIX=fbs
endif
ifeq ($(OS_TARGET),netbsd)
BATCHEXT=.sh
EXEEXT=
HASSHAREDLIB=1
SHORTSUFFIX=nbs
endif
ifeq ($(OS_TARGET),openbsd)
BATCHEXT=.sh
EXEEXT=
HASSHAREDLIB=1
SHORTSUFFIX=obs
endif
ifeq ($(OS_TARGET),win32)
SHAREDLIBEXT=.dll
SHORTSUFFIX=w32
endif
ifeq ($(OS_TARGET),os2)
BATCHEXT=.cmd
AOUTEXT=.out
STATICLIBPREFIX=
SHAREDLIBEXT=.dll
SHORTSUFFIX=os2
ECHO=echo
IMPORTLIBPREFIX=
endif
ifeq ($(OS_TARGET),emx)
BATCHEXT=.cmd
AOUTEXT=.out
STATICLIBPREFIX=
SHAREDLIBEXT=.dll
SHORTSUFFIX=emx
ECHO=echo
IMPORTLIBPREFIX=
endif
ifeq ($(OS_TARGET),amiga)
EXEEXT=
SHAREDLIBEXT=.library
SHORTSUFFIX=amg
endif
ifeq ($(OS_TARGET),morphos)
EXEEXT=
SHAREDLIBEXT=.library
SHORTSUFFIX=mos
endif
ifeq ($(OS_TARGET),atari)
EXEEXT=.ttp
SHORTSUFFIX=ata
endif
ifeq ($(OS_TARGET),beos)
BATCHEXT=.sh
EXEEXT=
SHORTSUFFIX=be
endif
ifeq ($(OS_TARGET),haiku)
BATCHEXT=.sh
EXEEXT=
SHORTSUFFIX=hai
endif
ifeq ($(OS_TARGET),solaris)
BATCHEXT=.sh
EXEEXT=
SHORTSUFFIX=sun
endif
ifeq ($(OS_TARGET),qnx)
BATCHEXT=.sh
EXEEXT=
SHORTSUFFIX=qnx
endif
ifeq ($(OS_TARGET),netware)
EXEEXT=.nlm
STATICLIBPREFIX=
SHORTSUFFIX=nw
IMPORTLIBPREFIX=imp
endif
ifeq ($(OS_TARGET),netwlibc)
EXEEXT=.nlm
STATICLIBPREFIX=
SHORTSUFFIX=nwl
IMPORTLIBPREFIX=imp
endif
ifeq ($(OS_TARGET),macos)
BATCHEXT=
EXEEXT=
DEBUGSYMEXT=.xcoff
SHORTSUFFIX=mac
IMPORTLIBPREFIX=imp
endif
ifeq ($(OS_TARGET),darwin)
BATCHEXT=.sh
EXEEXT=
HASSHAREDLIB=1
SHORTSUFFIX=dwn
endif
ifeq ($(OS_TARGET),gba)
EXEEXT=.gba
SHAREDLIBEXT=.so
SHORTSUFFIX=gba
endif
ifeq ($(OS_TARGET),symbian)
SHAREDLIBEXT=.dll
SHORTSUFFIX=symbian
endif
else
ifeq ($(OS_TARGET),go32v1)
PPUEXT=.pp1
OEXT=.o1
ASMEXT=.s1
SMARTEXT=.sl1
STATICLIBEXT=.a1
SHAREDLIBEXT=.so1
STATICLIBPREFIX=
SHORTSUFFIX=v1
IMPORTLIBPREFIX=
endif
ifeq ($(OS_TARGET),go32v2)
STATICLIBPREFIX=
SHORTSUFFIX=dos
IMPORTLIBPREFIX=
endif
ifeq ($(OS_TARGET),watcom)
STATICLIBPREFIX=
SHORTSUFFIX=wat
IMPORTLIBPREFIX=
endif
ifeq ($(OS_TARGET),linux)
BATCHEXT=.sh
EXEEXT=
HASSHAREDLIB=1
SHORTSUFFIX=lnx
endif
ifeq ($(OS_TARGET),freebsd)
BATCHEXT=.sh
EXEEXT=
HASSHAREDLIB=1
SHORTSUFFIX=fbs
endif
ifeq ($(OS_TARGET),netbsd)
BATCHEXT=.sh
EXEEXT=
HASSHAREDLIB=1
SHORTSUFFIX=nbs
endif
ifeq ($(OS_TARGET),openbsd)
BATCHEXT=.sh
EXEEXT=
HASSHAREDLIB=1
SHORTSUFFIX=obs
endif
ifeq ($(OS_TARGET),win32)
PPUEXT=.ppw
OEXT=.ow
ASMEXT=.sw
SMARTEXT=.slw
STATICLIBEXT=.aw
SHAREDLIBEXT=.dll
SHORTSUFFIX=w32
endif
ifeq ($(OS_TARGET),os2)
BATCHEXT=.cmd
PPUEXT=.ppo
ASMEXT=.so2
OEXT=.oo2
AOUTEXT=.out
SMARTEXT=.sl2
STATICLIBPREFIX=
STATICLIBEXT=.ao2
SHAREDLIBEXT=.dll
SHORTSUFFIX=os2
ECHO=echo
IMPORTLIBPREFIX=
endif
ifeq ($(OS_TARGET),amiga)
EXEEXT=
PPUEXT=.ppu
ASMEXT=.s
OEXT=.o
SMARTEXT=.sl
STATICLIBEXT=.a
SHAREDLIBEXT=.library
SHORTSUFFIX=amg
endif
ifeq ($(OS_TARGET),atari)
PPUEXT=.ppu
ASMEXT=.s
OEXT=.o
SMARTEXT=.sl
STATICLIBEXT=.a
EXEEXT=.ttp
SHORTSUFFIX=ata
endif
ifeq ($(OS_TARGET),beos)
BATCHEXT=.sh
PPUEXT=.ppu
ASMEXT=.s
OEXT=.o
SMARTEXT=.sl
STATICLIBEXT=.a
EXEEXT=
SHORTSUFFIX=be
endif
ifeq ($(OS_TARGET),solaris)
BATCHEXT=.sh
PPUEXT=.ppu
ASMEXT=.s
OEXT=.o
SMARTEXT=.sl
STATICLIBEXT=.a
EXEEXT=
SHORTSUFFIX=sun
endif
ifeq ($(OS_TARGET),qnx)
BATCHEXT=.sh