commit 6907e8708e6aaa9c037f771b9f0dde2fbd419cd4
parent 5b667362498ed4cdc6ad5a9036834c6ab1bed4e9
Author: Louis Burda <quent.burda@gmail.com>
Date: Mon, 1 May 2023 19:49:14 +0200
Add 'just' build file
Diffstat:
3 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -2,4 +2,5 @@ compile_commands.json
build
.cache
vgcore*
+.gdb_history
test
diff --git a/build.jst b/build.jst
@@ -0,0 +1,34 @@
+cflags = -Wunused-function -Wunused-variable -Wconversion -Wformat
+ -I include
+
+rule liba
+ gcc -o $out.tmp.o $in $cflags -r
+ objcopy --keep-global-symbols=liballoc.api $out.tmp.o $out.fixed.o
+ ar rcs $out $out.fixed.o
+ rm $out.tmp.o $out.fixed.o
+
+rule libso
+ gcc -o $out $in $cflags -shared -Wl,-version-script liballoc.lds
+
+rule cc
+ gcc -o $out $in $cflags
+
+rule mkdir
+ mkdir $out
+
+target build
+ mkdir
+
+target build/liballoc.a
+ # TODO add include dep
+ liba src/allocator.c
+
+target build/liballoc.so
+ # TODO add include dep
+ libso src/allocator.c
+
+target build/test
+ cc src/test.c build/liballoc.a
+
+target all
+ file build build/liballoc.a build/liballoc.so build/test
diff --git a/common.mk b/common.mk
@@ -1,7 +1,9 @@
LIBALLOC_A = build/liballoc.a
LIBALLOC_A_SRC = src/allocator.c
LIBALLOC_A_DEP = $(LIBALLOC_A_SRC) include/allocator.h
+LIBALLOC_A_SRCDEP = $(LIBALLOC_A_DEP)
LIBALLOC_SO = build/liballoc.so
LIBALLOC_SO_SRC = src/allocator.c
LIBALLOC_SO_DEP = $(LIBALLOC_SO_SRC) include/allocator.h
+LIBALLOC_SO_SRCDEP = $(LIBALLOC_SO_DEP)