kma@webrtc.org | 9336469 | 2012-11-07 22:34:16 +0000 | [diff] [blame] | 1 | # 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.org | 9336469 | 2012-11-07 22:34:16 +0000 | [diff] [blame] | 33 | '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.org | 1b790df | 2012-11-15 00:13:07 +0000 | [diff] [blame^] | 41 | 'generate_asm_header.py', |
kma@webrtc.org | 9336469 | 2012-11-07 22:34:16 +0000 | [diff] [blame] | 42 | ], |
| 43 | 'outputs': [ |
| 44 | '<(out_dir)/<(RULE_INPUT_ROOT).h', |
| 45 | ], |
| 46 | 'action': [ |
| 47 | 'python', |
wjia@webrtc.org | 1b790df | 2012-11-15 00:13:07 +0000 | [diff] [blame^] | 48 | '<(webrtc_root)/build/generate_asm_header.py', |
fischman@webrtc.org | 5784346 | 2012-11-10 22:39:37 +0000 | [diff] [blame] | 49 | '--compiler=<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} ' |
| 50 | '<(android_toolchain)/*-gcc)', |
kma@webrtc.org | 9336469 | 2012-11-07 22:34:16 +0000 | [diff] [blame] | 51 | '--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 | } |