-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
executable file
·75 lines (55 loc) · 2.25 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# show this list
default:
@just --list
# copy all files to a remote system
copy:
python setup-credentials.py
. ./credentials.sh; \
rsync -rRv -e ssh ./ $CHATA_CROSS_USERNAME@$CHATA_CROSS_IP:$CHATA_CROSS_PATH --exclude="*/build" --exclude=".git/*" --exclude="*a.out" --exclude="*.png"
set positional-arguments
# build everything
build type='Release':
@just build-lib {{type}}
@just build-cli {{type}}
# build just libchata
build-lib type='Release':
if [ ! -d "libchata/build" ]; then mkdir libchata/build; fi
if [ ! -d "libchata/build/CMakeFiles" ]; then cd libchata/build; cmake .. -DCMAKE_BUILD_TYPE="{{type}}"; fi
cd libchata/build; cmake --build . -j 12
cd libchata/build; sudo cmake --install .
# build just chatacli
build-cli type='Release':
if [ ! -d "chatacli/build" ]; then mkdir chatacli/build; fi
if [ ! -d "chatacli/build/CMakeFiles" ]; then cd chatacli/build; cmake .. -DCMAKE_BUILD_TYPE="{{type}}"; fi
cd chatacli/build; cmake --build .
cd chatacli/build; sudo cmake --install .
# clear all CMake files for everything
clean:
@just clean-lib
@just clean-cli
# clear all CMake files for just libchata
clean-lib:
if [ -d "libchata/build" ]; then rm -rf libchata/build; fi
# clear all CMake files for just chatacli
clean-cli:
if [ -d "chatacli/build" ]; then rm -rf chatacli/build; fi
# format all code
format:
cd libchata/src; find '(' -name '*.cpp' -o -name '*.hpp' ')' -exec clang-format-15 --Werror -i --verbose '{}' +
cd chatacli/src; find '(' -name '*.cpp' -o -name '*.hpp' ')' -exec clang-format-15 --Werror -i --verbose '{}' +
# check if all code is formatted
check-format:
cd libchata/src; find '(' -name '*.cpp' -o -name '*.hpp' ')' -exec clang-format-15 --Werror -i --verbose --dry-run '{}' +
cd chatacli/src; find '(' -name '*.cpp' -o -name '*.hpp' ')' -exec clang-format-15 --Werror -i --verbose --dry-run '{}' +
# run codegen scripts
generate:
cd libchata/src; python3 generate_instruction_search.py
cd libchata/src; python3 generate_register_search.py
cd libchata/src; python3 generate_csr_search.py
cd libchata/src; python3 generate_pseudoinstruction_converter.py
# run testsuites for everything
test:
@just test-lib
# run testsuite for just libchata
test-lib:
cd libchata/build; ./test_libchata