Brian Carlstrom | 05eecea | 2013-07-18 21:59:52 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2011 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | ART_CPPLINT := art/tools/cpplint.py |
Brian Carlstrom | 7934ac2 | 2013-07-26 10:54:15 -0700 | [diff] [blame] | 18 | ART_CPPLINT_FILTER := --filter=-whitespace/line_length,-build/include,-readability/function,-readability/streams,-readability/todo,-runtime/references,-runtime/sizeof,-runtime/threadsafe_fn,-runtime/printf |
Brian Carlstrom | 05eecea | 2013-07-18 21:59:52 -0700 | [diff] [blame] | 19 | ART_CPPLINT_SRC := $(shell find art -name *.h -o -name *$(ART_CPP_EXTENSION) | grep -v art/compiler/llvm/generated/) |
| 20 | |
| 21 | # "mm cpplint-art" to verify we aren't regressing |
| 22 | .PHONY: cpplint-art |
| 23 | cpplint-art: |
| 24 | $(ART_CPPLINT) $(ART_CPPLINT_FILTER) $(ART_CPPLINT_SRC) |
| 25 | |
| 26 | # "mm cpplint-art-all" to see all warnings |
| 27 | .PHONY: cpplint-art-all |
| 28 | cpplint-art-all: |
| 29 | $(ART_CPPLINT) $(ART_CPPLINT_SRC) |
| 30 | |
| 31 | OUT_CPPLINT := $(TARGET_COMMON_OUT_ROOT)/cpplint |
| 32 | |
| 33 | ART_CPPLINT_TARGETS := |
| 34 | |
| 35 | define declare-art-cpplint-target |
| 36 | art_cpplint_file := $(1) |
| 37 | art_cpplint_touch := $$(OUT_CPPLINT)/$$(subst /,__,$$(art_cpplint_file)) |
| 38 | |
| 39 | $$(art_cpplint_touch): $$(art_cpplint_file) $(ART_CPPLINT) art/build/Android.cpplint.mk |
| 40 | $(hide) $(ART_CPPLINT) $(ART_CPPLINT_FILTER) $$< |
| 41 | @mkdir -p $$(dir $$@) |
| 42 | $(hide) touch $$@ |
| 43 | |
| 44 | ART_CPPLINT_TARGETS += $$(art_cpplint_touch) |
| 45 | endef |
| 46 | |
| 47 | $(foreach file, $(ART_CPPLINT_SRC), $(eval $(call declare-art-cpplint-target,$(file)))) |
| 48 | #$(info $(call declare-art-cpplint-target,$(firstword $(ART_CPPLINT_SRC)))) |
| 49 | |
| 50 | include $(CLEAR_VARS) |
| 51 | LOCAL_MODULE := cpplint-art-phony |
| 52 | LOCAL_MODULE_TAGS := optional |
| 53 | LOCAL_ADDITIONAL_DEPENDENCIES := $(ART_CPPLINT_TARGETS) |
| 54 | include $(BUILD_PHONY_PACKAGE) |