All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m46s
52 lines
984 B
Makefile
52 lines
984 B
Makefile
cc := clang
|
|
ld := ld.lld
|
|
o :=
|
|
c :=
|
|
ldflags += -L ../libsystem/build -l:libsystem.a
|
|
cflags += -isystem ../libsystem
|
|
extra_deps +=
|
|
|
|
include src.mk
|
|
include app.mk
|
|
include ../generic/flags.mk
|
|
include ../$(platform)/flags.mk
|
|
|
|
FORMAT ?= clang-format -i $$(git ls-files '*.c' '*.h')
|
|
|
|
DOCS_COLLECT ?= $$(git ls-files '*.c' '*.h')
|
|
|
|
DOCS ?= \
|
|
rm -rf docs; \
|
|
clang-doc --format=md --output docs -p . $(DOCS_COLLECT); \
|
|
for f in ./docs/GlobalNamespace/*.md; \
|
|
do sed -i '/^\# Global Namespace/d' "$$f"; \
|
|
done; \
|
|
rm -rf ../docs/apps/$(app); \
|
|
mkdir -p ../docs/apps/$(app); \
|
|
cp ./docs/GlobalNamespace/*.md ../docs/apps/$(app);
|
|
|
|
all: $(app)
|
|
|
|
$(app): $(extra_deps) $(o)
|
|
$(ld) -o $@ $(ldflags) -T ../$(platform)/link.ld $(o)
|
|
|
|
%.o: %.c
|
|
$(cc) -c -o $@ $(cflags) $<
|
|
|
|
%.o: %.S
|
|
$(cc) -c -o $@ $(cflags) $<
|
|
|
|
clean:
|
|
rm -f $(o) $(app)
|
|
|
|
format:
|
|
$(FORMAT)
|
|
|
|
docs:
|
|
$(DOCS)
|
|
|
|
compiledb:
|
|
bear --output compile_commands.json -- make platform=$(platform) all
|
|
|
|
.PHONY: all clean format docs compiledb
|