blob: 13a45b4a7732c488ab2914948f9b65a71f3b85af [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': [
Brian Silvermana67ecc72013-09-28 13:53:53 -070026 ['CC', '<!(readlink -f <(AOS)/build/crio_cc)'],
27 ['CXX', '<!(readlink -f <(AOS)/build/crio_cxx)'],
brians343bc112013-02-10 01:53:46 +000028 ],
29 'variables': {
30 'aos_target': 'static_library',
31 },
32 }, {
Brian Silverman63cf2412013-11-17 05:44:36 -080033 'make_global_settings': [
Brian Silvermand5e0fa62013-11-18 17:12:44 -080034 ['CC', '<!(which arm-linux-gnueabihf-gcc-4.7)'],
35 ['CXX', '<!(which arm-linux-gnueabihf-g++-4.7)'],
Brian Silverman63cf2412013-11-17 05:44:36 -080036 ],
brians343bc112013-02-10 01:53:46 +000037 '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 ],
77 'conditions': [
78 ['DEBUG=="yes"', {
79 'cflags': [
brians343bc112013-02-10 01:53:46 +000080 '-O0',
81 ],
brians343bc112013-02-10 01:53:46 +000082 }, {
83 'cflags': [
84 '-O3',
85 ],
Brian Silvermanefb993f2013-08-30 19:52:57 -070086 'ldflags': [
87 '-O3',
88 ],
brians343bc112013-02-10 01:53:46 +000089 'conditions': [['OS=="crio"', {
90 'cflags': [
91 '-fstrength-reduce',
92 '-fno-builtin',
93 '-fno-strict-aliasing',
94 ],
95 }, {
96 'cflags': [
Brian Silvermanc4321322013-11-18 17:38:39 -080097 '-mcpu=cortex-a8',
brians343bc112013-02-10 01:53:46 +000098
Brian Silverman9d1165c2013-09-01 16:46:29 -070099 '-fstack-protector-all',
brians343bc112013-02-10 01:53:46 +0000100 ],
101 }
102 ]],
103 }
104 ],
105 ['OS=="crio"', {
106 'target_conditions': [
107 ['_type=="shared_library"', {
108 'ldflags': [
109 '-r',
110 '-nostdlib',
111 '-Wl,-X',
112 ],
113 }
114 ],
115 ],
116 'ldflags': [
Brian Silverman1579fc12013-04-22 15:41:55 -0700117 '-mcpu=603e',
brians343bc112013-02-10 01:53:46 +0000118 '-mstrict-align',
119 '-mlongcall',
120 ],
121 'cflags': [
Brian Silverman1579fc12013-04-22 15:41:55 -0700122 # The Freescale MPC5200B (cRIO-FRC) and MPC5125 (cRIO-FRC II) both
123 # have MPC603e cores according to Freescale docs.
124 '-mcpu=603e',
brians343bc112013-02-10 01:53:46 +0000125 '-mstrict-align',
126 '-mlongcall',
Brian Silverman823f3242013-11-17 13:20:22 -0800127 '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/lib/gcc/powerpc-wrs-vxworks/3.4.4/include/',
128 '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/vxworks-6.3/target/h/',
129 '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/',
130 '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/powerpc-wrs-vxworks/',
brians343bc112013-02-10 01:53:46 +0000131 '-isystem', '<(WIND_BASE)/target/h',
132 '-isystem', '<(WIND_BASE)/target/h/wrn/coreip',
133 ],
Brian Silverman6e206682013-08-31 11:43:35 -0700134 'cflags_cc': [
135 '-std=gnu++0x',
136 ],
brians343bc112013-02-10 01:53:46 +0000137 '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',
brians343bc112013-02-10 01:53:46 +0000175 ],
brians343bc112013-02-10 01:53:46 +0000176 'cflags': [
177 '-pthread',
Brian Silverman6e206682013-08-31 11:43:35 -0700178
179 '-Wunused-local-typedefs',
180
181 # Give macro stack traces when they blow up.
Brian Silverman86db2a52013-09-14 15:32:25 -0700182 # TODO(brians): Re-enable this once they fix the bug where it
183 # sometimes doesn't show you the top-most (aka most useful)
184 # line of code.
185 #'-ftrack-macro-expansion',
Brian Silverman6e206682013-08-31 11:43:35 -0700186 ],
187 'cflags_cc': [
188 '-std=gnu++11',
brians343bc112013-02-10 01:53:46 +0000189 ],
190 'defines': [
Brian Silvermanefb993f2013-08-30 19:52:57 -0700191 '_FILE_OFFSET_BITS=64',
brians343bc112013-02-10 01:53:46 +0000192 ],
193 'libraries': [
194 '-lm',
195 '-lrt',
196 ],
197 }
198 ]
199 ],
200 },
201}