Update to bmake-20131001 on the vendor branch
[dragonfly.git] / contrib / bmake / mk / host-target.mk
1 # RCSid:
2 #       $Id: host-target.mk,v 1.6 2011/03/02 05:05:21 sjg Exp $
3
4 # Host platform information; may be overridden
5 .if !defined(_HOST_OSNAME)
6 _HOST_OSNAME != uname -s
7 .export _HOST_OSNAME
8 .endif
9 .if !defined(_HOST_OSREL)
10 _HOST_OSREL  != uname -r
11 .export _HOST_OSREL
12 .endif
13 .if !defined(_HOST_ARCH)
14 _HOST_ARCH   != uname -p 2>/dev/null || uname -m
15 # uname -p may produce garbage on linux
16 .if ${_HOST_ARCH:[\#]} > 1
17 _HOST_ARCH != uname -m
18 .endif
19 .export _HOST_ARCH
20 .endif
21
22 HOST_OSMAJOR := ${_HOST_OSREL:C/[^0-9].*//}
23 HOST_OSTYPE  := ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH}
24 HOST_OS      := ${_HOST_OSNAME}
25 host_os      := ${_HOST_OSNAME:tl}
26 HOST_TARGET  := ${host_os}${HOST_OSMAJOR}-${_HOST_ARCH}
27
28 # tr is insanely non-portable, accommodate the lowest common denominator
29 TR ?= tr
30 toLower = ${TR} 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'
31 toUpper = ${TR} 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'