Wed May 26 20:19:15 2021 UTC ()
Add a date tool


(christos)
diff -r1.209 -r1.210 src/tools/Makefile
diff -r0 -r1.1 src/tools/date/Makefile

cvs diff -r1.209 -r1.210 src/tools/Makefile (switch to unified diff)

--- src/tools/Makefile 2021/05/06 13:23:36 1.209
+++ src/tools/Makefile 2021/05/26 20:19:15 1.210
@@ -1,274 +1,274 @@ @@ -1,274 +1,274 @@
1# $NetBSD: Makefile,v 1.209 2021/05/06 13:23:36 rin Exp $ 1# $NetBSD: Makefile,v 1.210 2021/05/26 20:19:15 christos Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4.include <bsd.endian.mk> 4.include <bsd.endian.mk>
5 5
6# Make sure that the ordered build/install processing applies when using 6# Make sure that the ordered build/install processing applies when using
7# plain make. 7# plain make.
8.MAIN: build_install 8.MAIN: build_install
9 9
10# TOOLDIR must be valid, unless MKTOOLS=no 10# TOOLDIR must be valid, unless MKTOOLS=no
11.if ${MKTOOLS:Uyes} != "no" 11.if ${MKTOOLS:Uyes} != "no"
12.if "${TOOLDIR}" == "" 12.if "${TOOLDIR}" == ""
13.error "TOOLDIR is undefined or empty" 13.error "TOOLDIR is undefined or empty"
14.elif "${TOOLDIR:tW:M/*}" == "" 14.elif "${TOOLDIR:tW:M/*}" == ""
15.error "TOOLDIR is not an absolute path: ${TOOLDIR}" 15.error "TOOLDIR is not an absolute path: ${TOOLDIR}"
16#.elif !exists(TOOLDIR) # XXX .exists fails for directories 16#.elif !exists(TOOLDIR) # XXX .exists fails for directories
17#.error "TOOLDIR does not exist: ${TOOLDIR}" 17#.error "TOOLDIR does not exist: ${TOOLDIR}"
18.endif 18.endif
19.endif # MKTOOLS != no 19.endif # MKTOOLS != no
20 20
21# TOOLS_BUILDRUMP == yes builds only the subset of the tools required 21# TOOLS_BUILDRUMP == yes builds only the subset of the tools required
22# for building rump kernels and the hypervisor. It is typically used 22# for building rump kernels and the hypervisor. It is typically used
23# when building rump kernels targeted for non-NetBSD systems (via 23# when building rump kernels targeted for non-NetBSD systems (via
24# buildrump.sh), and should not be set for a regular "make build". 24# buildrump.sh), and should not be set for a regular "make build".
25TOOLS_BUILDRUMP?=no 25TOOLS_BUILDRUMP?=no
26 26
27.if ${TOOLCHAIN_MISSING} == "no" 27.if ${TOOLCHAIN_MISSING} == "no"
28. if (defined(HAVE_GCC) && ${HAVE_GCC} > 0) || \ 28. if (defined(HAVE_GCC) && ${HAVE_GCC} > 0) || \
29 (defined(HAVE_GDB) && ${HAVE_GDB} > 0 && ${MKCROSSGDB:Uno} != "no") 29 (defined(HAVE_GDB) && ${HAVE_GDB} > 0 && ${MKCROSSGDB:Uno} != "no")
30TOOLCHAIN_BITS+= gmake .WAIT 30TOOLCHAIN_BITS+= gmake .WAIT
31TOOLCHAIN_BITS+= gmp .WAIT 31TOOLCHAIN_BITS+= gmp .WAIT
32TOOLCHAIN_BITS+= mpfr .WAIT 32TOOLCHAIN_BITS+= mpfr .WAIT
33TOOLCHAIN_BITS+= mpc .WAIT 33TOOLCHAIN_BITS+= mpc .WAIT
34. endif 34. endif
35 35
36TOOLCHAIN_BITS+= binutils .WAIT 36TOOLCHAIN_BITS+= binutils .WAIT
37 37
38. if defined(HAVE_GCC) && ${HAVE_GCC} > 0 38. if defined(HAVE_GCC) && ${HAVE_GCC} > 0
39TOOLCHAIN_BITS+= gcc 39TOOLCHAIN_BITS+= gcc
40. endif 40. endif
41 41
42. if defined(HAVE_GDB) && ${HAVE_GDB} > 0 && ${MKCROSSGDB:Uno} != "no" 42. if defined(HAVE_GDB) && ${HAVE_GDB} > 0 && ${MKCROSSGDB:Uno} != "no"
43TOOLCHAIN_BITS+= gdb 43TOOLCHAIN_BITS+= gdb
44. endif 44. endif
45 45
46TOOLCHAIN_BITS+= .WAIT 46TOOLCHAIN_BITS+= .WAIT
47.endif 47.endif
48 48
49.if defined(HAVE_PCC) 49.if defined(HAVE_PCC)
50. if ${TOOLCHAIN_MISSING} == "no" 50. if ${TOOLCHAIN_MISSING} == "no"
51TOOLCHAIN_BITS+= pcc 51TOOLCHAIN_BITS+= pcc
52. endif 52. endif
53.endif 53.endif
54 54
55.if ${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN) 55.if ${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)
56TOOLCHAIN_BITS+= dbsym mdsetimage 56TOOLCHAIN_BITS+= dbsym mdsetimage
57.endif 57.endif
58 58
59DTRACE_BITS= 59DTRACE_BITS=
60.if ${MKDTRACE} != "no" || ${MKCTF} != "no" 60.if ${MKDTRACE} != "no" || ${MKCTF} != "no"
61DTRACE_BITS+= .WAIT libelf 61DTRACE_BITS+= .WAIT libelf
62DTRACE_BITS+= .WAIT libdwarf 62DTRACE_BITS+= .WAIT libdwarf
63DTRACE_BITS+= .WAIT libctf 63DTRACE_BITS+= .WAIT libctf
64.endif 64.endif
65.if ${MKCTF} != "no" 65.if ${MKCTF} != "no"
66DTRACE_BITS+= .WAIT ctfconvert ctfmerge 66DTRACE_BITS+= .WAIT ctfconvert ctfmerge
67.endif 67.endif
68 68
69LINT_BITS= 69LINT_BITS=
70.if ${MKLINT} != "no" 70.if ${MKLINT} != "no"
71LINT_BITS= lint lint2 71LINT_BITS= lint lint2
72.endif 72.endif
73 73
74# All of host-mkdep, compat, and binstall are needed before anything 74# All of host-mkdep, compat, and binstall are needed before anything
75# else. Within this group, they must be built in a specific order, and 75# else. Within this group, they must be built in a specific order, and
76# all of them must be built before any of them is installed. They may 76# all of them must be built before any of them is installed. They may
77# be installed in any order. This can't be expressed using the .WAIT 77# be installed in any order. This can't be expressed using the .WAIT
78# notation inside the SUBDIR list. 78# notation inside the SUBDIR list.
79# 79#
80# XXX .ORDER does not work when multiple targets are passed on the 80# XXX .ORDER does not work when multiple targets are passed on the
81# make command line without "-j", so use dependencies in addition to .ORDER. 81# make command line without "-j", so use dependencies in addition to .ORDER.
82# 82#
83.ORDER: dependall-host-mkdep dependall-compat dependall-binstall 83.ORDER: dependall-host-mkdep dependall-compat dependall-binstall
84.if make(dependall-host-mkdep) && make(dependall-compat) 84.if make(dependall-host-mkdep) && make(dependall-compat)
85dependall-compat: dependall-host-mkdep 85dependall-compat: dependall-host-mkdep
86.endif 86.endif
87.if make(dependall-compat) && make(dependall-binstall) 87.if make(dependall-compat) && make(dependall-binstall)
88dependall-binstall: dependall-compat 88dependall-binstall: dependall-compat
89.endif 89.endif
90 90
91# Dependencies in SUBDIR below ordered to maximize parallel ability. 91# Dependencies in SUBDIR below ordered to maximize parallel ability.
92# See above for special treatment for host-mkdep, compat, and binstall. 92# See above for special treatment for host-mkdep, compat, and binstall.
93# 93#
94SUBDIR= host-mkdep compat binstall \ 94SUBDIR= host-mkdep compat binstall date \
95 .WAIT mktemp .WAIT sed .WAIT genassym 95 .WAIT mktemp .WAIT sed .WAIT genassym
96.if ${TOOLS_BUILDRUMP} == "no" 96.if ${TOOLS_BUILDRUMP} == "no"
97SUBDIR+= cap_mkdb crunchgen ctags gencat hexdump \ 97SUBDIR+= cap_mkdb crunchgen ctags gencat hexdump \
98 ${LINT_BITS} \ 98 ${LINT_BITS} \
99 makewhatis mtree nbperf .WAIT uudecode 99 makewhatis mtree nbperf .WAIT uudecode
100.endif 100.endif
101 101
102SUBDIR+= cat rpcgen join lorder m4 mkdep tsort .WAIT yacc .WAIT awk .WAIT lex 102SUBDIR+= cat rpcgen join lorder m4 mkdep tsort .WAIT yacc .WAIT awk .WAIT lex
103.if ${TOOLS_BUILDRUMP} == "no" 103.if ${TOOLS_BUILDRUMP} == "no"
104SUBDIR+= xz-include .WAIT grep xz-lib pax .WAIT libprop 104SUBDIR+= xz-include .WAIT grep xz-lib pax .WAIT libprop
105 105
106SUBDIR += .WAIT texinfo \ 106SUBDIR += .WAIT texinfo \
107 .WAIT tic \ 107 .WAIT tic \
108 .WAIT ${TOOLCHAIN_BITS} \ 108 .WAIT ${TOOLCHAIN_BITS} \
109 ${DTRACE_BITS} \ 109 ${DTRACE_BITS} \
110 asn1_compile cksum compile_et db \ 110 asn1_compile cksum compile_et db \
111 file lint1 slc \ 111 file lint1 slc \
112 makefs sortinfo \ 112 makefs sortinfo \
113 .WAIT menuc mkcsmapper mkesdb mklocale mknod msgc \ 113 .WAIT menuc mkcsmapper mkesdb mklocale mknod msgc \
114 .WAIT disklabel gpt \ 114 .WAIT disklabel gpt \
115 .WAIT paxctl \ 115 .WAIT paxctl \
116 .WAIT fdisk \ 116 .WAIT fdisk \
117 .WAIT installboot \ 117 .WAIT installboot \
118 pwd_mkdb strfile sunlabel vgrind zic 118 pwd_mkdb strfile sunlabel vgrind zic
119.endif 119.endif
120SUBDIR+= stat .WAIT config 120SUBDIR+= stat .WAIT config
121.if ${TOOLS_BUILDRUMP} == "no" 121.if ${TOOLS_BUILDRUMP} == "no"
122SUBDIR+= xz-bin 122SUBDIR+= xz-bin
123.endif 123.endif
124 124
125.if ${MKLLVM} != "no" || ${MKLLVMRT} != "no" 125.if ${MKLLVM} != "no" || ${MKLLVMRT} != "no"
126SUBDIR+= \ 126SUBDIR+= \
127 llvm .WAIT \ 127 llvm .WAIT \
128 llvm-lib/libLLVMDemangle llvm-lib/libLLVMSupport llvm-lib/libLLVMTableGen .WAIT \ 128 llvm-lib/libLLVMDemangle llvm-lib/libLLVMSupport llvm-lib/libLLVMTableGen .WAIT \
129 llvm-tblgen 129 llvm-tblgen
130.endif 130.endif
131.if ${MKLLVM} != "no" 131.if ${MKLLVM} != "no"
132SUBDIR+= \ 132SUBDIR+= \
133 llvm-clang-tblgen 133 llvm-clang-tblgen
134.endif 134.endif
135.if ${MKLLVM} != "no" && !defined(EXTERNAL_TOOLCHAIN) 135.if ${MKLLVM} != "no" && !defined(EXTERNAL_TOOLCHAIN)
136SUBDIR+= \ 136SUBDIR+= \
137 .WAIT llvm-include .WAIT \ 137 .WAIT llvm-include .WAIT \
138 llvm-lib .WAIT \ 138 llvm-lib .WAIT \
139 llvm-clang 139 llvm-clang
140.endif 140.endif
141 141
142.if ${MKMAN} != "no" || ${MKDOC} != "no" || ${MKHTML} != "no" 142.if ${MKMAN} != "no" || ${MKDOC} != "no" || ${MKHTML} != "no"
143. if ${MKGROFF} != "no" 143. if ${MKGROFF} != "no"
144SUBDIR+= groff 144SUBDIR+= groff
145. endif 145. endif
146SUBDIR+= mandoc 146SUBDIR+= mandoc
147.endif 147.endif
148 148
149.if ${TOOLS_BUILDRUMP} == "no" 149.if ${TOOLS_BUILDRUMP} == "no"
150 150
151.if ${MKMAINTAINERTOOLS:Uno} != "no" 151.if ${MKMAINTAINERTOOLS:Uno} != "no"
152SUBDIR+= autoconf .WAIT gettext 152SUBDIR+= autoconf .WAIT gettext
153.endif 153.endif
154 154
155.if ${USE_PIGZGZIP} != "no" 155.if ${USE_PIGZGZIP} != "no"
156SUBDIR+= pigz 156SUBDIR+= pigz
157.endif 157.endif
158 158
159.if ${MACHINE} == "hppa" 159.if ${MACHINE} == "hppa"
160SUBDIR+= hppa-mkboot 160SUBDIR+= hppa-mkboot
161.endif 161.endif
162 162
163.if ${MACHINE} == "ibmnws" 163.if ${MACHINE} == "ibmnws"
164SUBDIR+= ibmnws-ncdcs 164SUBDIR+= ibmnws-ncdcs
165.endif 165.endif
166 166
167.if ${MACHINE} == "macppc" 167.if ${MACHINE} == "macppc"
168SUBDIR+= macppc-fixcoff 168SUBDIR+= macppc-fixcoff
169.endif 169.endif
170 170
171.if (${MACHINE} == "prep" || ${MACHINE} == "rs6000" || ${MACHINE} == "bebox") 171.if (${MACHINE} == "prep" || ${MACHINE} == "rs6000" || ${MACHINE} == "bebox")
172SUBDIR+= powerpc-mkbootimage 172SUBDIR+= powerpc-mkbootimage
173.endif 173.endif
174 174
175.if ${MACHINE_CPU} == "arm" 175.if ${MACHINE_CPU} == "arm"
176SUBDIR+= arm-elf2aout 176SUBDIR+= arm-elf2aout
177.endif 177.endif
178 178
179.if ${MACHINE_CPU} == "m68k" 179.if ${MACHINE_CPU} == "m68k"
180SUBDIR+= m68k-elf2aout 180SUBDIR+= m68k-elf2aout
181.endif 181.endif
182 182
183.if !empty(MACHINE_ARCH:Mmips*) 183.if !empty(MACHINE_ARCH:Mmips*)
184SUBDIR+= mips-elf2ecoff 184SUBDIR+= mips-elf2ecoff
185.endif 185.endif
186 186
187.if (${MACHINE} == "sgimips") 187.if (${MACHINE} == "sgimips")
188SUBDIR+= sgivol 188SUBDIR+= sgivol
189.endif 189.endif
190 190
191.if ${MACHINE} == "acorn32" 191.if ${MACHINE} == "acorn32"
192SUBDIR+= sparkcrc 192SUBDIR+= sparkcrc
193.endif 193.endif
194 194
195.if (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64") 195.if (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64")
196SUBDIR+= fgen 196SUBDIR+= fgen
197.endif 197.endif
198 198
199.if ${MACHINE} == "amiga" 199.if ${MACHINE} == "amiga"
200SUBDIR+= amiga-elf2bb 200SUBDIR+= amiga-elf2bb
201SUBDIR+= amiga-txlt 201SUBDIR+= amiga-txlt
202.endif 202.endif
203 203
204.if ${MACHINE} == "hp300" 204.if ${MACHINE} == "hp300"
205SUBDIR+= hp300-mkboot 205SUBDIR+= hp300-mkboot
206.endif 206.endif
207 207
208.if ${MACHINE} == "evbarm" \ 208.if ${MACHINE} == "evbarm" \
209 && ${MACHINE_CPU} == "arm" \ 209 && ${MACHINE_CPU} == "arm" \
210 && ${TARGET_ENDIANNESS} == "1234" 210 && ${TARGET_ENDIANNESS} == "1234"
211SUBDIR+= elftosb 211SUBDIR+= elftosb
212.endif 212.endif
213 213
214.if ${MACHINE} == "evbarm" || ${MACHINE} == "evbmips" || \ 214.if ${MACHINE} == "evbarm" || ${MACHINE} == "evbmips" || \
215 ${MACHINE} == "evbppc" || ${MACHINE} == "evbsh3" || \ 215 ${MACHINE} == "evbppc" || ${MACHINE} == "evbsh3" || \
216 ${MACHINE} == "sandpoint" 216 ${MACHINE} == "sandpoint"
217SUBDIR+= mkubootimage 217SUBDIR+= mkubootimage
218SUBDIR+= libfdt .WAIT 218SUBDIR+= libfdt .WAIT
219SUBDIR+= dtc 219SUBDIR+= dtc
220.endif 220.endif
221 221
222.if ${MACHINE} == "mvme68k" 222.if ${MACHINE} == "mvme68k"
223SUBDIR+= mvme68k-wrtvid 223SUBDIR+= mvme68k-wrtvid
224.endif 224.endif
225 225
226.if ${MKX11} != "no" 226.if ${MKX11} != "no"
227SUBDIR+= makestrs 227SUBDIR+= makestrs
228SUBDIR+= makekeys 228SUBDIR+= makekeys
229.endif 229.endif
230 230
231SUBDIR+= cvslatest 231SUBDIR+= cvslatest
232 232
233.endif # TOOLS_BUILDRUMP != no 233.endif # TOOLS_BUILDRUMP != no
234 234
235check_MKTOOLS: .PHONY .NOTMAIN 235check_MKTOOLS: .PHONY .NOTMAIN
236.if ${MKTOOLS:Uyes} == "no" 236.if ${MKTOOLS:Uyes} == "no"
237 @echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and' 237 @echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and'
238 @echo '*** updating your host toolchain. This should be used only as a' 238 @echo '*** updating your host toolchain. This should be used only as a'
239 @echo '*** temporary workaround for toolchain problems, as it will result' 239 @echo '*** temporary workaround for toolchain problems, as it will result'
240 @echo '*** in version skew and build errors over time!' 240 @echo '*** in version skew and build errors over time!'
241.endif 241.endif
242 242
243.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes" # { 243.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes" # {
244SUBDIR= # empty 244SUBDIR= # empty
245realall realdepend install: check_MKTOOLS 245realall realdepend install: check_MKTOOLS
246.endif # } 246.endif # }
247 247
248.include <bsd.subdir.mk> 248.include <bsd.subdir.mk>
249.include <bsd.buildinstall.mk> 249.include <bsd.buildinstall.mk>
250.include <bsd.obj.mk> 250.include <bsd.obj.mk>
251 251
252.if !defined(PREVIOUSTOOLDIR) 252.if !defined(PREVIOUSTOOLDIR)
253. if exists(PREVIOUSTOOLDIR) 253. if exists(PREVIOUSTOOLDIR)
254PREVIOUSTOOLDIR!= cat PREVIOUSTOOLDIR 254PREVIOUSTOOLDIR!= cat PREVIOUSTOOLDIR
255. else 255. else
256PREVIOUSTOOLDIR= 256PREVIOUSTOOLDIR=
257. endif 257. endif
258.endif 258.endif
259 259
260CLEANFILES+= PREVIOUSTOOLDIR 260CLEANFILES+= PREVIOUSTOOLDIR
261 261
262realall realdepend: .MAKE 262realall realdepend: .MAKE
263.if !empty(PREVIOUSTOOLDIR) && "${PREVIOUSTOOLDIR}" != "${TOOLDIR}" 263.if !empty(PREVIOUSTOOLDIR) && "${PREVIOUSTOOLDIR}" != "${TOOLDIR}"
264 @echo "*** WARNING: TOOLDIR has moved?" 264 @echo "*** WARNING: TOOLDIR has moved?"
265 @echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'" 265 @echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
266 @echo "*** != TOOLDIR '${TOOLDIR}'" 266 @echo "*** != TOOLDIR '${TOOLDIR}'"
267 @echo "*** Cleaning mis-matched tools" 267 @echo "*** Cleaning mis-matched tools"
268 rm -f PREVIOUSTOOLDIR 268 rm -f PREVIOUSTOOLDIR
269 (cd ${.CURDIR} && ${MAKE} PREVIOUSTOOLDIR=${TOOLDIR} cleandir) 269 (cd ${.CURDIR} && ${MAKE} PREVIOUSTOOLDIR=${TOOLDIR} cleandir)
270.endif 270.endif
271 echo ${TOOLDIR} >PREVIOUSTOOLDIR 271 echo ${TOOLDIR} >PREVIOUSTOOLDIR
272 272
273cleandir: 273cleandir:
274 rm -f ${CLEANFILES} 274 rm -f ${CLEANFILES}

File Added: src/tools/date/Makefile
#	$NetBSD: Makefile,v 1.1 2021/05/26 20:19:15 christos Exp $

HOSTPROGNAME=	${_TOOL_PREFIX}date
HOST_SRCDIR=	bin/date

.include "${.CURDIR}/../Makefile.host"