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