1 #******************************************************************************* 2 # $Id: Makerules.env,v 2.30.208.4 2009/01/27 01:22:16 Exp $ 3 # Top-level Makerules for defining environment variables 4 # can be included by anyone doing software at Epigram 5 #******************************************************************************* 6 7 # HOSTOS is either unix or Windows_NT. 8 # HOSTENV differentiates HOSTOS and is either freebsd, sun4, or Windows_NT. 9 # This refers to the *BUILD* environment. All environments use "GNU C" 10 # except Windows_NT which may use "GNU C" or "Microsoft C". 11 12 ifndef HOSTENV 13 # Figure what type of host we are in. 14 UNAME = $(shell uname) 15 16 ifneq ($(findstring "$(UNAME)", "FreeBSD" "NetBSD"), ) 17 HOSTENV = freebsd 18 HOSTOS = unix 19 else 20 ifneq ($(findstring "$(UNAME)", "sun4" "SunOS"), ) 21 HOSTENV = sun4 22 HOSTOS = unix 23 else 24 ifeq ($(UNAME), Linux) 25 HOSTENV = linux 26 HOSTOS = unix 27 else 28 ifneq ($(findstring "$(UNAME)", "CYGWIN32_NT" "CYGWIN32/NT" "i386" "CYGWIN_NT-4.0" "CYGWIN_NT-5.0" "CYGWIN_NT-5.1" "CYGWIN_NT-5.2" "i586" "i686"), ) 29 HOSTENV = Windows_NT 30 HOSTOS = Windows_NT 31 else 32 ifeq ($(UNAME), Darwin) 33 HOSTENV = macos 34 HOSTOS = unix 35 else 36 HOSTENV = unknown 37 HOSTOS = unknown 38 endif 39 endif 40 endif 41 endif 42 endif 43 endif 44 # In case we just defined them, make sure they are known 45 export HOSTENV 46 export HOSTOS 47 48 # TARGETENV is one of freebsd, sun4, linux, linuxarm, linuxmips, android, cygwin32, win32, or macos 49 # TARGETENV defaults to HOSTENV unless HOSTENV is Windows_NT, in 50 # which case it defaults to win32. 51 52 ifndef TARGETENV 53 ifeq ($(HOSTENV), Windows_NT) 54 TARGETENV = win32 55 else 56 TARGETENV = $(HOSTENV) 57 endif 58 endif 59 export TARGETENV 60 61 # TARGETOS defaults to HOSTOS in most cases 62 ifneq ($(findstring "$(TARGETENV)", "freebsd" "linux" "linuxarm" "linuxarm_le" "android" "linuxarm_omap" "linuxmips" "sun4" "cygwin32" "win32" "macos"), ) 63 TARGETOS = $(HOSTOS) 64 endif 65 ifeq ($(TARGETENV), bcmmips) 66 TARGETOS = bcmmips 67 endif 68 ifeq ($(TARGETENV), klsi) 69 TARGETOS = klsi 70 endif 71 ifeq ($(TARGETENV), nucleusarm) 72 TARGETOS = nucleus 73 endif 74 ifndef TARGETOS 75 TARGETOS = unknown 76 endif 77 export TARGETOS 78 79 # TARGETARCH is the target processor architecture 80 # Currently valid values are: x86, x86_mmx, sparc, unknown, or a list of any 81 # of the valid values. 82 # For the x86* family, a generic x86 is assuemd if not otherwise specified 83 # Order is important since "linux" matches both linuxmips and linux. 84 ifndef TARGETARCH 85 ifneq ($(findstring "$(TARGETENV)", "android"), ) 86 TARGETARCH = arm_android 87 endif 88 ifneq ($(findstring "$(TARGETENV)", "linuxarm_le"), ) 89 TARGETARCH = arm_le 90 endif 91 ifneq ($(findstring "$(TARGETENV)", "linuxarm" "nucleusarm"), ) 92 TARGETARCH = arm 93 endif 94 ifneq ($(findstring "$(TARGETENV)", "linuxarm_omap"), ) 95 TARGETARCH = arm_omap 96 endif 97 ifneq ($(findstring "$(TARGETENV)", "bcmmips" "linuxmips"), ) 98 TARGETARCH = mips 99 endif 100 ifneq ($(findstring "$(TARGETENV)", "sun4"), ) 101 TARGETARCH = sparc 102 endif 103 ifneq ($(findstring "$(TARGETENV)", "freebsd" "linux" "cygwin32" "win32"), ) 104 TARGETCPU = $(shell uname -m) 105 ifneq ($(findstring "$(TARGETCPU)", "sparc" "sparc64"), ) 106 TARGETARCH = $(TARGETCPU) 107 else 108 TARGETARCH = x86_mmx 109 endif 110 endif 111 ifeq ($(TARGETENV), macos) 112 TARGETCPU = $(shell uname -p) 113 ifneq ($(findstring "$(TARGETCPU)", "powerpc"), ) 114 TARGETARCH = PPC 115 else 116 TARGETARCH = x86 117 endif 118 endif 119 ifeq ($(TARGETENV), klsi) 120 TARGETARCH = klsi 121 endif 122 ifndef TARGETARCH 123 TARGETARCH = unknown 124 endif 125 endif 126 export TARGETARCH 127 128 # TARGET_TYPE is either "all" or one or more of: float64, float32, int16 129 # default is int16. "all" will get expanded into a list of all possible types 130 ifndef TARGET_TYPE 131 TARGET_TYPE = int16 132 endif 133 134 ifeq ($(TARGET_TYPE), all) 135 TARGET_TYPE = int16 float32 float64 136 endif 137 export TARGET_TYPE 138