cc := clang
o :=
c :=
cflags  := -isystem .
buildtype ?= release

include src.mk
include ../generic/flags.mk
include ../$(platform)/flags.mk

all: build/libmsl.a

build/libmsl.a: $(o)
	llvm-ar rcs $@ $^

%.o: %.c
	$(cc) -c -o $@ $(cflags) $<

%.o: %.S
	$(cc) -c -o $@ $(cflags) $<

clean:
	rm -f $(o) build/libmsl.a

format:
	clang-format -i $$(git ls-files '*.c' '*.h')

.PHONY: all clean format
