blob: 953cfc091cb0f40d7c4d6f6986304a7f6e556edb [file] [log] [blame]
Brian Carlstrom05eecea2013-07-18 21:59:52 -07001#
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 Rogersafd9acc2014-06-17 08:21:54 -070017include art/build/Android.common_build.mk
18
Brian Carlstrom05eecea2013-07-18 21:59:52 -070019ART_CPPLINT := art/tools/cpplint.py
Brian Carlstrom7934ac22013-07-26 10:54:15 -070020ART_CPPLINT_FILTER := --filter=-whitespace/line_length,-build/include,-readability/function,-readability/streams,-readability/todo,-runtime/references,-runtime/sizeof,-runtime/threadsafe_fn,-runtime/printf
Alex Light91de25f2015-10-28 17:00:06 -070021ART_CPPLINT_FLAGS := --quiet
Brian Carlstrome130ee62014-07-01 23:54:20 -070022ART_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 Carlstrom05eecea2013-07-18 21:59:52 -070023
24# "mm cpplint-art" to verify we aren't regressing
25.PHONY: cpplint-art
26cpplint-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
31cpplint-art-all:
32 $(ART_CPPLINT) $(ART_CPPLINT_SRC)
33
34OUT_CPPLINT := $(TARGET_COMMON_OUT_ROOT)/cpplint
35
36ART_CPPLINT_TARGETS :=
37
38define declare-art-cpplint-target
39art_cpplint_file := $(1)
40art_cpplint_touch := $$(OUT_CPPLINT)/$$(subst /,__,$$(art_cpplint_file))
41
42$$(art_cpplint_touch): $$(art_cpplint_file) $(ART_CPPLINT) art/build/Android.cpplint.mk
Alex Light91de25f2015-10-28 17:00:06 -070043 $(hide) $(ART_CPPLINT) $(ART_CPPLINT_FLAGS) $(ART_CPPLINT_FILTER) $$<
44 $(hide) mkdir -p $$(dir $$@)
Brian Carlstrom05eecea2013-07-18 21:59:52 -070045 $(hide) touch $$@
46
47ART_CPPLINT_TARGETS += $$(art_cpplint_touch)
48endef
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
53include $(CLEAR_VARS)
54LOCAL_MODULE := cpplint-art-phony
55LOCAL_MODULE_TAGS := optional
56LOCAL_ADDITIONAL_DEPENDENCIES := $(ART_CPPLINT_TARGETS)
57include $(BUILD_PHONY_PACKAGE)