blob: d8a4016a10dd06c2a17c4fbd7c4fed59645f319a [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001# 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 Silvermana67ecc72013-09-28 13:53:53 -070026 ['CC', '<!(readlink -f <(AOS)/build/crio_cc)'],
27 ['CXX', '<!(readlink -f <(AOS)/build/crio_cxx)'],
brians343bc112013-02-10 01:53:46 +000028 ],
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 Silverman6137a502013-04-22 15:41:36 -070043 '__STDC_CONSTANT_MACROS',
44 '__STDC_LIMIT_MACROS',
brians343bc112013-02-10 01:53:46 +000045 ],
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 Silverman9ba2bc42013-03-17 14:18:33 -070064
65 '-ggdb3',
brians343bc112013-02-10 01:53:46 +000066 ],
67 'cflags_c': [
68 '-std=gnu99',
69 ],
brians343bc112013-02-10 01:53:46 +000070 'include_dirs': [
71 '<(DEPTH)',
72 ],
73 'conditions': [
74 ['DEBUG=="yes"', {
75 'cflags': [
brians343bc112013-02-10 01:53:46 +000076 '-O0',
77 ],
brians343bc112013-02-10 01:53:46 +000078 }, {
79 'cflags': [
80 '-O3',
81 ],
Brian Silvermanefb993f2013-08-30 19:52:57 -070082 'ldflags': [
83 '-O3',
84 ],
brians343bc112013-02-10 01:53:46 +000085 'conditions': [['OS=="crio"', {
86 'cflags': [
87 '-fstrength-reduce',
88 '-fno-builtin',
89 '-fno-strict-aliasing',
90 ],
91 }, {
92 'cflags': [
Brian Silvermanefb993f2013-08-30 19:52:57 -070093 '-march=atom',
brians343bc112013-02-10 01:53:46 +000094 '-mfpmath=sse',
95
Brian Silverman9d1165c2013-09-01 16:46:29 -070096 '-fstack-protector-all',
brians343bc112013-02-10 01:53:46 +000097 ],
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 Silverman1579fc12013-04-22 15:41:55 -0700114 '-mcpu=603e',
brians343bc112013-02-10 01:53:46 +0000115 '-mstrict-align',
116 '-mlongcall',
117 ],
118 'cflags': [
Brian Silverman1579fc12013-04-22 15:41:55 -0700119 # The Freescale MPC5200B (cRIO-FRC) and MPC5125 (cRIO-FRC II) both
120 # have MPC603e cores according to Freescale docs.
121 '-mcpu=603e',
brians343bc112013-02-10 01:53:46 +0000122 '-mstrict-align',
123 '-mlongcall',
Brian Silverman823f3242013-11-17 13:20:22 -0800124 '-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/',
brians343bc112013-02-10 01:53:46 +0000128 '-isystem', '<(WIND_BASE)/target/h',
129 '-isystem', '<(WIND_BASE)/target/h/wrn/coreip',
130 ],
Brian Silverman6e206682013-08-31 11:43:35 -0700131 'cflags_cc': [
132 '-std=gnu++0x',
133 ],
brians343bc112013-02-10 01:53:46 +0000134 '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 Silverman6e206682013-08-31 11:43:35 -0700180
181 '-Wunused-local-typedefs',
182
183 # Give macro stack traces when they blow up.
Brian Silverman86db2a52013-09-14 15:32:25 -0700184 # 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 Silverman6e206682013-08-31 11:43:35 -0700188 ],
189 'cflags_cc': [
190 '-std=gnu++11',
brians343bc112013-02-10 01:53:46 +0000191 ],
192 'defines': [
Brian Silvermanefb993f2013-08-30 19:52:57 -0700193 '_FILE_OFFSET_BITS=64',
brians343bc112013-02-10 01:53:46 +0000194 ],
195 'libraries': [
196 '-lm',
197 '-lrt',
198 ],
199 }
200 ]
201 ],
202 },
203}