| 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 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 if '$(' in path or os.path.isabs(path): | 934 if '$(' in path or os.path.isabs(path): |
| 935 # path is not a file in the project tree in this case, but calling | 935 # path is not a file in the project tree in this case, but calling |
| 936 # normpath is still important for trimming trailing slashes. | 936 # normpath is still important for trimming trailing slashes. |
| 937 return os.path.normpath(path) | 937 return os.path.normpath(path) |
| 938 local_path = os.path.join('$(LOCAL_PATH)', self.path, path) | 938 local_path = os.path.join('$(LOCAL_PATH)', self.path, path) |
| 939 local_path = os.path.normpath(local_path) | 939 local_path = os.path.normpath(local_path) |
| 940 # Check that normalizing the path didn't ../ itself out of $(LOCAL_PATH) | 940 # Check that normalizing the path didn't ../ itself out of $(LOCAL_PATH) |
| 941 # - i.e. that the resulting path is still inside the project tree. The | 941 # - i.e. that the resulting path is still inside the project tree. The |
| 942 # path may legitimately have ended up containing just $(LOCAL_PATH), though, | 942 # path may legitimately have ended up containing just $(LOCAL_PATH), though, |
| 943 # so we don't look for a slash. | 943 # so we don't look for a slash. |
| 944 """Temporarily disable this assert until build/temp_gyp/googleurl.gyp is |
| 945 removed. See https://codereview.chromium.org/12077023. |
| 944 assert local_path.startswith('$(LOCAL_PATH)'), ( | 946 assert local_path.startswith('$(LOCAL_PATH)'), ( |
| 945 'Path %s attempts to escape from gyp path %s !)' % (path, self.path)) | 947 'Path %s attempts to escape from gyp path %s !)' % (path, self.path)) |
| 948 """ |
| 946 return local_path | 949 return local_path |
| 947 | 950 |
| 948 | 951 |
| 949 def ExpandInputRoot(self, template, expansion, dirname): | 952 def ExpandInputRoot(self, template, expansion, dirname): |
| 950 if '%(INPUT_ROOT)s' not in template and '%(INPUT_DIRNAME)s' not in template: | 953 if '%(INPUT_ROOT)s' not in template and '%(INPUT_DIRNAME)s' not in template: |
| 951 return template | 954 return template |
| 952 path = template % { | 955 path = template % { |
| 953 'INPUT_ROOT': expansion, | 956 'INPUT_ROOT': expansion, |
| 954 'INPUT_DIRNAME': dirname, | 957 'INPUT_DIRNAME': dirname, |
| 955 } | 958 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 | 1093 |
| 1091 # Write out the sorted list of includes. | 1094 # Write out the sorted list of includes. |
| 1092 root_makefile.write('\n') | 1095 root_makefile.write('\n') |
| 1093 for include_file in sorted(include_list): | 1096 for include_file in sorted(include_list): |
| 1094 root_makefile.write('include $(LOCAL_PATH)/' + include_file + '\n') | 1097 root_makefile.write('include $(LOCAL_PATH)/' + include_file + '\n') |
| 1095 root_makefile.write('\n') | 1098 root_makefile.write('\n') |
| 1096 | 1099 |
| 1097 root_makefile.write(SHARED_FOOTER) | 1100 root_makefile.write(SHARED_FOOTER) |
| 1098 | 1101 |
| 1099 root_makefile.close() | 1102 root_makefile.close() |
| OLD | NEW |