blob: 115ae0698d2b13a7236024dfc8523d844526bc64 [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': [
124 '-mcpu=603',
125 '-mstrict-align',
126 '-mlongcall',
127 ],
128 'cflags': [
129 '-mcpu=603',
130 '-mstrict-align',
131 '-mlongcall',
132 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/lib/gcc/powerpc-wrs-vxworks/3.4.4/include/',
133 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/vxworks-6.3/target/h/',
134 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/',
135 '-isystem', '<(aos_abs)/externals/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/powerpc-wrs-vxworks/',
136 '-isystem', '<(WIND_BASE)/target/h',
137 '-isystem', '<(WIND_BASE)/target/h/wrn/coreip',
138 ],
139 'defines': [
140 'CPU=PPC603',
141 'TOOL_FAMILY=gnu',
142 'TOOL=gnu',
143 '_WRS_KERNEL',
144 '__PPC__',
145# This tells eigen to not do anything with alignment at all. See
146# <http://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html> for
147# details. It really doesn't like to work without this.
148 'EIGEN_DONT_ALIGN',
149# prevent the vxworks system headers from being dumb and #defining min and max
150 'NOMINMAX',
151 ],
152 }, {
153 'variables': {
154 'no_rsync%': 0,
155 },
156 'target_conditions': [
157# default to putting outputs into rsync_dir
158 ['no_rsync==0 and _type!="static_library"', {
159 'product_dir': '<(rsync_dir)',
160 },
161 ],
162 ['_type=="loadable_module"', {
163 'product_dir': '<(so_dir)',
164 }
165 ],
166 ['_type=="loadable_module" or _type=="shared_library"', {
167 'ldflags': [
168# Support loading other shared objects that are in the same directory but not
169# the shared object load path. Required for using the swig-generated libs.
170 '-Wl,-rpath=\\$$ORIGIN',
171 ],
172 }
173 ],
174 ],
175 'ldflags': [
176 '-pthread',
177 '-m32',
178 ],
179 'library_dirs': [
180 '/usr/lib32',
181 ],
182 'cflags': [
183 '-pthread',
184 '-m32',
185 ],
186 'defines': [
187 '_LARGEFILE64_SOURCE',
188 ],
189 'libraries': [
190 '-lm',
191 '-lrt',
192 ],
193 }
194 ]
195 ],
196 },
197}