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