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', |
| 10 | # the directory that gets rsynced to the atom |
| 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', |
| 18 | # 'executable' for the atom and 'static_library' for the cRIO |
| 19 | # Useful for targets that should either be an executable or get compiled into |
| 20 | # a .out file depending on the current platform. |
| 21 | # 'aos_target': platform-dependent, |
| 22 | }, |
| 23 | 'conditions': [ |
| 24 | ['OS=="crio"', { |
| 25 | 'make_global_settings': [ |
Brian Silverman | a67ecc7 | 2013-09-28 13:53:53 -0700 | [diff] [blame] | 26 | ['CC', '<!(readlink -f <(AOS)/build/crio_cc)'], |
| 27 | ['CXX', '<!(readlink -f <(AOS)/build/crio_cxx)'], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 28 | ], |
| 29 | 'variables': { |
| 30 | 'aos_target': 'static_library', |
| 31 | }, |
| 32 | }, { |
| 33 | 'variables': { |
| 34 | 'aos_target': 'executable', |
| 35 | }, |
| 36 | } |
| 37 | ], |
| 38 | ], |
| 39 | 'target_defaults': { |
| 40 | 'defines': [ |
| 41 | '__STDC_FORMAT_MACROS', |
| 42 | '_FORTIFY_SOURCE=2', |
Brian Silverman | 6137a50 | 2013-04-22 15:41:36 -0700 | [diff] [blame] | 43 | '__STDC_CONSTANT_MACROS', |
| 44 | '__STDC_LIMIT_MACROS', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 45 | ], |
| 46 | 'ldflags': [ |
| 47 | '-pipe', |
| 48 | ], |
| 49 | 'cflags': [ |
| 50 | '-pipe', |
| 51 | |
| 52 | '-Wall', |
| 53 | '-Wextra', |
| 54 | '-Wswitch-enum', |
| 55 | '-Wpointer-arith', |
| 56 | '-Wstrict-aliasing=2', |
| 57 | '-Wcast-qual', |
| 58 | '-Wcast-align', |
| 59 | '-Wwrite-strings', |
| 60 | '-Wtype-limits', |
| 61 | '-Wsign-compare', |
| 62 | '-Wformat=2', |
| 63 | '-Werror', |
Brian Silverman | 9ba2bc4 | 2013-03-17 14:18:33 -0700 | [diff] [blame] | 64 | |
| 65 | '-ggdb3', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 66 | ], |
| 67 | 'cflags_c': [ |
| 68 | '-std=gnu99', |
| 69 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 70 | 'include_dirs': [ |
| 71 | '<(DEPTH)', |
| 72 | ], |
| 73 | 'conditions': [ |
| 74 | ['DEBUG=="yes"', { |
| 75 | 'cflags': [ |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 76 | '-O0', |
| 77 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 78 | }, { |
| 79 | 'cflags': [ |
| 80 | '-O3', |
| 81 | ], |
Brian Silverman | efb993f | 2013-08-30 19:52:57 -0700 | [diff] [blame] | 82 | 'ldflags': [ |
| 83 | '-O3', |
| 84 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 85 | 'conditions': [['OS=="crio"', { |
| 86 | 'cflags': [ |
| 87 | '-fstrength-reduce', |
| 88 | '-fno-builtin', |
| 89 | '-fno-strict-aliasing', |
| 90 | ], |
| 91 | }, { |
| 92 | 'cflags': [ |
Brian Silverman | efb993f | 2013-08-30 19:52:57 -0700 | [diff] [blame] | 93 | '-march=atom', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 94 | '-mfpmath=sse', |
| 95 | |
Brian Silverman | 9d1165c | 2013-09-01 16:46:29 -0700 | [diff] [blame] | 96 | '-fstack-protector-all', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 97 | ], |
| 98 | } |
| 99 | ]], |
| 100 | } |
| 101 | ], |
| 102 | ['OS=="crio"', { |
| 103 | 'target_conditions': [ |
| 104 | ['_type=="shared_library"', { |
| 105 | 'ldflags': [ |
| 106 | '-r', |
| 107 | '-nostdlib', |
| 108 | '-Wl,-X', |
| 109 | ], |
| 110 | } |
| 111 | ], |
| 112 | ], |
| 113 | 'ldflags': [ |
Brian Silverman | 1579fc1 | 2013-04-22 15:41:55 -0700 | [diff] [blame] | 114 | '-mcpu=603e', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 115 | '-mstrict-align', |
| 116 | '-mlongcall', |
| 117 | ], |
| 118 | 'cflags': [ |
Brian Silverman | 1579fc1 | 2013-04-22 15:41:55 -0700 | [diff] [blame] | 119 | # The Freescale MPC5200B (cRIO-FRC) and MPC5125 (cRIO-FRC II) both |
| 120 | # have MPC603e cores according to Freescale docs. |
| 121 | '-mcpu=603e', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 122 | '-mstrict-align', |
| 123 | '-mlongcall', |
Brian Silverman | 823f324 | 2013-11-17 13:20:22 -0800 | [diff] [blame] | 124 | '-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/', |
| 125 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/vxworks-6.3/target/h/', |
| 126 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/', |
| 127 | '-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] | 128 | '-isystem', '<(WIND_BASE)/target/h', |
| 129 | '-isystem', '<(WIND_BASE)/target/h/wrn/coreip', |
| 130 | ], |
Brian Silverman | 6e20668 | 2013-08-31 11:43:35 -0700 | [diff] [blame] | 131 | 'cflags_cc': [ |
| 132 | '-std=gnu++0x', |
| 133 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 134 | 'defines': [ |
| 135 | 'CPU=PPC603', |
| 136 | 'TOOL_FAMILY=gnu', |
| 137 | 'TOOL=gnu', |
| 138 | '_WRS_KERNEL', |
| 139 | '__PPC__', |
| 140 | # This tells eigen to not do anything with alignment at all. See |
| 141 | # <http://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html> for |
| 142 | # details. It really doesn't like to work without this. |
| 143 | 'EIGEN_DONT_ALIGN', |
| 144 | # prevent the vxworks system headers from being dumb and #defining min and max |
| 145 | 'NOMINMAX', |
| 146 | ], |
| 147 | }, { |
| 148 | 'variables': { |
| 149 | 'no_rsync%': 0, |
| 150 | }, |
| 151 | 'target_conditions': [ |
| 152 | # default to putting outputs into rsync_dir |
| 153 | ['no_rsync==0 and _type!="static_library"', { |
| 154 | 'product_dir': '<(rsync_dir)', |
| 155 | }, |
| 156 | ], |
| 157 | ['_type=="loadable_module"', { |
| 158 | 'product_dir': '<(so_dir)', |
| 159 | } |
| 160 | ], |
| 161 | ['_type=="loadable_module" or _type=="shared_library"', { |
| 162 | 'ldflags': [ |
| 163 | # Support loading other shared objects that are in the same directory but not |
| 164 | # the shared object load path. Required for using the swig-generated libs. |
| 165 | '-Wl,-rpath=\\$$ORIGIN', |
| 166 | ], |
| 167 | } |
| 168 | ], |
| 169 | ], |
| 170 | 'ldflags': [ |
| 171 | '-pthread', |
| 172 | '-m32', |
| 173 | ], |
| 174 | 'library_dirs': [ |
| 175 | '/usr/lib32', |
| 176 | ], |
| 177 | 'cflags': [ |
| 178 | '-pthread', |
| 179 | '-m32', |
Brian Silverman | 6e20668 | 2013-08-31 11:43:35 -0700 | [diff] [blame] | 180 | |
| 181 | '-Wunused-local-typedefs', |
| 182 | |
| 183 | # Give macro stack traces when they blow up. |
Brian Silverman | 86db2a5 | 2013-09-14 15:32:25 -0700 | [diff] [blame] | 184 | # TODO(brians): Re-enable this once they fix the bug where it |
| 185 | # sometimes doesn't show you the top-most (aka most useful) |
| 186 | # line of code. |
| 187 | #'-ftrack-macro-expansion', |
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 | ], |
| 199 | } |
| 200 | ] |
| 201 | ], |
| 202 | }, |
| 203 | } |