blob: 08bf9751dd827e654ff5582ea48cac8f486ee8c1 [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',
47 ],
48 'ldflags': [
49 '-pipe',
50 ],
51 'cflags': [
52 '-pipe',
53
54 '-Wall',
55 '-Wextra',
56 '-Wswitch-enum',
57 '-Wpointer-arith',
58 '-Wstrict-aliasing=2',
59 '-Wcast-qual',
60 '-Wcast-align',
61 '-Wwrite-strings',
62 '-Wtype-limits',
63 '-Wsign-compare',
64 '-Wformat=2',
65 '-Werror',
66 ],
67 'cflags_c': [
68 '-std=gnu99',
69 ],
70 'cflags_cc': [
71 '-std=gnu++0x',
72 ],
73 'include_dirs': [
74 '<(DEPTH)',
75 ],
76 'conditions': [
77 ['DEBUG=="yes"', {
78 'cflags': [
79 '-ggdb3',
80 '-O0',
81 ],
82 'ldflags': [
83 '-O3',
84 ],
85 }, {
86 'cflags': [
87 '-O3',
88 ],
89 'conditions': [['OS=="crio"', {
90 'cflags': [
91 '-fstrength-reduce',
92 '-fno-builtin',
93 '-fno-strict-aliasing',
94 ],
95 }, {
96 'cflags': [
97 # core2 says the same stuff as atom in the gcc docs but is supported by 4.4.5
98 '-march=core2',
99 '-mtune=generic',
100 '-msse3',
101 '-mfpmath=sse',
102
103 '-fstack-protector',
104 ],
105 }
106 ]],
107 }
108 ],
109 ['OS=="crio"', {
110 'target_conditions': [
111 ['_type=="shared_library"', {
112 'ldflags': [
113 '-r',
114 '-nostdlib',
115 '-Wl,-X',
116 ],
117 }
118 ],
119 ],
120 'ldflags': [
121 '-mcpu=603',
122 '-mstrict-align',
123 '-mlongcall',
124 ],
125 'cflags': [
126 '-mcpu=603',
127 '-mstrict-align',
128 '-mlongcall',
129 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/lib/gcc/powerpc-wrs-vxworks/3.4.4/include/',
130 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/vxworks-6.3/target/h/',
131 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/',
132 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/powerpc-wrs-vxworks/',
133 '-isystem', '<(WIND_BASE)/target/h',
134 '-isystem', '<(WIND_BASE)/target/h/wrn/coreip',
135 ],
136 'defines': [
137 'CPU=PPC603',
138 'TOOL_FAMILY=gnu',
139 'TOOL=gnu',
140 '_WRS_KERNEL',
141 '__PPC__',
142# This tells eigen to not do anything with alignment at all. See
143# <http://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html> for
144# details. It really doesn't like to work without this.
145 'EIGEN_DONT_ALIGN',
146# prevent the vxworks system headers from being dumb and #defining min and max
147 'NOMINMAX',
148 ],
149 }, {
150 'variables': {
151 'no_rsync%': 0,
152 },
153 'target_conditions': [
154# default to putting outputs into rsync_dir
155 ['no_rsync==0 and _type!="static_library"', {
156 'product_dir': '<(rsync_dir)',
157 },
158 ],
159 ['_type=="loadable_module"', {
160 'product_dir': '<(so_dir)',
161 }
162 ],
163 ['_type=="loadable_module" or _type=="shared_library"', {
164 'ldflags': [
165# Support loading other shared objects that are in the same directory but not
166# the shared object load path. Required for using the swig-generated libs.
167 '-Wl,-rpath=\\$$ORIGIN',
168 ],
169 }
170 ],
171 ],
172 'ldflags': [
173 '-pthread',
174 '-m32',
175 ],
176 'library_dirs': [
177 '/usr/lib32',
178 ],
179 'cflags': [
180 '-pthread',
181 '-m32',
182 ],
183 'defines': [
184 '_LARGEFILE64_SOURCE',
185 ],
186 'libraries': [
187 '-lm',
188 '-lrt',
189 ],
190 }
191 ]
192 ],
193 },
194}