Generic lib.mk makefile for building libraries
All checks were successful
Build documentation / build-and-deploy (push) Successful in 1m32s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 1m32s
This commit is contained in:
@@ -1,33 +1,7 @@
|
|||||||
cc := clang
|
include ../make/ufuncs.mk
|
||||||
o :=
|
|
||||||
c :=
|
|
||||||
cflags := -isystem . -isystem ../libmsl
|
|
||||||
buildtype ?= release
|
|
||||||
|
|
||||||
include src.mk
|
$(eval $(call add_include,libmsl))
|
||||||
include ../generic/flags.mk
|
|
||||||
include ../$(platform)/flags.mk
|
|
||||||
|
|
||||||
all: build/liballoc.a
|
libname := liballoc
|
||||||
|
|
||||||
build/liballoc.a: $(o)
|
include ../make/lib.mk
|
||||||
llvm-ar rcs $@ $^
|
|
||||||
|
|
||||||
%.o: %.c
|
|
||||||
$(cc) -c -o $@ $(cflags) $<
|
|
||||||
|
|
||||||
%.o: %.S
|
|
||||||
$(cc) -c -o $@ $(cflags) $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(o) build/liballoc.a
|
|
||||||
|
|
||||||
format:
|
|
||||||
clang-format -i $$(git ls-files '*.c' '*.h')
|
|
||||||
|
|
||||||
docs:
|
|
||||||
clang-doc --format=md --output docs -p . $$(git ls-files '*.h')
|
|
||||||
mkdir -p ../docs/libs/liballoc
|
|
||||||
cp ./docs/GlobalNamespace/*.md ../docs/libs/liballoc
|
|
||||||
|
|
||||||
.PHONY: all clean format
|
|
||||||
|
|||||||
@@ -1,33 +1,7 @@
|
|||||||
cc := clang
|
include ../make/ufuncs.mk
|
||||||
o :=
|
|
||||||
c :=
|
|
||||||
cflags := -isystem . -isystem ../liballoc
|
|
||||||
buildtype ?= release
|
|
||||||
|
|
||||||
include src.mk
|
$(eval $(call add_include,liballoc))
|
||||||
include ../generic/flags.mk
|
|
||||||
include ../$(platform)/flags.mk
|
|
||||||
|
|
||||||
all: build/libmsl.a
|
libname := libmsl
|
||||||
|
|
||||||
build/libmsl.a: $(o)
|
include ../make/lib.mk
|
||||||
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')
|
|
||||||
|
|
||||||
docs:
|
|
||||||
clang-doc --format=md --output docs -p . $$(git ls-files '*.h')
|
|
||||||
mkdir -p ../docs/libs/libmsl
|
|
||||||
cp ./docs/GlobalNamespace/*.md ../docs/libs/libmsl
|
|
||||||
|
|
||||||
.PHONY: all clean format
|
|
||||||
|
|||||||
@@ -1,33 +1,8 @@
|
|||||||
cc := clang
|
include ../make/ufuncs.mk
|
||||||
o :=
|
|
||||||
c :=
|
|
||||||
cflags := -isystem . -isystem ../libmsl -isystem ../liballoc
|
|
||||||
buildtype ?= release
|
|
||||||
|
|
||||||
include src.mk
|
$(eval $(call add_include,libmsl))
|
||||||
include ../generic/flags.mk
|
$(eval $(call add_include,liballoc))
|
||||||
include ../$(platform)/flags.mk
|
|
||||||
|
|
||||||
all: build/libprocess.a
|
libname := libprocess
|
||||||
|
|
||||||
build/libprocess.a: $(o)
|
include ../make/lib.mk
|
||||||
llvm-ar rcs $@ $^
|
|
||||||
|
|
||||||
%.o: %.c
|
|
||||||
$(cc) -c -o $@ $(cflags) $<
|
|
||||||
|
|
||||||
%.o: %.S
|
|
||||||
$(cc) -c -o $@ $(cflags) $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(o) build/libprocess.a
|
|
||||||
|
|
||||||
format:
|
|
||||||
clang-format -i $$(git ls-files '*.c' '*.h')
|
|
||||||
|
|
||||||
docs:
|
|
||||||
clang-doc --format=md --output docs -p . $$(git ls-files '*.h')
|
|
||||||
mkdir -p ../docs/libs/libprocess
|
|
||||||
cp ./docs/GlobalNamespace/*.md ../docs/libs/libprocess
|
|
||||||
|
|
||||||
.PHONY: all clean format
|
|
||||||
|
|||||||
@@ -1,33 +1,7 @@
|
|||||||
cc := clang
|
include ../make/ufuncs.mk
|
||||||
o :=
|
|
||||||
c :=
|
|
||||||
cflags := -isystem . -isystem ../libmsl
|
|
||||||
buildtype ?= release
|
|
||||||
|
|
||||||
include src.mk
|
$(eval $(call add_include,libmsl))
|
||||||
include ../generic/flags.mk
|
|
||||||
include ../$(platform)/flags.mk
|
|
||||||
|
|
||||||
all: build/libstring.a
|
libname := libstring
|
||||||
|
|
||||||
build/libstring.a: $(o)
|
include ../make/lib.mk
|
||||||
llvm-ar rcs $@ $^
|
|
||||||
|
|
||||||
%.o: %.c
|
|
||||||
$(cc) -c -o $@ $(cflags) $<
|
|
||||||
|
|
||||||
%.o: %.S
|
|
||||||
$(cc) -c -o $@ $(cflags) $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(o) build/libstring.a
|
|
||||||
|
|
||||||
format:
|
|
||||||
clang-format -i $$(git ls-files '*.c' '*.h')
|
|
||||||
|
|
||||||
docs:
|
|
||||||
clang-doc --format=md --output docs -p . $$(git ls-files '*.h')
|
|
||||||
mkdir -p ../docs/libs/libstring
|
|
||||||
cp ./docs/GlobalNamespace/*.md ../docs/libs/libstring
|
|
||||||
|
|
||||||
.PHONY: all clean format
|
|
||||||
|
|||||||
@@ -1,33 +1,7 @@
|
|||||||
cc := clang
|
include ../make/ufuncs.mk
|
||||||
o :=
|
|
||||||
c :=
|
|
||||||
cflags := -isystem . -isystem ../libmsl
|
|
||||||
buildtype ?= release
|
|
||||||
|
|
||||||
include src.mk
|
$(eval $(call add_include,libmsl))
|
||||||
include ../generic/flags.mk
|
|
||||||
include ../$(platform)/flags.mk
|
|
||||||
|
|
||||||
all: build/libterminal.a
|
libname := libterminal
|
||||||
|
|
||||||
build/libterminal.a: $(o)
|
include ../make/lib.mk
|
||||||
llvm-ar rcs $@ $^
|
|
||||||
|
|
||||||
%.o: %.c
|
|
||||||
$(cc) -c -o $@ $(cflags) $<
|
|
||||||
|
|
||||||
%.o: %.S
|
|
||||||
$(cc) -c -o $@ $(cflags) $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f $(o) build/libterminal.a
|
|
||||||
|
|
||||||
format:
|
|
||||||
clang-format -i $$(git ls-files '*.c' '*.h')
|
|
||||||
|
|
||||||
docs:
|
|
||||||
clang-doc --format=md --output docs -p . $$(git ls-files '*.h')
|
|
||||||
mkdir -p ../docs/libs/libterminal
|
|
||||||
cp ./docs/GlobalNamespace/*.md ../docs/libs/libterminal
|
|
||||||
|
|
||||||
.PHONY: all clean format
|
|
||||||
|
|||||||
33
make/lib.mk
Normal file
33
make/lib.mk
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
cc := clang
|
||||||
|
o :=
|
||||||
|
c :=
|
||||||
|
cflags += -isystem .
|
||||||
|
buildtype ?= release
|
||||||
|
|
||||||
|
include src.mk
|
||||||
|
include ../generic/flags.mk
|
||||||
|
include ../$(platform)/flags.mk
|
||||||
|
|
||||||
|
all: build/$(libname).a
|
||||||
|
|
||||||
|
build/$(libname).a: $(o)
|
||||||
|
llvm-ar rcs $@ $^
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(cc) -c -o $@ $(cflags) $<
|
||||||
|
|
||||||
|
%.o: %.S
|
||||||
|
$(cc) -c -o $@ $(cflags) $<
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(o) build/$(libname).a
|
||||||
|
|
||||||
|
format:
|
||||||
|
clang-format -i $$(git ls-files '*.c' '*.h')
|
||||||
|
|
||||||
|
docs:
|
||||||
|
clang-doc --format=md --output docs -p . $$(git ls-files '*.h')
|
||||||
|
mkdir -p ../docs/libs/$(libname)
|
||||||
|
cp ./docs/GlobalNamespace/*.md ../docs/libs/$(libname)
|
||||||
|
|
||||||
|
.PHONY: all clean format
|
||||||
@@ -2,3 +2,7 @@ define add_lib
|
|||||||
ldflags += -L ../$(1)/build -l:$(1).a
|
ldflags += -L ../$(1)/build -l:$(1).a
|
||||||
cflags += -isystem ../$(1)
|
cflags += -isystem ../$(1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define add_include
|
||||||
|
cflags += -isystem ../$(1)
|
||||||
|
endef
|
||||||
|
|||||||
Reference in New Issue
Block a user