|
1 | 1 | # SPDX-FileCopyrightText: Copyright (c) 2022 Anton Shatokhin |
2 | 2 | # SPDX-License-Identifier: MIT |
3 | 3 |
|
4 | | -FAST_SOURCES := $(wildcard Fast/src/*.cpp) |
5 | | -FAST_HEADERS := $(wildcard Fast/**/*.h) |
6 | | -FAST_OBJECTS := ${FAST_SOURCES:.cpp=.o} |
| 4 | +ALL_SOURCES := $(wildcard cpp/*/src/*.cpp) |
| 5 | +ALL_HEADERS := $(wildcard cpp/*/include/*.h cpp/*/src/*.h) |
7 | 6 |
|
8 | | -FAST_TEST_SOURCES := $(filter-out Fast/src/main.cpp, $(shell find Fast/ -type f -name *.cpp)) |
| 7 | +.PHONY: all style fast fast-test slow slow-test eo clean fix test |
9 | 8 |
|
10 | | -FAST_TEST_OBJECTS := ${FAST_TEST_SOURCES:.cpp=.o} |
| 9 | +all: style fast slow eo |
11 | 10 |
|
12 | | -.PHONY: all style slow fast eo-compile compile cpp java eo run clean test |
| 11 | +fast: |
| 12 | + $(MAKE) -C cpp/fast |
13 | 13 |
|
14 | | -all: style slow fast eo-compile |
| 14 | +fast-test: |
| 15 | + $(MAKE) -C cpp/fast test |
15 | 16 |
|
16 | | -compile: cpp java eo |
| 17 | +slow: |
| 18 | + $(MAKE) -C cpp/slow |
17 | 19 |
|
18 | | -slow: slow_life slow_test |
| 20 | +slow-test: |
| 21 | + $(MAKE) -C cpp/slow test |
19 | 22 |
|
20 | | -fast: fast_life fast_test |
| 23 | +eo: |
| 24 | + $(MAKE) -C eo |
21 | 25 |
|
22 | | -fast_life: $(FAST_OBJECTS) |
23 | | - @g++ $(FAST_OBJECTS) -lboost_program_options -o fast_life |
24 | | - |
25 | | -fast_test: $(FAST_TEST_OBJECTS) |
26 | | - @g++ $(FAST_TEST_OBJECTS) -lboost_unit_test_framework -o fast_test |
27 | | - ./fast_test --log_level=all |
28 | | - |
29 | | -%.o: Fast/**/%.cpp $(FAST_HEADERS) |
30 | | - @g++ $@ -o $< |
31 | | - |
32 | | -SLOW_SOURCES := $(wildcard Slow/src/*.cpp) |
33 | | -SLOW_HEADERS := $(wildcard Slow/**/*.h) |
34 | | -SLOW_OBJECTS := ${SLOW_SOURCES:.cpp=.o} |
35 | | -SLOW_TEST_SOURCES := $(filter-out Slow/src/main.cpp, $(shell find Slow/ -type f -name *.cpp)) |
36 | | -SLOW_TEST_OBJECTS := ${SLOW_TEST_SOURCES:.cpp=.o} |
37 | | - |
38 | | -slow_life: $(SLOW_OBJECTS) |
39 | | - g++ $(SLOW_OBJECTS) -lboost_program_options -o slow_life |
40 | | - |
41 | | -slow_test: $(SLOW_TEST_OBJECTS) |
42 | | - g++ $(SLOW_TEST_OBJECTS) -lboost_unit_test_framework -lboost_program_options -o slow_test |
43 | | - ./slow_test --log_level=all |
44 | | - |
45 | | -%.o: Slow/**/%.cpp $(SLOW_HEADERS) |
46 | | - g++ $@ -o $< |
47 | | - |
48 | | - |
49 | | -ALL_SOURCES := $(SLOW_SOURCES) $(FAST_SOURCES) |
50 | | -ALL_HEADERS := $(FAST_HEADERS) $(SLOW_HEADERS) |
51 | 26 | style: |
52 | 27 | bash -c "diff -u <(cat $(ALL_SOURCES)) <(clang-format --style=file $(ALL_SOURCES))" |
53 | 28 | clang-tidy -header-filter=none '-warnings-as-errors=*' '-checks=*,-readability-magic-numbers,-altera-id-dependent-backward-branch,-cert-err34-c,-cppcoreguidelines-avoid-non-const-global-variables,-readability-function-cognitive-complexity,-misc-no-recursion,-llvm-header-guard,-cppcoreguidelines-init-variables,-altera-unroll-loops,-clang-analyzer-valist.Uninitialized,-llvmlibc-callee-namespace,-cppcoreguidelines-no-malloc,-hicpp-no-malloc,-llvmlibc-implementation-in-namespace,-bugprone-easily-swappable-parameters,-llvmlibc-restrict-system-libc-headers,-llvm-include-order,-modernize-use-trailing-return-type,-cppcoreguidelines-special-member-functions,-hicpp-special-member-functions,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-type-vararg,-hicpp-vararg,-fuchsia-default-arguments-calls' $(ALL_SOURCES) |
|
56 | 31 | clang-format -i --style=file $(ALL_SOURCES) $(ALL_HEADERS) |
57 | 32 | clang-tidy -fix -header-filter=none '-warnings-as-errors=*' '-checks=*,-readability-magic-numbers,-altera-id-dependent-backward-branch,-cert-err34-c,-cppcoreguidelines-avoid-non-const-global-variables,-readability-function-cognitive-complexity,-misc-no-recursion,-llvm-header-guard,-cppcoreguidelines-init-variables,-altera-unroll-loops,-clang-analyzer-valist.Uninitialized,-llvmlibc-callee-namespace,-cppcoreguidelines-no-malloc,-hicpp-no-malloc,-llvmlibc-implementation-in-namespace,-bugprone-easily-swappable-parameters,-llvmlibc-restrict-system-libc-headers,-llvm-include-order,-modernize-use-trailing-return-type,-cppcoreguidelines-special-member-functions,-hicpp-special-member-functions,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-type-vararg,-hicpp-vararg,-fuchsia-default-arguments-calls' $(ALL_SOURCES) |
58 | 33 |
|
59 | | -eo-compile: |
60 | | - eoc dataize life cycle 0 |
61 | | - |
62 | 34 | clean: |
63 | | - rm -f **/src/*.o |
64 | | - rm -f **/tests/**/*.o |
65 | | - rm -f *_life |
66 | | - rm -f *_test |
67 | | - rm -fr .eoc/ |
| 35 | + $(MAKE) -C eo clean |
| 36 | + $(MAKE) -C cpp/fast clean |
| 37 | + $(MAKE) -C cpp/slow clean |
0 commit comments