blob: bfb523443aa390888563b4795b70cd647dec70ff [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': [
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 Silverman6137a502013-04-22 15:41:36 -070047 '__STDC_CONSTANT_MACROS',
48 '__STDC_LIMIT_MACROS',
brians343bc112013-02-10 01:53:46 +000049 ],
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 Silvermanefb993f2013-08-30 19:52:57 -070068 '-Wunused-local-typedefs',
69
70 # Give macro stack traces when they blow up.
71 '-ftrack-macro-expansion',
Brian Silverman9ba2bc42013-03-17 14:18:33 -070072
73 '-ggdb3',
brians343bc112013-02-10 01:53:46 +000074 ],
75 'cflags_c': [
76 '-std=gnu99',
77 ],
78 'cflags_cc': [
Brian Silvermanefb993f2013-08-30 19:52:57 -070079 '-std=gnu++11',
brians343bc112013-02-10 01:53:46 +000080 ],
81 'include_dirs': [
82 '<(DEPTH)',
83 ],
84 'conditions': [
85 ['DEBUG=="yes"', {
86 'cflags': [
brians343bc112013-02-10 01:53:46 +000087 '-O0',
88 ],
brians343bc112013-02-10 01:53:46 +000089 }, {
90 'cflags': [
91 '-O3',
92 ],
Brian Silvermanefb993f2013-08-30 19:52:57 -070093 'ldflags': [
94 '-O3',
95 ],
brians343bc112013-02-10 01:53:46 +000096 'conditions': [['OS=="crio"', {
97 'cflags': [
98 '-fstrength-reduce',
99 '-fno-builtin',
100 '-fno-strict-aliasing',
101 ],
102 }, {
103 'cflags': [
Brian Silvermanefb993f2013-08-30 19:52:57 -0700104 '-march=atom',
brians343bc112013-02-10 01:53:46 +0000105 '-mfpmath=sse',
106
107 '-fstack-protector',
108 ],
109 }
110 ]],
111 }
112 ],
113 ['OS=="crio"', {
114 'target_conditions': [
115 ['_type=="shared_library"', {
116 'ldflags': [
117 '-r',
118 '-nostdlib',
119 '-Wl,-X',
120 ],
121 }
122 ],
123 ],
124 'ldflags': [
Brian Silverman1579fc12013-04-22 15:41:55 -0700125 '-mcpu=603e',
brians343bc112013-02-10 01:53:46 +0000126 '-mstrict-align',
127 '-mlongcall',
128 ],
129 'cflags': [
Brian Silverman1579fc12013-04-22 15:41:55 -0700130 # The Freescale MPC5200B (cRIO-FRC) and MPC5125 (cRIO-FRC II) both
131 # have MPC603e cores according to Freescale docs.
132 '-mcpu=603e',
brians343bc112013-02-10 01:53:46 +0000133 '-mstrict-align',
134 '-mlongcall',
135 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/lib/gcc/powerpc-wrs-vxworks/3.4.4/include/',
136 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/vxworks-6.3/target/h/',
137 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/',
138 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/powerpc-wrs-vxworks/',
139 '-isystem', '<(WIND_BASE)/target/h',
140 '-isystem', '<(WIND_BASE)/target/h/wrn/coreip',
141 ],
142 'defines': [
143 'CPU=PPC603',
144 'TOOL_FAMILY=gnu',
145 'TOOL=gnu',
146 '_WRS_KERNEL',
147 '__PPC__',
148# This tells eigen to not do anything with alignment at all. See
149# <http://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html> for
150# details. It really doesn't like to work without this.
151 'EIGEN_DONT_ALIGN',
152# prevent the vxworks system headers from being dumb and #defining min and max
153 'NOMINMAX',
154 ],
155 }, {
156 'variables': {
157 'no_rsync%': 0,
158 },
159 'target_conditions': [
160# default to putting outputs into rsync_dir
161 ['no_rsync==0 and _type!="static_library"', {
162 'product_dir': '<(rsync_dir)',
163 },
164 ],
165 ['_type=="loadable_module"', {
166 'product_dir': '<(so_dir)',
167 }
168 ],
169 ['_type=="loadable_module" or _type=="shared_library"', {
170 'ldflags': [
171# Support loading other shared objects that are in the same directory but not
172# the shared object load path. Required for using the swig-generated libs.
173 '-Wl,-rpath=\\$$ORIGIN',
174 ],
175 }
176 ],
177 ],
178 'ldflags': [
179 '-pthread',
180 '-m32',
181 ],
182 'library_dirs': [
183 '/usr/lib32',
184 ],
185 'cflags': [
186 '-pthread',
187 '-m32',
188 ],
189 'defines': [
Brian Silvermanefb993f2013-08-30 19:52:57 -0700190 '_FILE_OFFSET_BITS=64',
brians343bc112013-02-10 01:53:46 +0000191 ],
192 'libraries': [
193 '-lm',
194 '-lrt',
195 ],
196 }
197 ]
198 ],
199 },
200}