blob: e9f88ea7777d18c5d1a9651b5fa76194fce5e90a [file] [log] [blame]
kma@webrtc.org93364692012-11-07 22:34:16 +00001# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9# This file is meant to be included into a target to provide an action
10# to generate C header files. These headers include definitions
11# that can be used in ARM assembly files.
12#
13# To use this, create a gyp target with the following form:
14# {
15# 'target_name': 'my_asm_headers_lib',
16# 'type': 'static_library',
17# 'sources': [
18# 'foo.c',
19# 'bar.c',
20# ],
21# 'includes': ['path/to/this/gypi/file'],
22# }
23#
24# The headers are guaranteed to be generated before any
25# source files, even within this target, are compiled.
26#
27# The 'asm_header_dir' variable specifies the path suffix that output
28# files are generated under.
29
30# TODO(kma): port this block from Android into other build systems.
31{
32 'variables': {
kma@webrtc.org93364692012-11-07 22:34:16 +000033 'out_dir': '<(SHARED_INTERMEDIATE_DIR)/<(asm_header_dir)',
34 'process_outputs_as_sources': 1,
35 },
36 'rules': [
37 {
38 'rule_name': 'generate_asm_header',
39 'extension': 'c',
40 'inputs': [
wjia@webrtc.org1b790df2012-11-15 00:13:07 +000041 'generate_asm_header.py',
kma@webrtc.org93364692012-11-07 22:34:16 +000042 ],
43 'outputs': [
44 '<(out_dir)/<(RULE_INPUT_ROOT).h',
45 ],
46 'action': [
47 'python',
wjia@webrtc.org1b790df2012-11-15 00:13:07 +000048 '<(webrtc_root)/build/generate_asm_header.py',
fischman@webrtc.org57843462012-11-10 22:39:37 +000049 '--compiler=<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} '
50 '<(android_toolchain)/*-gcc)',
kma@webrtc.org93364692012-11-07 22:34:16 +000051 '--options=-I.. -I<@(android_ndk_include) -S', # Compiler options.
52 '--dir=<(out_dir)',
53 '<(RULE_INPUT_PATH)',
54 ],
55 'message': 'Generating assembly header files',
56 'process_outputs_as_sources': 1,
57 },
58 ],
59 'direct_dependent_settings': {
60 'include_dirs': ['<(out_dir)',],
61 },
62 # This target exports a hard dependency because it generates header files.
63 'hard_dependency': 1,
64}