Skip to content

Commit e6299de

Browse files
authored
Merge pull request #42 from literally-bug-creator/41
Fix repo layout
2 parents 82ac0a2 + 13ad006 commit e6299de

Some content is hidden

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

51 files changed

+104
-49
lines changed

.github/workflows/cpp.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
- uses: actions/checkout@v5
1515
- run: sudo apt-get install libboost-all-dev
1616
- run: make style
17-
- run: make slow
1817
- run: make fast
18+
- run: make fast-test
19+
- run: make slow
20+
- run: make slow-test
1921
- run: make clean

.github/workflows/eolang.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v5
1515
- run: npm install -g eolang
16-
- run: make eo-compile
16+
- run: make eo
1717
- run: make clean

.typos.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2022 Anton Shatokhin
2+
# SPDX-License-Identifier: MIT
3+
4+
[default]
5+
extend-ignore-identifiers-re = [
6+
# Ignore compiler flags like -Iinclude, -Lpath, etc.
7+
"-[IL][a-zA-Z0-9_/.-]+",
8+
]
9+
10+
[default.extend-words]
11+
Iinclude = "Iinclude" # This is a compiler flag -Iinclude

Makefile

Lines changed: 17 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,28 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2022 Anton Shatokhin
22
# SPDX-License-Identifier: MIT
33

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)
76

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
98

10-
FAST_TEST_OBJECTS := ${FAST_TEST_SOURCES:.cpp=.o}
9+
all: style fast slow eo
1110

12-
.PHONY: all style slow fast eo-compile compile cpp java eo run clean test
11+
fast:
12+
$(MAKE) -C cpp/fast
1313

14-
all: style slow fast eo-compile
14+
fast-test:
15+
$(MAKE) -C cpp/fast test
1516

16-
compile: cpp java eo
17+
slow:
18+
$(MAKE) -C cpp/slow
1719

18-
slow: slow_life slow_test
20+
slow-test:
21+
$(MAKE) -C cpp/slow test
1922

20-
fast: fast_life fast_test
23+
eo:
24+
$(MAKE) -C eo
2125

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)
5126
style:
5227
bash -c "diff -u <(cat $(ALL_SOURCES)) <(clang-format --style=file $(ALL_SOURCES))"
5328
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,12 +31,7 @@ fix:
5631
clang-format -i --style=file $(ALL_SOURCES) $(ALL_HEADERS)
5732
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)
5833

59-
eo-compile:
60-
eoc dataize life cycle 0
61-
6234
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

cpp/fast/Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2022 Anton Shatokhin
2+
# SPDX-License-Identifier: MIT
3+
4+
SOURCES := $(wildcard src/*.cpp)
5+
HEADERS := $(wildcard include/*.h src/*.h)
6+
OBJECTS := ${SOURCES:.cpp=.o}
7+
8+
LIB_SOURCES := $(filter-out src/main.cpp, $(SOURCES))
9+
LIB_OBJECTS := ${LIB_SOURCES:.cpp=.o}
10+
11+
TEST_SOURCES := $(shell find tests -type f -name "*.cpp" 2>/dev/null || true)
12+
TEST_OBJECTS := ${TEST_SOURCES:.cpp=.o}
13+
14+
.PHONY: all build test clean
15+
16+
all: build
17+
18+
build: $(OBJECTS)
19+
g++ $(OBJECTS) -lboost_program_options -o fast_life
20+
21+
test: $(LIB_OBJECTS) $(TEST_OBJECTS)
22+
g++ $(LIB_OBJECTS) $(TEST_OBJECTS) -lboost_unit_test_framework -lboost_program_options -o fast_test
23+
./fast_test --log_level=all
24+
25+
%.o: %.cpp $(HEADERS)
26+
g++ -c -Iinclude $< -o $@
27+
28+
clean:
29+
rm -f src/*.o tests/**/*.o
30+
rm -f fast_life fast_test

0 commit comments

Comments
 (0)