brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | # This file gets passed to gyp with -I so that it gets included everywhere. |
| 2 | { |
| 3 | 'variables': { |
| 4 | 'AOS': '<(DEPTH)/aos', |
| 5 | # A directory with everything in it ignored from source control. |
| 6 | 'TMPDIR': '<(DEPTH)/aos/build/temp', |
| 7 | 'aos_abs': '<!(readlink -f <(DEPTH)/aos)', # for use in non-path contexts |
| 8 | # the .gyp file that has targets for the various external libraries |
| 9 | 'EXTERNALS': '<(AOS)/build/externals.gyp', |
Brian Silverman | 14fd0fb | 2014-01-14 21:42:01 -0800 | [diff] [blame] | 10 | # the directory that gets rsynced to the target |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 11 | 'rsync_dir': '<(PRODUCT_DIR)/outputs', |
| 12 | # The directory that loadable_module and shared_library targets get put into |
| 13 | # There's a target_conditions that puts loadable_modules here and |
| 14 | # shared_librarys automatically get put here. |
| 15 | 'so_dir': '<(PRODUCT_DIR)/lib', |
| 16 | # the directory that executables that depend on <(EXTERNALS):gtest get put into |
| 17 | 'test_dir': '<(PRODUCT_DIR)/tests', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 18 | }, |
| 19 | 'conditions': [ |
| 20 | ['OS=="crio"', { |
| 21 | 'make_global_settings': [ |
Brian Silverman | a67ecc7 | 2013-09-28 13:53:53 -0700 | [diff] [blame] | 22 | ['CC', '<!(readlink -f <(AOS)/build/crio_cc)'], |
| 23 | ['CXX', '<!(readlink -f <(AOS)/build/crio_cxx)'], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 24 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 25 | } |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame^] | 26 | ], ['PLATFORM=="linux-arm-gcc"', { |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 27 | 'make_global_settings': [ |
| 28 | ['CC', '<!(which arm-linux-gnueabihf-gcc-4.7)'], |
| 29 | ['CXX', '<!(which arm-linux-gnueabihf-g++-4.7)'], |
| 30 | ], |
| 31 | }, |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame^] | 32 | ], ['PLATFORM=="linux-arm-clang"', { |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 33 | # TODO(brians): Make this one actually work. |
| 34 | }, |
| 35 | ], ['PLATFORM=="linux-amd64-clang"', { |
| 36 | 'make_global_settings': [ |
| 37 | ['CC', '<!(which clang)'], |
| 38 | ['CXX', '<!(which clang++)'], |
| 39 | ], |
| 40 | }, |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame^] | 41 | ], ['PLATFORM=="linux-amd64-gcc"', { |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 42 | }, |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 43 | ], |
| 44 | ], |
| 45 | 'target_defaults': { |
| 46 | 'defines': [ |
| 47 | '__STDC_FORMAT_MACROS', |
| 48 | '_FORTIFY_SOURCE=2', |
Brian Silverman | 6137a50 | 2013-04-22 15:41:36 -0700 | [diff] [blame] | 49 | '__STDC_CONSTANT_MACROS', |
| 50 | '__STDC_LIMIT_MACROS', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 51 | ], |
| 52 | 'ldflags': [ |
| 53 | '-pipe', |
| 54 | ], |
| 55 | 'cflags': [ |
| 56 | '-pipe', |
| 57 | |
| 58 | '-Wall', |
| 59 | '-Wextra', |
| 60 | '-Wswitch-enum', |
| 61 | '-Wpointer-arith', |
| 62 | '-Wstrict-aliasing=2', |
| 63 | '-Wcast-qual', |
| 64 | '-Wcast-align', |
| 65 | '-Wwrite-strings', |
| 66 | '-Wtype-limits', |
| 67 | '-Wsign-compare', |
| 68 | '-Wformat=2', |
| 69 | '-Werror', |
Brian Silverman | 9ba2bc4 | 2013-03-17 14:18:33 -0700 | [diff] [blame] | 70 | |
| 71 | '-ggdb3', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 72 | ], |
| 73 | 'cflags_c': [ |
| 74 | '-std=gnu99', |
| 75 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 76 | 'include_dirs': [ |
| 77 | '<(DEPTH)', |
| 78 | ], |
Brian Silverman | d0a52dc | 2013-09-23 17:55:37 -0700 | [diff] [blame] | 79 | # These have to be here because apparently gyp evaluates target_conditions |
| 80 | # even if the target is never used. |
| 81 | 'variables': { |
| 82 | # Set this to 1 to disable rsyncing the file to the target. |
| 83 | 'no_rsync%': 0, |
Brian Silverman | 2a36ddb | 2014-04-08 17:07:28 -0700 | [diff] [blame] | 84 | # Set this to 1 if this file is a test that should not be run by |
Brian Silverman | d0a52dc | 2013-09-23 17:55:37 -0700 | [diff] [blame] | 85 | # `build.sh tests`. |
| 86 | 'is_special_test%': 0, |
| 87 | }, |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 88 | 'conditions': [ |
| 89 | ['DEBUG=="yes"', { |
| 90 | 'cflags': [ |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 91 | '-O0', |
| 92 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 93 | }, { |
| 94 | 'cflags': [ |
| 95 | '-O3', |
Brian Silverman | 2a36ddb | 2014-04-08 17:07:28 -0700 | [diff] [blame] | 96 | '-fomit-frame-pointer', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 97 | ], |
Brian Silverman | efb993f | 2013-08-30 19:52:57 -0700 | [diff] [blame] | 98 | 'ldflags': [ |
| 99 | '-O3', |
| 100 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 101 | 'conditions': [['OS=="crio"', { |
| 102 | 'cflags': [ |
| 103 | '-fstrength-reduce', |
| 104 | '-fno-builtin', |
| 105 | '-fno-strict-aliasing', |
| 106 | ], |
Brian Silverman | 41abe01 | 2014-02-08 18:25:02 -0800 | [diff] [blame] | 107 | }], |
| 108 | ['PLATFORM=="linux"', { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 109 | 'cflags': [ |
Brian Silverman | c432132 | 2013-11-18 17:38:39 -0800 | [diff] [blame] | 110 | '-mcpu=cortex-a8', |
Brian Silverman | 4620361 | 2013-11-19 18:01:41 -0800 | [diff] [blame] | 111 | '-mfpu=neon', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 112 | ], |
Brian Silverman | 41abe01 | 2014-02-08 18:25:02 -0800 | [diff] [blame] | 113 | }], |
| 114 | ['PLATFORM=="linux-amd64"', { |
| 115 | 'cflags': [ |
| 116 | '-march=atom', |
| 117 | '-mfpmath=sse', |
| 118 | |
| 119 | '-fstack-protector-all', |
| 120 | ], |
| 121 | }], |
| 122 | ] |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 123 | } |
| 124 | ], |
| 125 | ['OS=="crio"', { |
| 126 | 'target_conditions': [ |
| 127 | ['_type=="shared_library"', { |
| 128 | 'ldflags': [ |
| 129 | '-r', |
| 130 | '-nostdlib', |
| 131 | '-Wl,-X', |
| 132 | ], |
| 133 | } |
| 134 | ], |
| 135 | ], |
| 136 | 'ldflags': [ |
Brian Silverman | 1579fc1 | 2013-04-22 15:41:55 -0700 | [diff] [blame] | 137 | '-mcpu=603e', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 138 | '-mstrict-align', |
| 139 | '-mlongcall', |
| 140 | ], |
| 141 | 'cflags': [ |
Brian Silverman | 1579fc1 | 2013-04-22 15:41:55 -0700 | [diff] [blame] | 142 | # The Freescale MPC5200B (cRIO-FRC) and MPC5125 (cRIO-FRC II) both |
| 143 | # have MPC603e cores according to Freescale docs. |
| 144 | '-mcpu=603e', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 145 | '-mstrict-align', |
| 146 | '-mlongcall', |
Brian Silverman | 823f324 | 2013-11-17 13:20:22 -0800 | [diff] [blame] | 147 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/lib/gcc/powerpc-wrs-vxworks/3.4.4/include/', |
| 148 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/vxworks-6.3/target/h/', |
| 149 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/', |
| 150 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/powerpc-wrs-vxworks/', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 151 | '-isystem', '<(WIND_BASE)/target/h', |
| 152 | '-isystem', '<(WIND_BASE)/target/h/wrn/coreip', |
| 153 | ], |
Brian Silverman | 6e20668 | 2013-08-31 11:43:35 -0700 | [diff] [blame] | 154 | 'cflags_cc': [ |
| 155 | '-std=gnu++0x', |
| 156 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 157 | 'defines': [ |
| 158 | 'CPU=PPC603', |
| 159 | 'TOOL_FAMILY=gnu', |
| 160 | 'TOOL=gnu', |
| 161 | '_WRS_KERNEL', |
| 162 | '__PPC__', |
| 163 | # This tells eigen to not do anything with alignment at all. See |
| 164 | # <http://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html> for |
| 165 | # details. It really doesn't like to work without this. |
| 166 | 'EIGEN_DONT_ALIGN', |
| 167 | # prevent the vxworks system headers from being dumb and #defining min and max |
| 168 | 'NOMINMAX', |
| 169 | ], |
| 170 | }, { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 171 | 'target_conditions': [ |
| 172 | # default to putting outputs into rsync_dir |
| 173 | ['no_rsync==0 and _type!="static_library"', { |
| 174 | 'product_dir': '<(rsync_dir)', |
| 175 | }, |
| 176 | ], |
| 177 | ['_type=="loadable_module"', { |
| 178 | 'product_dir': '<(so_dir)', |
| 179 | } |
| 180 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 181 | ], |
| 182 | 'ldflags': [ |
| 183 | '-pthread', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 184 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 185 | 'cflags': [ |
| 186 | '-pthread', |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 187 | '-fno-exceptions', |
Brian Silverman | 6e20668 | 2013-08-31 11:43:35 -0700 | [diff] [blame] | 188 | ], |
| 189 | 'cflags_cc': [ |
| 190 | '-std=gnu++11', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 191 | ], |
| 192 | 'defines': [ |
Brian Silverman | efb993f | 2013-08-30 19:52:57 -0700 | [diff] [blame] | 193 | '_FILE_OFFSET_BITS=64', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 194 | ], |
| 195 | 'libraries': [ |
| 196 | '-lm', |
| 197 | '-lrt', |
| 198 | ], |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 199 | 'conditions': [ |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame^] | 200 | ['COMPILER=="gcc"', { |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 201 | 'cflags': [ |
| 202 | '-Wunused-local-typedefs', |
| 203 | ], |
| 204 | }, |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame^] | 205 | ], ['COMPILER=="clang"', { |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 206 | 'cflags': [ |
| 207 | '-fcolor-diagnostics', |
| 208 | ], |
| 209 | 'defines': [ |
| 210 | # To work around <http://llvm.org/bugs/show_bug.cgi?id=13530>. |
| 211 | '__float128=void', |
| 212 | # This tells clang's optimizer the same thing. |
| 213 | '__builtin_assume_aligned(p, a)=(((uintptr_t(p) % (a)) == 0) ? (p) : (__builtin_unreachable(), (p)))', |
| 214 | ], |
| 215 | }, |
| 216 | ], |
| 217 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 218 | } |
| 219 | ] |
| 220 | ], |
| 221 | }, |
| 222 | } |