forked from Stichting-MINIX-Research-Foundation/minix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminix.own.mk
More file actions
958 lines (846 loc) · 25 KB
/
Copy pathminix.own.mk
File metadata and controls
958 lines (846 loc) · 25 KB
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
# $NetBSD: bsd.own.mk,v 1.603 2009/12/06 16:15:15 uebayasi Exp $
.if !defined(_MINIX_OWN_MK_)
_MINIX_OWN_MK_=1
MAKECONF?= /etc/make.conf
.-include "${MAKECONF}"
#
# CPU model, derived from MACHINE_ARCH
#
MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/}
#
# Subdirectory used below ${RELEASEDIR} when building a release
#
RELEASEMACHINEDIR?= ${MACHINE}
#
# Subdirectory or path component used for the following paths:
# distrib/${RELEASEMACHINE}
# distrib/notes/${RELEASEMACHINE}
# etc/etc.${RELEASEMACHINE}
# Used when building a release.
#
RELEASEMACHINE?= ${MACHINE}
#
# NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
# ensure that things defined by <bsd.own.mk> (default targets,
# INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
#
NEED_OWN_INSTALL_TARGET?= yes
#
# This lists the platforms which do not have working in-tree toolchains.
# For the in-tree gcc 3.3.2 toolchain, this list is empty.
# If some future port is not supported by the in-tree toolchain, this
# should be set to "yes" for that port only.
#
TOOLCHAIN_MISSING?= no
# default to GCC4
.if !defined(HAVE_GCC) && !defined(HAVE_PCC)
HAVE_GCC= 4
.endif
# default to GDB6
HAVE_GDB?= 6
# default to binutils 2.19
HAVE_BINUTILS?= 219
CPPFLAG_ISYSTEM= -isystem
.if defined(HAVE_GCC)
.if ${HAVE_GCC} == 3
CPPFLAG_ISYSTEMXX= -isystem-cxx
.else # GCC 4
CPPFLAG_ISYSTEMXX= -cxx-isystem
.endif
.endif
.if empty(.MAKEFLAGS:M-V*)
.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx
.else
PRINTOBJDIR= ${MAKE} -V .OBJDIR
.endif
.else
PRINTOBJDIR= echo # prevent infinite recursion
.endif
#
# Determine if running in the MINIX source tree by checking for the
# existence of boot/ and tools/ in the current or a parent directory,
# and setting _MSRC_TOP_ to the result.
#
.if !defined(_MSRC_TOP_) # {
_MSRC_TOP_!= cd ${.CURDIR}; while :; do \
here=`pwd`; \
[ -d boot ] && [ -d tools ] && { echo $$here; break; }; \
case $$here in /) echo ""; break;; esac; \
cd ..; done
.MAKEOVERRIDES+= _MSRC_TOP_
.endif # }
#
# If _MSRC_TOP_ != "", we're within the MINIX source tree, so set
# defaults for MINIXSRCDIR and _MSRC_TOP_OBJ_.
#
.if (${_MSRC_TOP_} != "") # {
MINIXSRCDIR?= ${_MSRC_TOP_}
.if !defined(_MSRC_TOP_OBJ_)
_MSRC_TOP_OBJ_!= cd ${_MSRC_TOP_} && ${PRINTOBJDIR}
.MAKEOVERRIDES+= _MSRC_TOP_OBJ_
.endif
.endif # _MSRC_TOP_ != "" # }
#
# Determine if running in the NetBSD source tree by checking for the
# existence of build.sh and tools/ in the current or a parent directory,
# and setting _SRC_TOP_ to the result.
#
.if !defined(_SRC_TOP_) # {
_SRC_TOP_!= cd ${.CURDIR}; while :; do \
here=`pwd`; \
[ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
case $$here in /) echo ""; break;; esac; \
cd ..; done
.MAKEOVERRIDES+= _SRC_TOP_
.endif # }
#
# If _SRC_TOP_ != "", we're within the NetBSD source tree, so set
# defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
#
.if (${_SRC_TOP_} != "") # {
NETBSDSRCDIR?= ${_SRC_TOP_}
.if !defined(_SRC_TOP_OBJ_)
_SRC_TOP_OBJ_!= cd ${_SRC_TOP_} && ${PRINTOBJDIR}
.MAKEOVERRIDES+= _SRC_TOP_OBJ_
.endif
.endif # _SRC_TOP_ != "" # }
.if (${_SRC_TOP_} != "") && \
(${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
USETOOLS?= yes
.endif
USETOOLS?= no
.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
${MACHINE_ARCH} == "sh3"
.BEGIN:
@echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
@false
.elif defined(REQUIRETOOLS) && \
(${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
${USETOOLS} == "no"
.BEGIN:
@echo "USETOOLS=no, but this component requires a version-specific host toolchain"
@false
.endif
#
# Host platform information; may be overridden
#
.if !defined(HOST_OSTYPE)
_HOST_OSNAME!= uname -s
_HOST_OSREL!= uname -r
# For _HOST_ARCH, if uname -p fails, or prints "unknown", or prints
# something that does not look like an identifier, then use uname -m.
_HOST_ARCH!= uname -p 2>/dev/null
_HOST_ARCH:= ${HOST_ARCH:tW:C/.*[^-_A-Za-z0-9].*//:S/unknown//}
.if empty(_HOST_ARCH)
_HOST_ARCH!= uname -m
.endif
HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//g:[*]:C/ /_/g}-${_HOST_ARCH:C/\([^\)]*\)//g:[*]:C/ /_/g}
.MAKEOVERRIDES+= HOST_OSTYPE
.endif # !defined(HOST_OSTYPE)
.if ${USETOOLS} == "yes" # {
#
# Provide a default for TOOLDIR.
#
.if !defined(TOOLDIR)
TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
.MAKEOVERRIDES+= TOOLDIR
.endif
#
# This is the prefix used for the NetBSD-sourced tools.
#
_TOOL_PREFIX?= nb
#
# If an external toolchain base is specified, use it.
#
.if defined(EXTERNAL_TOOLCHAIN) # {
AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
CC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
CPP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
CXX= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
FC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
OBJC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
.else # } {
# Define default locations for common tools.
.if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
.endif # }
.if defined(HAVE_GCC) && ${USETOOLS_GCC:Uyes} == "yes" # {
CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
CPP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
CXX= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
OBJC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
.endif # }
.if defined(HAVE_PCC) && ${USETOOLS_PCC:Uyes} == "yes"
CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
CPP= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-cpp
CXX= false
FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-f77
OBJC= false
.endif
.endif # EXTERNAL_TOOLCHAIN # }
HOST_MKDEP= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
TOOL_ATF_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}atf-compile
TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk
TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
TOOL_DISKLABEL= ${TOOLDIR}/bin/nbdisklabel-${MAKEWRAPPERMACHINE}
TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep
TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
TOOL_HP700MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp700-mkboot
TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join
TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii
TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml
TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint
TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create
TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile
TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
.else # USETOOLS != yes # } {
TOOL_AMIGAAOUT2BB= amiga-aout2bb
TOOL_AMIGAELF2BB= amiga-elf2bb
TOOL_AMIGATXLT= amiga-txlt
TOOL_ASN1_COMPILE= asn1_compile
TOOL_ATF_COMPILE= atf-compile
TOOL_AWK= awk
TOOL_CAP_MKDB= cap_mkdb
TOOL_CAT= cat
TOOL_CKSUM= cksum
TOOL_COMPILE_ET= compile_et
TOOL_CONFIG= config
TOOL_CRUNCHGEN= crunchgen
TOOL_CTAGS= ctags
TOOL_DB= db
TOOL_DISKLABEL= disklabel
TOOL_EQN= eqn
TOOL_FDISK= fdisk
TOOL_FGEN= fgen
TOOL_GENASSYM= genassym
TOOL_GENCAT= gencat
TOOL_GMAKE= gmake
TOOL_GREP= grep
TOOL_GROFF= groff
TOOL_HEXDUMP= hexdump
TOOL_HP300MKBOOT= hp300-mkboot
TOOL_HP700MKBOOT= hp700-mkboot
TOOL_INDXBIB= indxbib
TOOL_INSTALLBOOT= installboot
TOOL_INSTALL_INFO= install-info
TOOL_JOIN= join
TOOL_M4= m4
TOOL_MACPPCFIXCOFF= macppc-fixcoff
TOOL_MAKEFS= makefs
TOOL_MAKEINFO= makeinfo
#TOOL_MAKEWHATIS= /usr/libexec/makewhatis
TOOL_MAKEWHATIS= /usr/bin/makewhatis
TOOL_MDSETIMAGE= mdsetimage
TOOL_MENUC= menuc
TOOL_MIPSELF2ECOFF= mips-elf2ecoff
TOOL_MKCSMAPPER= mkcsmapper
TOOL_MKESDB= mkesdb
TOOL_MKLOCALE= mklocale
TOOL_MKMAGIC= file
TOOL_MKTEMP= mktemp
TOOL_MSGC= msgc
TOOL_MTREE= mtree
TOOL_PAX= pax
TOOL_PIC= pic
TOOL_PKG_CREATE= pkg_create
TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage
TOOL_PWD_MKDB= pwd_mkdb
TOOL_REFER= refer
TOOL_ROFF_ASCII= nroff
TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
TOOL_RPCGEN= rpcgen
TOOL_SED= sed
TOOL_SOELIM= soelim
TOOL_SPARKCRC= sparkcrc
TOOL_STAT= stat
TOOL_STRFILE= strfile
TOOL_SUNLABEL= sunlabel
TOOL_TBL= tbl
TOOL_UUDECODE= uudecode
TOOL_VGRIND= vgrind -f
TOOL_ZIC= zic
.endif # USETOOLS != yes # }
#
# Targets to check if DESTDIR or RELEASEDIR is provided
#
.if !target(check_DESTDIR)
check_DESTDIR: .PHONY .NOTMAIN
.if !defined(DESTDIR)
@echo "setenv DESTDIR before doing that!"
@false
.else
@true
.endif
.endif
.if !target(check_RELEASEDIR)
check_RELEASEDIR: .PHONY .NOTMAIN
.if !defined(RELEASEDIR)
@echo "setenv RELEASEDIR before doing that!"
@false
.else
@true
.endif
.endif
.if ${USETOOLS} == "yes" # {
#
# Make sure DESTDIR is set, so that builds with these tools always
# get appropriate -nostdinc, -nostdlib, etc. handling. The default is
# <empty string>, meaning start from /, the root directory.
#
DESTDIR?=
.endif # }
#
# Build a dynamically linked /bin and /sbin, with the necessary shared
# libraries moved from /usr/lib to /lib and the shared linker moved
# from /usr/libexec to /lib
#
# Note that if the BINDIR is not /bin or /sbin, then we always use the
# non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
# and /sbin). See <bsd.shlib.mk>.
#
MKDYNAMICROOT?= yes
#
# Where the system object and source trees are kept; can be configurable
# by the user in case they want them in ~/foosrc and ~/fooobj (for example).
#
BSDSRCDIR?= /usr/src
BSDOBJDIR?= /usr/obj
NETBSDSRCDIR?= ${BSDSRCDIR}
#BINGRP?= wheel
BINGRP?= operator
BINOWN?= root
BINMODE?= 755
NONBINMODE?= 644
#MANDIR?= /usr/share/man
MANDIR?= /usr/man
#MANGRP?= wheel
MANGRP?= operator
MANOWN?= root
MANMODE?= ${NONBINMODE}
#MANINSTALL?= catinstall htmlinstall maninstall
MANINSTALL?= maninstall
INFODIR?= /usr/share/info
INFOGRP?= wheel
INFOOWN?= root
INFOMODE?= ${NONBINMODE}
#LIBDIR?= /usr/lib
.if ${COMPILER_TYPE} == "ack"
LIBDIR?= /usr/lib/i386
.elif ${COMPILER_TYPE} == "gnu"
LIBDIR?= /usr/gnu/lib
.endif
LINTLIBDIR?= /usr/libdata/lint
LIBGRP?= ${BINGRP}
LIBOWN?= ${BINOWN}
LIBMODE?= ${NONBINMODE}
DOCDIR?= /usr/share/doc
HTMLDOCDIR?= /usr/share/doc/html
DOCGRP?= wheel
DOCOWN?= root
DOCMODE?= ${NONBINMODE}
NLSDIR?= /usr/share/nls
NLSGRP?= wheel
NLSOWN?= root
NLSMODE?= ${NONBINMODE}
KMODULEGRP?= wheel
KMODULEOWN?= root
KMODULEMODE?= ${NONBINMODE}
LOCALEDIR?= /usr/share/locale
LOCALEGRP?= wheel
LOCALEOWN?= root
LOCALEMODE?= ${NONBINMODE}
FIRMWAREDIR?= /libdata/firmware
FIRMWAREGRP?= wheel
FIRMWAREOWN?= root
FIRMWAREMODE?= ${NONBINMODE}
DEBUGDIR?= /usr/libdata/debug
DEBUGGRP?= wheel
DEBUGOWN?= root
DEBUGMODE?= ${NONBINMODE}
#
# Data-driven table using make variables to control how
# toolchain-dependent targets and shared libraries are built
# for different platforms and object formats.
#
# OBJECT_FMT: currently either "ELF" or "a.out".
#
# All platforms are ELF.
#
OBJECT_FMT= ELF
#
# If this platform's toolchain is missing, we obviously cannot build it.
#
.if ${TOOLCHAIN_MISSING} != "no"
MKBINUTILS:= no
MKGDB:= no
MKGCC:= no
.endif
#
# If we are using an external toolchain, we can still build the target's
# binutils, but we cannot build GCC's support libraries, since those are
# tightly-coupled to the version of GCC being used.
#
.if defined(EXTERNAL_TOOLCHAIN)
MKGCC:= no
.endif
#
# The m68000 port is incomplete.
#
.if ${MACHINE_ARCH} == "m68000"
NOPIC= # defined
MKISCSI= no
# XXX GCC 4 outputs mcount() calling sequences that try to load values
# from over 64KB away and this fails to assemble.
.if defined(HAVE_GCC) && (${HAVE_GCC} == 4)
NOPROFILE= # defined
.endif
.endif
#
# The ia64 port is incomplete.
#
.if ${MACHINE_ARCH} == "ia64"
MKLINT= no
MKGDB= no
.endif
#
# On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
# not just shared libraries, so don't build the _pic version.
#
.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
MKPICLIB:= no
.endif
#
# On VAX using ELF, all objects are PIC, not just shared libraries,
# so don't build the _pic version. Unless we are using GCC3 which
# doesn't support PIC yet.
#
.if ${MACHINE_ARCH} == "vax"
MKPICLIB= no
.endif
#
# Location of the file that contains the major and minor numbers of the
# version of a shared library. If this file exists a shared library
# will be built by <bsd.lib.mk>.
#
SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
#
# GNU sources and packages sometimes see architecture names differently.
#
GNU_ARCH.coldfire=m68k
GNU_ARCH.i386=i486
GCC_CONFIG_ARCH.i386=i486
GCC_CONFIG_TUNE.i386=nocona
GCC_CONFIG_TUNE.x86_64=nocona
GNU_ARCH.m68000=m68010
GNU_ARCH.sh3eb=sh
GNU_ARCH.sh3el=shle
GNU_ARCH.mips64eb=mips64
MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
#
# In order to identify NetBSD to GNU packages, we sometimes need
# an "elf" tag for historically a.out platforms.
#
.if ${OBJECT_FMT} == "ELF" && \
(${MACHINE_GNU_ARCH} == "arm" || \
${MACHINE_GNU_ARCH} == "armeb" || \
${MACHINE_ARCH} == "i386" || \
${MACHINE_CPU} == "m68k" || \
${MACHINE_GNU_ARCH} == "sh" || \
${MACHINE_GNU_ARCH} == "shle" || \
${MACHINE_ARCH} == "sparc" || \
${MACHINE_ARCH} == "vax")
MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
.else
MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
.endif
#
# Determine if arch uses native kernel modules with rump
#
.if ${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "x86_64"
RUMPKMOD= # defined
.endif
TARGETS+= all clean cleandir depend dependall includes \
install lint obj regress tags html
PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
install lint obj regress tags beforedepend afterdepend \
beforeinstall afterinstall realinstall realdepend realall \
html subdir-all subdir-install subdir-depend
.PHONY: ${PHONY_NOTMAIN}
.NOTMAIN: ${PHONY_NOTMAIN}
.if ${NEED_OWN_INSTALL_TARGET} != "no"
.if !target(install)
install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
beforeinstall:
subdir-install:
realinstall:
afterinstall:
.endif
all: realall subdir-all
subdir-all:
realall:
depend: realdepend subdir-depend
subdir-depend:
realdepend:
distclean: cleandir
cleandir: clean
dependall: .NOTMAIN realdepend .MAKE
@cd ${.CURDIR}; ${MAKE} realall
.endif
#
# Define MKxxx variables (which are either yes or no) for users
# to set in /etc/mk.conf and override in the make environment.
# These should be tested with `== "no"' or `!= "no"'.
# The NOxxx variables should only be set by Makefiles.
#
# Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
# with changes to the MK* variables here.
#
#
# Supported NO* options (if defined, MK* will be forced to "no",
# regardless of user's mk.conf setting).
#
# Source makefiles should set NO*, and not MK*, and must do so before
# including bsd.own.mk.
#
.for var in \
NOCRYPTO NODOC NOHTML NOINFO NOLINKLIB NOLINT NOMAN NONLS NOOBJ NOPIC \
NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB
.if defined(${var})
MK${var:S/^NO//}:= no
.endif
.endfor
#
# Older-style variables that enabled behaviour when set.
#
.for var in MANZ UNPRIVED UPDATE
.if defined(${var})
MK${var}:= yes
.endif
.endfor
#
# MK* options which have variable defaults.
#
.if ${MACHINE} == "amd64" || ${MACHINE} == "sparc64"
MKCOMPAT?= yes
.else
# Don't let this build where it really isn't supported.
MKCOMPAT:= no
.endif
#
# MK* backward compatibility.
#
.if defined(MKBFD)
MKBINUTILS?= ${MKBFD}
.endif
#
# We want to build zfs only for i386 and amd64 by default for now.
#
.if ${MACHINE} == "amd64" || ${MACHINE} == "i386"
MKZFS?= yes
.endif
#
# MK* options which default to "yes".
#
_MKVARS.yes= \
MKATF \
MKBINUTILS \
MKCATPAGES MKCRYPTO MKCOMPLEX MKCVS \
MKDOC \
MKGCC MKGCCCMDS MKGDB \
MKHESIOD MKHTML \
MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \
MKKERBEROS \
MKKMOD \
MKLDAP MKLINKLIB MKLINT MKLVM \
MKMAN \
MKMDNS \
MKNLS \
MKOBJ \
MKPAM \
MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
MKSHARE MKSKEY MKSTATICLIB \
MKX11FONTS \
MKYP
.for var in ${_MKVARS.yes}
${var}?= yes
.endfor
#
# MK* options which default to "no".
#
_MKVARS.no= \
MKCRYPTO_IDEA MKCRYPTO_MDC2 MKCRYPTO_RC5 MKDEBUG MKDEBUGLIB \
MKEXTSRC \
MKMANDOC MKMANZ MKOBJDIRS \
MKPCC MKPCCCMDS \
MKSOFTFLOAT MKSTRIPIDENT \
MKUNPRIVED MKUPDATE MKX11 MKZFS
.for var in ${_MKVARS.no}
${var}?=no
.endfor
#
# Force some options off if their dependencies are off.
#
.if ${MKCRYPTO} == "no"
MKKERBEROS:= no
.endif
.if ${MKMAN} == "no"
MKCATPAGES:= no
MKHTML:= no
.endif
.if ${MKLINKLIB} == "no"
MKLINT:= no
MKPICINSTALL:= no
MKPROFILE:= no
.endif
.if ${MKPIC} == "no"
MKPICLIB:= no
.endif
.if ${MKOBJ} == "no"
MKOBJDIRS:= no
.endif
.if ${MKSHARE} == "no"
MKCATPAGES:= no
MKDOC:= no
MKINFO:= no
MKHTML:= no
MKMAN:= no
MKNLS:= no
.endif
#
# install(1) parameters.
#
COPY?= -c
.if ${MKUPDATE} == "no"
PRESERVE?=
.else
PRESERVE?= -p
.endif
#XXX: Not supported by MINIX install
#RENAME?= -r
HRDLINK?= -l h
SYMLINK?= -l s
METALOG?= ${DESTDIR}/METALOG
METALOG.add?= ${TOOL_CAT} -l >> ${METALOG}
.if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
.if ${MKUNPRIVED} != "no"
INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha256
.else
INSTPRIV.unpriv=
.endif
INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
.endif
STRIPFLAG?=
#XXX: Strip flag for MINIX
#STRIPFLAG?= -s
.if ${NEED_OWN_INSTALL_TARGET} != "no"
INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
HOST_INSTALL_FILE?= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
HOST_INSTALL_DIR?= ${INSTALL} -d
HOST_INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} ${RENAME}
.endif
#
# Set defaults for the USE_xxx variables.
#
#
# USE_* options which default to "no" and will be forced to "no" if their
# corresponding MK* variable is set to "no".
#
.for var in USE_SKEY
.if (${${var:S/USE_/MK/}} == "no")
${var}:= no
.else
${var}?= no
.endif
.endfor
#
# USE_* options which default to "yes" unless their corresponding MK*
# variable is set to "no".
#
.for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP
.if (${${var:S/USE_/MK/}} == "no")
${var}:= no
.else
${var}?= yes
.endif
.endfor
#
# USE_* options which default to "yes".
#
.for var in USE_JEMALLOC
${var}?= yes
.endfor
#
# USE_* options which default to "no".
#
#.for var in
#${var}?= no
#.endfor
#
# MAKEDIRTARGET dir target [extra make(1) params]
# run "cd $${dir} && ${MAKE} [params] $${target}", with a pretty message
#
MAKEDIRTARGET=\
@_makedirtarget() { \
dir="$$1"; shift; \
target="$$1"; shift; \
case "$${dir}" in \
/*) this="$${dir}/"; \
real="$${dir}" ;; \
.) this="${_THISDIR_}"; \
real="${.CURDIR}" ;; \
*) this="${_THISDIR_}$${dir}/"; \
real="${.CURDIR}/$${dir}" ;; \
esac; \
show=$${this:-.}; \
echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
cd "$${real}" \
&& ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
}; \
_makedirtarget
#
# MAKEVERBOSE support. Levels are:
# 0 Minimal output ("quiet")
# 1 Describe what is occurring
# 2 Describe what is occurring and echo the actual command
# 3 Ignore the effect of the "@" prefix in make commands
# 4 Trace shell commands using the shell's -x flag
#
MAKEVERBOSE?= 1
.if ${MAKEVERBOSE} == 0
_MKMSG?= @\#
_MKSHMSG?= : echo
_MKSHECHO?= : echo
.SILENT:
.elif ${MAKEVERBOSE} == 1
_MKMSG?= @echo ' '
_MKSHMSG?= echo ' '
_MKSHECHO?= : echo
.SILENT:
.else # MAKEVERBOSE >= 2
_MKMSG?= @echo '\# '
_MKSHMSG?= echo '\# '
_MKSHECHO?= echo
.SILENT: __makeverbose_dummy_target__
.endif # MAKEVERBOSE >= 2
.if ${MAKEVERBOSE} >= 3
.MAKEFLAGS: -dl
.endif # ${MAKEVERBOSE} >= 3
.if ${MAKEVERBOSE} >= 4
.MAKEFLAGS: -dx
.endif # ${MAKEVERBOSE} >= 4
_MKMSG_BUILD?= ${_MKMSG} " build "
_MKMSG_CREATE?= ${_MKMSG} " create "
_MKMSG_COMPILE?= ${_MKMSG} "compile "
_MKMSG_FORMAT?= ${_MKMSG} " format "
_MKMSG_INSTALL?= ${_MKMSG} "install "
_MKMSG_LINK?= ${_MKMSG} " link "
_MKMSG_LEX?= ${_MKMSG} " lex "
_MKMSG_REMOVE?= ${_MKMSG} " remove "
_MKMSG_YACC?= ${_MKMSG} " yacc "
_MKSHMSG_CREATE?= ${_MKSHMSG} " create "
_MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
_MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
_MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
_MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
_MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
_MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET}
_MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
_MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
_MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET}
_MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
.if ${MKMANDOC} == "yes"
TARGETS+= lintmanpages
.endif
.endif # !defined(_MINIX_OWN_MK_)