-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
37 lines (32 loc) · 852 Bytes
/
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
srcs := "./tests/*.cpp"
outpath := "./build"
include := "./include"
default_cc := "/usr/bin/env g++"
cppflags := "-std=c++20 -Wall"
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
alias b := build-tests
alias t := run-tests
alias nt := nmake-tests
alias c := clean
build-tests cc=default_cc:
#!/bin/bash
set -e
set -x
mkdir -p "{{ outpath }}"
for src in {{ srcs }}; do
file=`basename $src`;
outbin="{{ outpath }}/${file%.*}";
{{ cc }} $src -I"{{ include }}" -o "$outbin" {{ cppflags }};
done
run-tests cc=default_cc: (build-tests cc)
#!/bin/bash
set -e
set -x
for bin in "{{ outpath }}"/*; do
$bin;
done
nmake-tests:
nmake -f nmakefile
Get-ChildItem "{{ outpath }}" -Filter *.exe | Foreach-Object { & $_.FullName }
clean:
rm -r "{{ outpath }}"