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 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 17 | include art/build/Android.common_build.mk |
| 18 | |
Brian Carlstrom | 05eecea | 2013-07-18 21:59:52 -0700 | [diff] [blame] | 19 | ART_CPPLINT := art/tools/cpplint.py |
Brian Carlstrom | 7934ac2 | 2013-07-26 10:54:15 -0700 | [diff] [blame] | 20 | ART_CPPLINT_FILTER := --filter=-whitespace/line_length,-build/include,-readability/function,-readability/streams,-readability/todo,-runtime/references,-runtime/sizeof,-runtime/threadsafe_fn,-runtime/printf |
Alex Light | 91de25f | 2015-10-28 17:00:06 -0700 | [diff] [blame] | 21 | ART_CPPLINT_FLAGS := --quiet |
Brian Carlstrom | e130ee6 | 2014-07-01 23:54:20 -0700 | [diff] [blame] | 22 | ART_CPPLINT_SRC := $(shell find art -name "*.h" -o -name "*$(ART_CPP_EXTENSION)" | grep -v art/compiler/llvm/generated/ | grep -v art/runtime/elf\.h) |
Brian Carlstrom | 05eecea | 2013-07-18 21:59:52 -0700 | [diff] [blame] | 23 | |
| 24 | # "mm cpplint-art" to verify we aren't regressing |
| 25 | .PHONY: cpplint-art |
| 26 | cpplint-art: |
| 27 | $(ART_CPPLINT) $(ART_CPPLINT_FILTER) $(ART_CPPLINT_SRC) |
| 28 | |
| 29 | # "mm cpplint-art-all" to see all warnings |
| 30 | .PHONY: cpplint-art-all |
| 31 | cpplint-art-all: |
| 32 | $(ART_CPPLINT) $(ART_CPPLINT_SRC) |
| 33 | |
| 34 | OUT_CPPLINT := $(TARGET_COMMON_OUT_ROOT)/cpplint |
| 35 | |
| 36 | ART_CPPLINT_TARGETS := |
| 37 | |
| 38 | define declare-art-cpplint-target |
| 39 | art_cpplint_file := $(1) |
| 40 | art_cpplint_touch := $$(OUT_CPPLINT)/$$(subst /,__,$$(art_cpplint_file)) |
| 41 | |
| 42 | $$(art_cpplint_touch): $$(art_cpplint_file) $(ART_CPPLINT) art/build/Android.cpplint.mk |
Alex Light | 91de25f | 2015-10-28 17:00:06 -0700 | [diff] [blame] | 43 | $(hide) $(ART_CPPLINT) $(ART_CPPLINT_FLAGS) $(ART_CPPLINT_FILTER) $$< |
| 44 | $(hide) mkdir -p $$(dir $$@) |
Brian Carlstrom | 05eecea | 2013-07-18 21:59:52 -0700 | [diff] [blame] | 45 | $(hide) touch $$@ |
| 46 | |
| 47 | ART_CPPLINT_TARGETS += $$(art_cpplint_touch) |
| 48 | endef |
| 49 | |
| 50 | $(foreach file, $(ART_CPPLINT_SRC), $(eval $(call declare-art-cpplint-target,$(file)))) |
| 51 | #$(info $(call declare-art-cpplint-target,$(firstword $(ART_CPPLINT_SRC)))) |
| 52 | |
| 53 | include $(CLEAR_VARS) |
| 54 | LOCAL_MODULE := cpplint-art-phony |
| 55 | LOCAL_MODULE_TAGS := optional |
| 56 | LOCAL_ADDITIONAL_DEPENDENCIES := $(ART_CPPLINT_TARGETS) |
| 57 | include $(BUILD_PHONY_PACKAGE) |