summaryrefslogtreecommitdiff
path: root/build.ninja
blob: 5b4ffd5d15390dd28afe5e753338fe9476463ea7 (plain) (blame)
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
cc       = clang++
cxxflags = -Ofast -std=c++20 -Weverything -Wno-c++98-compat-pedantic
out_dir  = out
name     = platypus
src_dir  = $name
out_ext  = .exe

rule clang_format
  command = clang-format -i $src_dir/*.cpp $src_dir/*.h

rule compile
  command = $cc $cxxflags -c $in -o $out

rule link
  command = $cc $in -o $out

build _format: clang_format

build format: phony _format

build $out_dir/platypus.o:     compile $src_dir/platypus.cpp
build $out_dir/testPlatypus.o: compile $src_dir/testPlatypus.cpp

build $out_dir/$name$out_ext: link $out_dir/platypus.o $out_dir/testPlatypus.o | format

default $out_dir/$name$out_ext