blob: 9eeba08b6b448ac4d0c638e000770c7badb683ec [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 Silverman9ba2bc42013-03-17 14:18:33 -070068
69 '-ggdb3',
brians343bc112013-02-10 01:53:46 +000070 ],
71 'cflags_c': [
72 '-std=gnu99',
73 ],
brians343bc112013-02-10 01:53:46 +000074 'include_dirs': [
75 '<(DEPTH)',
76 ],
Brian Silvermand0a52dc2013-09-23 17:55:37 -070077 # These have to be here because apparently gyp evaluates target_conditions
78 # even if the target is never used.
79 'variables': {
80 # Set this to 1 to disable rsyncing the file to the target.
81 'no_rsync%': 0,
82 # Set this to 1 if this file isn't a test that should get run by
83 # `build.sh tests`.
84 'is_special_test%': 0,
85 },
brians343bc112013-02-10 01:53:46 +000086 'conditions': [
87 ['DEBUG=="yes"', {
88 'cflags': [
brians343bc112013-02-10 01:53:46 +000089 '-O0',
90 ],
brians343bc112013-02-10 01:53:46 +000091 }, {
92 'cflags': [
93 '-O3',
94 ],
Brian Silvermanefb993f2013-08-30 19:52:57 -070095 'ldflags': [
96 '-O3',
97 ],
brians343bc112013-02-10 01:53:46 +000098 'conditions': [['OS=="crio"', {
99 'cflags': [
100 '-fstrength-reduce',
101 '-fno-builtin',
102 '-fno-strict-aliasing',
103 ],
104 }, {
105 'cflags': [
Brian Silvermanefb993f2013-08-30 19:52:57 -0700106 '-march=atom',
brians343bc112013-02-10 01:53:46 +0000107 '-mfpmath=sse',
108
Brian Silverman9d1165c2013-09-01 16:46:29 -0700109 '-fstack-protector-all',
brians343bc112013-02-10 01:53:46 +0000110 ],
111 }
112 ]],
113 }
114 ],
115 ['OS=="crio"', {
116 'target_conditions': [
117 ['_type=="shared_library"', {
118 'ldflags': [
119 '-r',
120 '-nostdlib',
121 '-Wl,-X',
122 ],
123 }
124 ],
125 ],
126 'ldflags': [
Brian Silverman1579fc12013-04-22 15:41:55 -0700127 '-mcpu=603e',
brians343bc112013-02-10 01:53:46 +0000128 '-mstrict-align',
129 '-mlongcall',
130 ],
131 'cflags': [
Brian Silverman1579fc12013-04-22 15:41:55 -0700132 # The Freescale MPC5200B (cRIO-FRC) and MPC5125 (cRIO-FRC II) both
133 # have MPC603e cores according to Freescale docs.
134 '-mcpu=603e',
brians343bc112013-02-10 01:53:46 +0000135 '-mstrict-align',
136 '-mlongcall',
137 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/lib/gcc/powerpc-wrs-vxworks/3.4.4/include/',
138 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/vxworks-6.3/target/h/',
139 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/',
140 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/powerpc-wrs-vxworks/',
141 '-isystem', '<(WIND_BASE)/target/h',
142 '-isystem', '<(WIND_BASE)/target/h/wrn/coreip',
143 ],
Brian Silverman6e206682013-08-31 11:43:35 -0700144 'cflags_cc': [
145 '-std=gnu++0x',
146 ],
brians343bc112013-02-10 01:53:46 +0000147 'defines': [
148 'CPU=PPC603',
149 'TOOL_FAMILY=gnu',
150 'TOOL=gnu',
151 '_WRS_KERNEL',
152 '__PPC__',
153# This tells eigen to not do anything with alignment at all. See
154# <http://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html> for
155# details. It really doesn't like to work without this.
156 'EIGEN_DONT_ALIGN',
157# prevent the vxworks system headers from being dumb and #defining min and max
158 'NOMINMAX',
159 ],
160 }, {
brians343bc112013-02-10 01:53:46 +0000161 'target_conditions': [
162# default to putting outputs into rsync_dir
163 ['no_rsync==0 and _type!="static_library"', {
164 'product_dir': '<(rsync_dir)',
165 },
166 ],
167 ['_type=="loadable_module"', {
168 'product_dir': '<(so_dir)',
169 }
170 ],
171 ['_type=="loadable_module" or _type=="shared_library"', {
172 'ldflags': [
173# Support loading other shared objects that are in the same directory but not
174# the shared object load path. Required for using the swig-generated libs.
175 '-Wl,-rpath=\\$$ORIGIN',
176 ],
177 }
178 ],
179 ],
180 'ldflags': [
181 '-pthread',
182 '-m32',
183 ],
184 'library_dirs': [
185 '/usr/lib32',
186 ],
187 'cflags': [
188 '-pthread',
189 '-m32',
Brian Silverman6e206682013-08-31 11:43:35 -0700190
191 '-Wunused-local-typedefs',
192
193 # Give macro stack traces when they blow up.
194 '-ftrack-macro-expansion',
195 ],
196 'cflags_cc': [
197 '-std=gnu++11',
brians343bc112013-02-10 01:53:46 +0000198 ],
199 'defines': [
Brian Silvermanefb993f2013-08-30 19:52:57 -0700200 '_FILE_OFFSET_BITS=64',
brians343bc112013-02-10 01:53:46 +0000201 ],
202 'libraries': [
203 '-lm',
204 '-lrt',
205 ],
206 }
207 ]
208 ],
209 },
210}