lib/fm/topo/module: build 64-bit
[unleashed.git] / share / mk / host-target.mk
blobf528db9c6d24195bb082ec844f91e7522b7adb03
1 # RCSid:
2 # $Id: host-target.mk,v 1.11 2015/10/25 00:07:20 sjg Exp $
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_MACHINE)
14 _HOST_MACHINE != uname -m
15 .export _HOST_MACHINE
16 .endif
17 .if !defined(_HOST_ARCH)
18 # for NetBSD prefer $MACHINE (amd64 rather than x86_64)
19 .if ${_HOST_OSNAME:NNetBSD} == ""
20 _HOST_ARCH := ${_HOST_MACHINE}
21 .else
22 _HOST_ARCH != uname -p 2> /dev/null || uname -m
23 # uname -p may produce garbage on linux
24 .if ${_HOST_ARCH:[\#]} > 1 || ${_HOST_ARCH:Nunknown} == ""
25 _HOST_ARCH := ${_HOST_MACHINE}
26 .endif
27 .endif
28 .export _HOST_ARCH
29 .endif
30 .if !defined(HOST_MACHINE)
31 HOST_MACHINE := ${_HOST_MACHINE}
32 .export HOST_MACHINE
33 .endif
35 HOST_OSMAJOR := ${_HOST_OSREL:C/[^0-9].*//}
36 HOST_OSTYPE := ${_HOST_OSNAME:S,/,,g}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH}
37 HOST_OS := ${_HOST_OSNAME}
38 host_os := ${_HOST_OSNAME:tl}
39 HOST_TARGET := ${host_os:S,/,,g}${HOST_OSMAJOR}-${_HOST_ARCH}
41 # tr is insanely non-portable, accommodate the lowest common denominator
42 TR ?= tr
43 toLower = ${TR} 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'
44 toUpper = ${TR} 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'