OLD | NEW |
---|---|
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # Notes: | 5 # Notes: |
6 # | 6 # |
7 # This generates makefiles suitable for inclusion into the Android build system | 7 # This generates makefiles suitable for inclusion into the Android build system |
8 # via an Android.mk file. It is based on make.py, the standard makefile | 8 # via an Android.mk file. It is based on make.py, the standard makefile |
9 # generator. | 9 # generator. |
10 # | 10 # |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
681 """ | 681 """ |
682 return ''.join(self.ComputeOutputParts(spec)) | 682 return ''.join(self.ComputeOutputParts(spec)) |
683 | 683 |
684 | 684 |
685 def ComputeOutput(self, spec): | 685 def ComputeOutput(self, spec): |
686 """Return the 'output' (full output path) of a gyp spec. | 686 """Return the 'output' (full output path) of a gyp spec. |
687 | 687 |
688 E.g., the loadable module 'foobar' in directory 'baz' will produce | 688 E.g., the loadable module 'foobar' in directory 'baz' will produce |
689 '$(obj)/baz/libfoobar.so' | 689 '$(obj)/baz/libfoobar.so' |
690 """ | 690 """ |
691 if self.type == 'executable' and self.toolset == 'host': | 691 if self.type == 'executable': |
692 # We install host executables into shared_intermediate_dir so they can be | 692 # We install host executables into shared_intermediate_dir so they can be |
693 # run by gyp rules that refer to PRODUCT_DIR. | 693 # run by gyp rules that refer to PRODUCT_DIR. |
694 path = '$(gyp_shared_intermediate_dir)' | 694 path = '$(gyp_shared_intermediate_dir)' |
695 elif self.type == 'shared_library': | 695 elif self.type == 'shared_library': |
696 if self.toolset == 'host': | 696 if self.toolset == 'host': |
697 path = '$(HOST_OUT_INTERMEDIATE_LIBRARIES)' | 697 path = '$(HOST_OUT_INTERMEDIATE_LIBRARIES)' |
698 else: | 698 else: |
699 path = '$($(GYP_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES)' | 699 path = '$($(GYP_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES)' |
700 else: | 700 else: |
701 # Other targets just get built into their intermediate dir. | 701 # Other targets just get built into their intermediate dir. |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
871 # NOTE: This has to come last! | 871 # NOTE: This has to come last! |
872 modifier = '' | 872 modifier = '' |
873 if self.toolset == 'host': | 873 if self.toolset == 'host': |
874 modifier = 'HOST_' | 874 modifier = 'HOST_' |
875 if self.type == 'static_library': | 875 if self.type == 'static_library': |
876 self.WriteLn('include $(BUILD_%sSTATIC_LIBRARY)' % modifier) | 876 self.WriteLn('include $(BUILD_%sSTATIC_LIBRARY)' % modifier) |
877 elif self.type == 'shared_library': | 877 elif self.type == 'shared_library': |
878 self.WriteLn('LOCAL_PRELINK_MODULE := false') | 878 self.WriteLn('LOCAL_PRELINK_MODULE := false') |
879 self.WriteLn('include $(BUILD_%sSHARED_LIBRARY)' % modifier) | 879 self.WriteLn('include $(BUILD_%sSHARED_LIBRARY)' % modifier) |
880 elif self.type == 'executable': | 880 elif self.type == 'executable': |
881 if self.toolset == 'host': | 881 self.WriteLn('LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)') |
Torne
2014/06/12 09:38:49
We probably want a comment here to explain that we
| |
882 self.WriteLn('LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)') | |
883 else: | |
884 # Don't install target executables for now, as it results in them being | |
885 # included in ROM. This can be revisited if there's a reason to install | |
886 # them later. | |
887 self.WriteLn('LOCAL_UNINSTALLABLE_MODULE := true') | |
888 self.WriteLn('include $(BUILD_%sEXECUTABLE)' % modifier) | 882 self.WriteLn('include $(BUILD_%sEXECUTABLE)' % modifier) |
889 else: | 883 else: |
890 self.WriteLn('LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp') | 884 self.WriteLn('LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp') |
891 self.WriteLn('LOCAL_UNINSTALLABLE_MODULE := true') | 885 self.WriteLn('LOCAL_UNINSTALLABLE_MODULE := true') |
892 if self.toolset == 'target': | 886 if self.toolset == 'target': |
893 self.WriteLn('LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)') | 887 self.WriteLn('LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)') |
894 self.WriteLn() | 888 self.WriteLn() |
895 self.WriteLn('include $(BUILD_SYSTEM)/base_rules.mk') | 889 self.WriteLn('include $(BUILD_SYSTEM)/base_rules.mk') |
896 self.WriteLn() | 890 self.WriteLn() |
897 self.WriteLn('$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)') | 891 self.WriteLn('$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)') |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1088 # Write out the sorted list of includes. | 1082 # Write out the sorted list of includes. |
1089 root_makefile.write('\n') | 1083 root_makefile.write('\n') |
1090 for include_file in sorted(include_list): | 1084 for include_file in sorted(include_list): |
1091 root_makefile.write('include $(LOCAL_PATH)/' + include_file + '\n') | 1085 root_makefile.write('include $(LOCAL_PATH)/' + include_file + '\n') |
1092 root_makefile.write('\n') | 1086 root_makefile.write('\n') |
1093 | 1087 |
1094 if write_alias_targets: | 1088 if write_alias_targets: |
1095 root_makefile.write(ALL_MODULES_FOOTER) | 1089 root_makefile.write(ALL_MODULES_FOOTER) |
1096 | 1090 |
1097 root_makefile.close() | 1091 root_makefile.close() |
OLD | NEW |