cc := "clang"
cc_flags := "-Wall -Wextra -std=c11"

@clean:
  rm -rf build

@mkdir-build: clean
  mkdir -p build

@build-info: mkdir-build
    {{cc}} -ggdb -o build/info1 info/main.c
    {{cc}} -ggdb -o build/info2 info/main.c

@debug-info: build-info
    gf2 build/info1 & disown
    gf2 build/info2 & disown

@build-mem-alloc: mkdir-build
    {{cc}} -o build/mem-alloc mem-alloc/main.c mem-alloc/best_fit_allocator.c

@run-mem-alloc: build-mem-alloc
    build/mem-alloc

@build-calc: mkdir-build
    {{cc}} -o build/calc calc/calc.c
    {{cc}} -o build/num-writer calc/num-writer.c
    {{cc}} -o build/op-writer calc/op-writer.c
