Skip to content

Commit 1fba1d0

Browse files
committed
Fix code duplication
1 parent 331d26c commit 1fba1d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+46
-172
lines changed

tools/make/lib/ls/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ else
280280
find_kernel_prefix :=
281281
endif
282282

283+
# Define a suffix for pretty printing results as a list:
284+
find_print_list := -exec printf '%s\n' {} \;
285+
283286

284287
# DEPENDENCIES #
285288

tools/make/lib/ls/c/benchmarks.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
# VARIABLES #
2020

21-
# Define a suffix for pretty printing results as a list:
22-
find_print_c_benchmarks_list := -exec printf '%s\n' {} \;
23-
2421
# Define the command flags:
2522
FIND_C_BENCHMARKS_FLAGS ?= \
2623
-type f \
@@ -48,6 +45,6 @@ C_BENCHMARKS ?= $(shell $(FIND_C_BENCHMARKS_CMD))
4845
# This target prints a newline-delimited list of C benchmark files.
4946

5047
list-benchmarks-c:
51-
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_C_BENCHMARKS_FLAGS) $(find_print_c_benchmarks_list)
48+
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_C_BENCHMARKS_FLAGS) $(find_print_list)
5249

5350
.PHONY: list-benchmarks-c

tools/make/lib/ls/c/examples.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
# VARIABLES #
2020

21-
# Define a suffix for pretty printing results as a list:
22-
find_print_c_examples_list := -exec printf '%s\n' {} \;
23-
2421
# Define the command flags:
2522
FIND_C_EXAMPLES_FLAGS ?= \
2623
-type f \
@@ -50,6 +47,6 @@ C_EXAMPLES ?= $(shell $(FIND_C_EXAMPLES_CMD))
5047
# This target prints a newline-delimited list of example files.
5148

5249
list-examples-c:
53-
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_C_EXAMPLES_FLAGS) $(find_print_c_examples_list)
50+
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_C_EXAMPLES_FLAGS) $(find_print_list)
5451

5552
.PHONY: list-examples-c

tools/make/lib/ls/c/files.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
# VARIABLES #
2020

21-
# Define a suffix for pretty printing results as a list:
22-
find_print_c_list := -exec printf '%s\n' {} \;
23-
2421
# Define the command flags:
2522
FIND_C_FLAGS ?= \
2623
-type f \
@@ -46,6 +43,6 @@ C_FILES ?= $(shell $(FIND_C_CMD))
4643
# This target prints a list of all C files.
4744

4845
list-c-files:
49-
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_C_FLAGS) $(find_print_c_list)
46+
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_C_FLAGS) $(find_print_list)
5047

5148
.PHONY: list-c-files

tools/make/lib/ls/c/sources.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
# VARIABLES #
2020

21-
# Define a suffix for pretty printing results as a list:
22-
find_print_c_sources_list := -exec printf '%s\n' {} \;
23-
2421
# Define the command flags:
2522
FIND_C_SOURCES_FLAGS ?= \
2623
-type f \
@@ -46,6 +43,6 @@ C_SOURCES ?= $(shell $(FIND_C_SOURCES_CMD))
4643
# This target prints a newline-delimited list of source files.
4744

4845
list-sources-c:
49-
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_C_SOURCES_FLAGS) $(find_print_c_sources_list)
46+
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_C_SOURCES_FLAGS) $(find_print_list)
5047

5148
.PHONY: list-sources-c

tools/make/lib/ls/c/tests_fixtures.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
# VARIABLES #
2020

21-
# Define a suffix for pretty printing results as a list:
22-
find_print_c_tests_fixtures_list := -exec printf '%s\n' {} \;
23-
2421
# Define the command flags:
2522
FIND_C_TESTS_FIXTURES_FLAGS ?= \
2623
-type f \
@@ -47,6 +44,6 @@ C_TESTS_FIXTURES ?= $(shell $(FIND_C_TESTS_FIXTURES_CMD))
4744
# This target prints a newline-delimited list of test fixture files.
4845

4946
list-tests-fixtures-c:
50-
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_C_TESTS_FIXTURES_FLAGS) $(find_print_c_tests_fixtures_list)
47+
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_C_TESTS_FIXTURES_FLAGS) $(find_print_list)
5148

5249
.PHONY: list-tests-fixtures-c

tools/make/lib/ls/cpp/benchmarks.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
# VARIABLES #
2020

21-
# Define a suffix for pretty printing results as a list:
22-
find_print_cpp_benchmarks_list := -exec printf '%s\n' {} \;
23-
2421
# Define the command flags:
2522
FIND_CPP_BENCHMARKS_FLAGS ?= \
2623
-type f \
@@ -48,6 +45,6 @@ CPP_BENCHMARKS ?= $(shell $(FIND_CPP_BENCHMARKS_CMD))
4845
# This target prints a newline-delimited list of C++ benchmark files.
4946

5047
list-benchmarks-cpp:
51-
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_CPP_BENCHMARKS_FLAGS) $(find_print_cpp_benchmarks_list)
48+
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_CPP_BENCHMARKS_FLAGS) $(find_print_list)
5249

5350
.PHONY: list-benchmarks-cpp

tools/make/lib/ls/cpp/examples.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
# VARIABLES #
2020

21-
# Define a suffix for pretty printing results as a list:
22-
find_print_cpp_examples_list := -exec printf '%s\n' {} \;
23-
2421
# Define the command flags:
2522
FIND_CPP_EXAMPLES_FLAGS ?= \
2623
-type f \
@@ -50,6 +47,6 @@ CPP_EXAMPLES ?= $(shell $(FIND_CPP_EXAMPLES_CMD))
5047
# This target prints a newline-delimited list of example files.
5148

5249
list-examples-cpp:
53-
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_CPP_EXAMPLES_FLAGS) $(find_print_cpp_examples_list)
50+
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_CPP_EXAMPLES_FLAGS) $(find_print_list)
5451

5552
.PHONY: list-examples-cpp

tools/make/lib/ls/cpp/files.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
# VARIABLES #
2020

21-
# Define a suffix for pretty printing results as a list:
22-
find_print_cpp_list := -exec printf '%s\n' {} \;
23-
2421
# Define the command flags:
2522
FIND_CPP_FLAGS ?= \
2623
-type f \
@@ -46,6 +43,6 @@ CPP_FILES ?= $(shell $(FIND_CPP_CMD))
4643
# This target prints a list of all C++ files.
4744

4845
list-cpp-files:
49-
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_CPP_FLAGS) $(find_print_cpp_list)
46+
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_CPP_FLAGS) $(find_print_list)
5047

5148
.PHONY: list-cpp-files

tools/make/lib/ls/cpp/sources.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818

1919
# VARIABLES #
2020

21-
# Define a suffix for pretty printing results as a list:
22-
find_print_cpp_sources_list := -exec printf '%s\n' {} \;
23-
2421
# Define the command flags:
2522
FIND_CPP_SOURCES_FLAGS ?= \
2623
-type f \
@@ -46,6 +43,6 @@ CPP_SOURCES ?= $(shell $(FIND_CPP_SOURCES_CMD))
4643
# This target prints a newline-delimited list of source files.
4744

4845
list-sources-cpp:
49-
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_CPP_SOURCES_FLAGS) $(find_print_cpp_sources_list)
46+
$(QUIET) find $(find_kernel_prefix) $(ROOT_DIR) $(FIND_CPP_SOURCES_FLAGS) $(find_print_list)
5047

5148
.PHONY: list-sources-cpp

0 commit comments

Comments
 (0)