blob: 3f714120e798870ae3022b7caea50e306d4c9d06 [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 ],
74 'cflags_cc': [
75 '-std=gnu++0x',
76 ],
77 'include_dirs': [
78 '<(DEPTH)',
79 ],
80 'conditions': [
81 ['DEBUG=="yes"', {
82 'cflags': [
brians343bc112013-02-10 01:53:46 +000083 '-O0',
84 ],
85 'ldflags': [
86 '-O3',
87 ],
88 }, {
89 'cflags': [
90 '-O3',
91 ],
92 'conditions': [['OS=="crio"', {
93 'cflags': [
94 '-fstrength-reduce',
95 '-fno-builtin',
96 '-fno-strict-aliasing',
97 ],
98 }, {
99 'cflags': [
100 # core2 says the same stuff as atom in the gcc docs but is supported by 4.4.5
101 '-march=core2',
102 '-mtune=generic',
103 '-msse3',
104 '-mfpmath=sse',
105
106 '-fstack-protector',
107 ],
108 }
109 ]],
110 }
111 ],
112 ['OS=="crio"', {
113 'target_conditions': [
114 ['_type=="shared_library"', {
115 'ldflags': [
116 '-r',
117 '-nostdlib',
118 '-Wl,-X',
119 ],
120 }
121 ],
122 ],
123 'ldflags': [
Brian Silverman1579fc12013-04-22 15:41:55 -0700124 '-mcpu=603e',
brians343bc112013-02-10 01:53:46 +0000125 '-mstrict-align',
126 '-mlongcall',
127 ],
128 'cflags': [
Brian Silverman1579fc12013-04-22 15:41:55 -0700129 # The Freescale MPC5200B (cRIO-FRC) and MPC5125 (cRIO-FRC II) both
130 # have MPC603e cores according to Freescale docs.
131 '-mcpu=603e',
brians343bc112013-02-10 01:53:46 +0000132 '-mstrict-align',
133 '-mlongcall',
134 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/lib/gcc/powerpc-wrs-vxworks/3.4.4/include/',
135 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/vxworks-6.3/target/h/',
136 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/',
137 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/powerpc-wrs-vxworks/',
138 '-isystem', '<(WIND_BASE)/target/h',
139 '-isystem', '<(WIND_BASE)/target/h/wrn/coreip',
140 ],
141 'defines': [
142 'CPU=PPC603',
143 'TOOL_FAMILY=gnu',
144 'TOOL=gnu',
145 '_WRS_KERNEL',
146 '__PPC__',
147# This tells eigen to not do anything with alignment at all. See
148# <http://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html> for
149# details. It really doesn't like to work without this.
150 'EIGEN_DONT_ALIGN',
151# prevent the vxworks system headers from being dumb and #defining min and max
152 'NOMINMAX',
153 ],
154 }, {
155 'variables': {
156 'no_rsync%': 0,
157 },
158 'target_conditions': [
159# default to putting outputs into rsync_dir
160 ['no_rsync==0 and _type!="static_library"', {
161 'product_dir': '<(rsync_dir)',
162 },
163 ],
164 ['_type=="loadable_module"', {
165 'product_dir': '<(so_dir)',
166 }
167 ],
168 ['_type=="loadable_module" or _type=="shared_library"', {
169 'ldflags': [
170# Support loading other shared objects that are in the same directory but not
171# the shared object load path. Required for using the swig-generated libs.
172 '-Wl,-rpath=\\$$ORIGIN',
173 ],
174 }
175 ],
176 ],
177 'ldflags': [
178 '-pthread',
179 '-m32',
180 ],
181 'library_dirs': [
182 '/usr/lib32',
183 ],
184 'cflags': [
185 '-pthread',
186 '-m32',
187 ],
188 'defines': [
189 '_LARGEFILE64_SOURCE',
190 ],
191 'libraries': [
192 '-lm',
193 '-lrt',
194 ],
195 }
196 ]
197 ],
198 },
199}